23 #include <testplayer.h>
25 //typedef struct player player;
26 static player
* pl
= NULL
;
31 update every entity in the update list
32 dispatch collision events
33 execute spawn and delete events
48 if(stage_xcollide(x0
, y0
, pl
->w
, pl
->h
, x1
-x0
, &xx
)){
53 if(stage_ycollide(x1
, y0
, pl
->w
, pl
->h
, y1
-y0
, &yy
)){
61 //entity_draw_visible(cx, cy);
63 // draw_gfx(dummy_gfx,px,py,16,0,8,8);
70 static void press(input in
){
71 if(in
.button
== ESCAPE_KEY
){
76 player_press(pl
, in
.button
);
79 static void release(input in
){
80 player_release(pl
, in
.button
);
86 set_handler(update
, draw
, press
, release
);
88 pl
= mk_test_player(16*3,4*16);
91 int x
= load_zone("woods");
93 error_msg("inner: cannot load zone\n");
101 switch_stage("base");
114 stage - the stage, collision with stage, stage events
115 entity - moving, colliding, active/inactive stuff
116 inner - update draw press release
120 this is the inner file
121 the starting point to the internal game workings
122 independent of i/o, game loops, or graphics details
124 draw - draw the current state of the game
125 use current camera pos to...
126 draw the stage, efficiently draws the tiles and background
127 draw visible entities
129 draw foreground decorations
133 move entities / execute collision
135 deactivate certain entities
138 do global actions like pause, open menu
139 do player specific actions