Fix cheat e level cap: SELECT+A+B al livello 8 va al finale
Il cheat SELECT+A+B ora controlla il livello: se >= 8 triggera game_over=3 (finale tragico) invece di game_over=2. Aggiunge anche un cap level < 8 nel level++ per evitare overflow al livello 9.
This commit is contained in:
+7
-3
@@ -241,7 +241,11 @@ void engine_update(uint8_t keys, uint8_t prev_keys) {
|
|||||||
|
|
||||||
// --- CHEAT: SELECT+A+B = vinci il livello (per test) ---
|
// --- CHEAT: SELECT+A+B = vinci il livello (per test) ---
|
||||||
if ((keys & J_SELECT) && (keys & J_A) && (keys & J_B) && !game_over) {
|
if ((keys & J_SELECT) && (keys & J_A) && (keys & J_B) && !game_over) {
|
||||||
game_over = 2; // Victory / Going Deeper
|
if (level >= 8) {
|
||||||
|
game_over = 3; // Finale tragico (livello 8 completato)
|
||||||
|
} else {
|
||||||
|
game_over = 2; // Victory / Going Deeper
|
||||||
|
}
|
||||||
game_over_timer = 30; // timer drammatico (mezzo secondo)
|
game_over_timer = 30; // timer drammatico (mezzo secondo)
|
||||||
sound_reset_music_state();
|
sound_reset_music_state();
|
||||||
}
|
}
|
||||||
@@ -284,8 +288,8 @@ void engine_update(uint8_t keys, uint8_t prev_keys) {
|
|||||||
// Attende la pressione di START per riavviare
|
// Attende la pressione di START per riavviare
|
||||||
if ((keys & J_START) && !(prev_keys & J_START)) {
|
if ((keys & J_START) && !(prev_keys & J_START)) {
|
||||||
if (game_over == 2) {
|
if (game_over == 2) {
|
||||||
// Going Deeper -> livello successivo
|
// Going Deeper -> livello successivo (max 8)
|
||||||
level++;
|
if (level < 8) level++;
|
||||||
move_metasprite(gameover_metasprites[0], player_TILE_COUNT + enemy_TILE_COUNT, 8, 0, 0);
|
move_metasprite(gameover_metasprites[0], player_TILE_COUNT + enemy_TILE_COUNT, 8, 0, 0);
|
||||||
SHOW_SPRITES;
|
SHOW_SPRITES;
|
||||||
engine_init();
|
engine_init();
|
||||||
|
|||||||
Reference in New Issue
Block a user