diff --git a/res/alice.png b/res/alice.png deleted file mode 100644 index 58ff397..0000000 Binary files a/res/alice.png and /dev/null differ diff --git a/res/butterfly.png b/res/butterfly.png deleted file mode 100644 index 511385a..0000000 Binary files a/res/butterfly.png and /dev/null differ diff --git a/res/clouds.png b/res/clouds.png deleted file mode 100644 index 2ef1ec5..0000000 Binary files a/res/clouds.png and /dev/null differ diff --git a/res/fadebottom.png b/res/fadebottom.png deleted file mode 100644 index b01a660..0000000 Binary files a/res/fadebottom.png and /dev/null differ diff --git a/res/fadetop.png b/res/fadetop.png deleted file mode 100644 index 494b862..0000000 Binary files a/res/fadetop.png and /dev/null differ diff --git a/res/human.png b/res/human.png deleted file mode 100644 index 619fdd3..0000000 Binary files a/res/human.png and /dev/null differ diff --git a/res/resources.res b/res/resources.res index 3fc9525..315ddf7 100644 --- a/res/resources.res +++ b/res/resources.res @@ -5,10 +5,6 @@ IMAGE logo "logo.png" NONE NONE IMAGE sky "sky.png" NONE NONE IMAGE ground "ground.png" NONE NONE -// IMAGE clouds "clouds.png" NONE NONE - -IMAGE fadeTop "fadetop.png" NONE NONE -IMAGE fadeBottom "fadebottom.png" NONE NONE // SPRITE sakuyaSprite "sakuya.png" 4 4 NONE 0 SPRITE sakuyaSprite "sakuya2.png" 6 6 NONE 0 @@ -16,11 +12,8 @@ SPRITE sakuyaSprite "sakuya2.png" 6 6 NONE 0 SPRITE bulletsSprite "bullets.png" 2 2 NONE 0 SPRITE pBulletSprite "pbullet.png" 4 4 NONE 0 -SPRITE butterflySprite "butterfly.png" 4 4 NONE 8 // SPRITE fairySprite "fairy.png" 4 4 NONE 8 SPRITE fairySprite "fairy2.png" 4 4 NONE 8 -SPRITE aliceSprite "alice.png" 6 6 NONE 0 -SPRITE humanSprite "human.png" 2 2 NONE 0 SPRITE koaSprite "koakuma.png" 4 4 NONE 0 // IMAGE mapPlayer "mapplayer.png" NONE NONE diff --git a/src/background.h b/src/background.h index 680ce4f..4983eed 100644 --- a/src/background.h +++ b/src/background.h @@ -20,8 +20,6 @@ void loadBackground(){ VDP_setVerticalScroll(BG_B, 32); VDP_loadTileSet(sky.tileset, BG_I, DMA); VDP_loadTileSet(ground.tileset, BG_I + 64, DMA); - VDP_loadTileSet(fadeBottom.tileset, BG_I + 64 + 64, DMA); - VDP_loadTileSet(fadeTop.tileset, BG_I + 64 + 64 + 4, DMA); for(u8 y = 0; y < 4; y++){ for(u8 x = 0; x < 16; x++){ VDP_fillTileMapRectInc(BG_B, TILE_ATTR_FULL(PAL1, 0, 0, 0, BG_I + (y > 2 ? 64 : 0)), x * 8, y * 8, 8, 8); @@ -40,12 +38,6 @@ void loadBackground(){ for(u8 i = 0; i < 8; i++) bgScroll[27 - i] = (initScroll - fix32ToInt(parallaxAccum[i])); VDP_setHorizontalScrollTile(BG_B, 0, bgScroll, 28, DMA); - - // fade - // for(u8 x = 0; x < 20; x++) - // VDP_fillTileMapRectInc(BG_A, TILE_ATTR_FULL(PAL1, 0, 0, 0, BG_I + 64 + 64), x * 2, 26, 2, 2); - // for(u8 x = 0; x < 10; x++) - // VDP_fillTileMapRectInc(BG_A, TILE_ATTR_FULL(PAL1, 0, 0, 0, BG_I + 64 + 64 + 4), x * 4, 22, 4, 4); } void updateBackground(){ diff --git a/src/bullets.h b/src/bullets.h index a23be4e..5e65a49 100644 --- a/src/bullets.h +++ b/src/bullets.h @@ -68,13 +68,13 @@ void spawnBullet(struct bulletSpawner spawner, void(*updater)){ s16 i = -1; for(s16 j = 0; j < BULLET_COUNT; j++) if(!bullets[j].active) { i = j; break; } if(i == -1 && spawner.player){ - for(s16 j = 0; j < BULLET_COUNT; j++) if(bullets[j].active && !bullets[j].player){ killBullet(j, FALSE); i = j; + break; } - - } else if(i == -1 && !spawner.player) return; + } + if(i == -1) return; bullets[i].active = TRUE; bullets[i].pos.x = spawner.x; @@ -93,9 +93,6 @@ void spawnBullet(struct bulletSpawner spawner, void(*updater)){ bullets[i].explosion = FALSE; bullets[i].dist = bullets[i].player ? 16 : (spawner.anim == 0 ? 4 : 7); - u8 off = bullets[i].player ? P_BULLET_OFF : BULLET_OFF; - s16 sx = getScreenX(bullets[i].pos.x, player.camera); - s16 sy = fix32ToInt(bullets[i].pos.y); bullets[i].image = SPR_addSprite(spawner.player ? &pBulletSprite : &bulletsSprite, -32, -32, TILE_ATTR(gameOver ? PAL1 : PAL0, 0, 0, spawner.player && spawner.angle == 512 ? 1 : 0)); @@ -105,11 +102,10 @@ void spawnBullet(struct bulletSpawner spawner, void(*updater)){ return; } - 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_setFrame(bullets[i].image, spawner.frame); SPR_setDepth(bullets[i].image, spawner.player ? 7 : (spawner.top ? 3 : 4)); doBulletRotation(i); } diff --git a/src/enemytypes.h b/src/enemytypes.h index 61f0ee4..a020b60 100644 --- a/src/enemytypes.h +++ b/src/enemytypes.h @@ -92,8 +92,8 @@ void updateEnemyOne(u8 i){ } // normal shooting - if(enemies[i].clock % 20 == enemies[i].ints[0] && enemies[i].onScreen){ - enemies[i].clock % 40 == enemies[i].ints[0] ? sfxEnemyShotB() : sfxEnemyShotA(); + if((s16)(enemies[i].clock % 20) == enemies[i].ints[0] && enemies[i].onScreen){ + (s16)(enemies[i].clock % 40) == enemies[i].ints[0] ? sfxEnemyShotB() : sfxEnemyShotA(); struct bulletSpawner spawner = { .x = enemies[i].pos.x, .y = enemies[i].pos.y, diff --git a/src/global.h b/src/global.h index fed9c96..70ca447 100644 --- a/src/global.h +++ b/src/global.h @@ -1,3 +1,13 @@ +// forward declarations (defined in sfx.h, chrome.h, main.c) +void sfxPlayerShot(); +void sfxEnemyShotA(); +void sfxEnemyShotB(); +void sfxEnemyShotC(); +void sfxExplosion(); +void sfxPickup(); +void loadMap(); +void loadGame(); + u32 clock; #define CLOCK_LIMIT 32000 #define PROP_COUNT 8 @@ -23,7 +33,6 @@ u32 score; #define MAP_W 38 #define MAP_H 3 -char debugStr[8]; void EMPTY(s16 i){(void)i;} bool started; @@ -62,7 +71,7 @@ struct playerStruct { Vect2D_f32 pos, vel; s16 shotAngle; u8 lives, recoveringClock; - fix32 camera, yCamera; + fix32 camera; Sprite* image; }; struct playerStruct player; diff --git a/src/player.h b/src/player.h index 511365e..53e9548 100644 --- a/src/player.h +++ b/src/player.h @@ -84,8 +84,6 @@ static void boundsPlayer(){ player.camera += GAME_WRAP; } - player.yCamera = (fix32ToInt(player.pos.y) - FIX16(112)) >> 2; - } static void cameraPlayer(){ @@ -126,7 +124,6 @@ void loadPlayer(){ fix32ToInt(player.pos.x) - PLAYER_OFF, fix32ToInt(player.pos.y) - PLAYER_OFF, TILE_ATTR(PAL0, 0, 0, 0)); - player.yCamera = (fix32ToInt(player.pos.y) - FIX16(112)) >> 2; } void updatePlayer(){ @@ -150,6 +147,5 @@ void updatePlayer(){ s16 sx = getScreenX(player.pos.x, player.camera); s16 sy = fix32ToInt(player.pos.y); SPR_setPosition(player.image, sx - PLAYER_OFF, sy - PLAYER_OFF); - intToStr(fix32ToInt(player.pos.x), debugStr, 1); } } \ No newline at end of file