enemy bullets

This commit is contained in:
t. boddy 2026-02-14 21:29:18 -05:00
parent 7f935f0514
commit 30734885e4
3 changed files with 28 additions and 5 deletions

View file

@ -81,6 +81,9 @@ void spawnBullet(struct bulletSpawner spawner, void(*updater)){
TILE_ATTR(gameOver ? PAL1 : PAL0, 0, 0, spawner.player && spawner.angle == 512 ? 1 : 0));
if(spawner.anim) SPR_setAnim(bullets[i].image, spawner.anim);
bullets[i].anim = spawner.anim;
bullets[i].frame = spawner.frame;
SPR_setFrame(bullets[i].image, spawner.frame);
SPR_setAnim(bullets[i].image, spawner.anim);
SPR_setDepth(bullets[i].image, spawner.player ? 7 : (spawner.top ? 3 : 4));
doBulletRotation(i);
}
@ -119,10 +122,10 @@ static void collideWithPlayer(u8 i){
s32 dist = getApproximatedDistance(
fix32ToInt(deltaX),
fix32ToInt(deltaY));
if(dist <= 16){ // Player hit radius
if(dist <= 4){ // Player hit radius
killBullet(i);
player.lives--;
if(player.lives <= 0) gameOver = TRUE;
// player.lives--;
// if(player.lives <= 0) gameOver = TRUE;
}
}
}