X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgamescr.c;fp=src%2Fgamescr.c;h=62c16a9e39436ec19e6d413a223c5f6e19e9cd6d;hb=797884e55a370ff38e244375cc503e97b6355222;hp=64169e73037a023e446c6538bc8f000a2a0f0e0d;hpb=ee0d92a6e621e6a8135b16914a09def52bd70a4b;p=gbajam22 diff --git a/src/gamescr.c b/src/gamescr.c index 64169e7..62c16a9 100644 --- a/src/gamescr.c +++ b/src/gamescr.c @@ -187,7 +187,7 @@ static int gamescr_start(void) enemy->vobj.px = -1; enemy->anm = 0xff; enemy->hp = ENEMY_ENERGY; - enemy->last_shot = timer_msec > E_RATE ? timer_msec - E_RATE : 0; + enemy->last_shot = -1; enemy->shot_frame = -1; if(++total_enemies >= MAX_ENEMIES) { goto endspawn; @@ -197,7 +197,6 @@ static int gamescr_start(void) } } endspawn: - total_enemies = 1; /* XXX DBG */ /* check continuity */ for(i=0; ivobj.px >= 0) { /* check rate of fire and start a shot if necessary */ - if(timer_msec - enemy->last_shot >= E_RATE) { + if(enemy->last_shot == -1) { + enemy->last_shot = timer_msec; + } else if(timer_msec - enemy->last_shot >= E_RATE) { enemy->last_shot = timer_msec; enemy->shot_frame = 0; }