step 1: mort_scene substituix doMort() amb la capa scenes::

This commit is contained in:
2026-04-15 23:05:45 +02:00
parent 4436f7f569
commit d86cb21efa
6 changed files with 129 additions and 36 deletions

View File

@@ -57,9 +57,7 @@ int ModuleSequence::Go() {
case 8: // Credits
doCredits();
break;
case 100: // Mort
doMort();
break;
// case 100 (Mort) → migrat a scenes::MortScene, dispatch via SceneRegistry.
}
JD8_FadeOut();
@@ -1292,35 +1290,4 @@ void ModuleSequence::doCredits() {
JD8_FreeSurface(vaddr2);
}
void ModuleSequence::doMort() {
play_music("00000001.ogg");
JI_DisableKeyboard(60);
info::ctx.vida = 5;
this->contador = 1000;
JD8_Surface gfx = JD8_LoadSurface("gameover.gif");
JD8_Palette pal = JD8_LoadPalette("gameover.gif");
JD8_ClearScreen(0);
JD8_Blit(gfx);
JD8_FadeToPal(pal);
bool exit = false;
while (!exit && !JG_Quitting()) {
if (JG_ShouldUpdate()) {
JI_Update();
if (JI_AnyKey()) {
exit = true;
}
contador--;
if (contador == 0) exit = true;
}
}
play_music("00000003.ogg");
}
// doMort() — migrat a scenes::MortScene (source/scenes/mort_scene.cpp)

View File

@@ -20,7 +20,7 @@ class ModuleSequence {
void doBanner();
void doSecreta();
void doCredits();
void doMort();
// doMort() → migrat a scenes::MortScene
int contador;
};