29 update every entity in the update list
30 dispatch collision events
31 execute spawn and delete events
39 stage_draw_bg(cx
, cy
);
40 //entity_draw_visible(cx, cy);
41 stage_draw_fg(cx
, cy
);
47 static void press(input in
){
48 if(in
.button
== ESCAPE_KEY
){
52 printf("press: %s\n", input_str(in
));
55 case LEFT_BUTTON
: cvx
+= -1; break;
56 case RIGHT_BUTTON
: cvx
+= 1; break;
57 case UP_BUTTON
: cvy
+= -1; break;
58 case DOWN_BUTTON
: cvy
+= 1; break;
67 static void release(input in
){
68 printf("release: %s\n", input_str(in
));
74 case LEFT_BUTTON
: cvx
-= -1; break;
75 case RIGHT_BUTTON
: cvx
-= 1; break;
76 case UP_BUTTON
: cvy
-= -1; break;
77 case DOWN_BUTTON
: cvy
-= 1; break;
85 set_handler(update
, draw
, press
, release
);
89 int x
= load_zone("woods");
91 error_msg("inner: cannot load zone\n");
112 stage - the stage, collision with stage, stage events
113 entity - moving, colliding, active/inactive stuff
114 inner - update draw press release
118 this is the inner file
119 the starting point to the internal game workings
120 independent of i/o, game loops, or graphics details
122 draw - draw the current state of the game
123 use current camera pos to...
124 draw the stage, efficiently draws the tiles and background
125 draw visible entities
127 draw foreground decorations
131 move entities / execute collision
133 deactivate certain entities
136 do global actions like pause, open menu
137 do player specific actions