X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgamescr.c;h=4fce8f7b08b427db5f129ca3be6e09f830abd340;hb=af7c842d19c318b8958e1acecce6ff0a7c7b0591;hp=e46738122a75311c93dc6cd23b7359d77e00d76e;hpb=5c4d558de0e36ab49283c9c529b49b8d6b62f146;p=gbajam22 diff --git a/src/gamescr.c b/src/gamescr.c index e467381..4fce8f7 100644 --- a/src/gamescr.c +++ b/src/gamescr.c @@ -19,6 +19,7 @@ #define P_RATE 500 #define E_RATE 500 +#define SHOT_TIME 50 static int gamescr_start(void); static void gamescr_stop(void); @@ -284,8 +285,8 @@ static int update(void) pos[0] += fwd[0]; pos[1] += fwd[1]; } + if((keystate & BN_B) && (timer_msec - last_shot >= P_RATE)) { - emuprint("pew"); last_shot = timer_msec; for(i=0; i= 0) { @@ -372,6 +373,17 @@ static int update(void) } enemy++; } + if(timer_msec - last_shot <= SHOT_TIME) { + spr_oam(oam, dynspr_base + snum++, SPRID_LAS0, -8, 118, SPR_SZ32 | SPR_256COL); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS1, 22, 103, SPR_SZ32 | SPR_256COL); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS2, 54, 88, SPR_SZ32 | SPR_256COL); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS3, 86, 72, SPR_SZ32 | SPR_256COL); + + spr_oam(oam, dynspr_base + snum++, SPRID_LAS0, 240 + 8 - 32, 118, SPR_SZ32 | SPR_256COL | SPR_HFLIP); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS1, 240 - 22 - 32, 103, SPR_SZ32 | SPR_256COL | SPR_HFLIP); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS2, 240 - 54 - 32, 88, SPR_SZ32 | SPR_256COL | SPR_HFLIP); + spr_oam(oam, dynspr_base + snum++, SPRID_LAS3, 240 - 86 - 32, 72, SPR_SZ32 | SPR_256COL | SPR_HFLIP); + } for(i=snum; i