feat: increase initial rats to 4 and add dedicated bomb drop sfx

This commit is contained in:
2026-06-18 00:03:04 +02:00
parent 2407115a79
commit 34e8921d97
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ void drop_bomb(uint8_t x, uint8_t y) {
bomb.x = x;
bomb.y = y;
bomb.timer = 180; // 3 seconds
play_sfx_plop(); // Generic drop sound
play_sfx_bomb_drop(); // Suono innesco
}
}
+8
View File
@@ -429,3 +429,11 @@ void play_sfx_explosion(void) {
NR43_REG = 0x6E;
NR44_REG = 0xC0;
}
void play_sfx_bomb_drop(void) {
// Un suono di innesco "tsst" (miccia)
NR41_REG = 0x01; // Corto
NR42_REG = 0xA2; // Volume alto, decadimento rapido
NR43_REG = 0x22; // Frequenza alta, noise
NR44_REG = 0xC0; // Trigger
}
+1
View File
@@ -7,6 +7,7 @@ void update_music(void);
void play_sfx_moan(void);
void play_sfx_plop(void);
void play_sfx_explosion(void);
void play_sfx_bomb_drop(void);
void play_game_over_music(void);
+6 -4
View File
@@ -48,9 +48,11 @@ void init_rats(void) {
OBP0_REG = 0xE4; // Palette standard
// Posizioni iniziali garantite vuote (coordinate dispari)
uint8_t start_pos[2][2] = {
uint8_t start_pos[4][2] = {
{1, 1},
{17, 15}
{17, 15},
{17, 1},
{1, 15}
};
for (uint8_t i = 0; i < MAX_RATS; i++) {
@@ -64,8 +66,8 @@ void init_rats(void) {
move_sprite(rats[i].sprite_base_idx + 1, 0, 0);
}
// Attiva i primi due topi
for (uint8_t i = 0; i < 2; i++) {
// Attiva i primi quattro topi
for (uint8_t i = 0; i < 4; i++) {
rats[i].active = 1;
rats[i].rat_x = start_pos[i][0];
rats[i].rat_y = start_pos[i][1];