step 6: credits_scene substituix doCredits() (scroll vertical + parallax condicional)
This commit is contained in:
@@ -57,6 +57,7 @@ namespace Defaults::Game {
|
||||
constexpr int HABITACIO_INICIAL = 1;
|
||||
constexpr int PIRAMIDE_INICIAL = 255;
|
||||
constexpr int VIDES = 5;
|
||||
constexpr int DIAMANTS_INICIAL = 0;
|
||||
constexpr bool USE_NEW_LOGO = true;
|
||||
constexpr bool SHOW_TITLE_CREDITS = true;
|
||||
} // namespace Defaults::Game
|
||||
|
||||
@@ -44,9 +44,7 @@ int ModuleSequence::Go() {
|
||||
case 6: // Pre-Secreta
|
||||
doSecreta();
|
||||
break;
|
||||
case 8: // Credits
|
||||
doCredits();
|
||||
break;
|
||||
// case 8 (Credits) → migrat a scenes::CreditsScene.
|
||||
// case 100 (Mort) → migrat a scenes::MortScene, dispatch via SceneRegistry.
|
||||
}
|
||||
|
||||
@@ -911,70 +909,6 @@ void ModuleSequence::doSecreta() {
|
||||
free(pal_aux);
|
||||
}
|
||||
|
||||
void ModuleSequence::doCredits() {
|
||||
struct {
|
||||
Uint16 x, y;
|
||||
} frames_coche[8] = {{214, 152}, {214, 104}, {214, 56}, {214, 104}, {214, 152}, {214, 8}, {108, 152}, {214, 8}};
|
||||
const Uint32 n_frames_coche = 8;
|
||||
const Uint32 velocitat_coche = 3;
|
||||
|
||||
JD8_Surface vaddr2 = JD8_LoadSurface("final.gif");
|
||||
JD8_Surface vaddr3 = JD8_LoadSurface("finals.gif");
|
||||
JD8_Palette pal = JD8_LoadPalette("final.gif");
|
||||
JD8_SetScreenPalette(pal);
|
||||
|
||||
int contador = 0;
|
||||
|
||||
bool exit = false;
|
||||
contador = 1;
|
||||
while (!exit && !JG_Quitting()) {
|
||||
if (JG_ShouldUpdate()) {
|
||||
JI_Update();
|
||||
|
||||
if (JI_AnyKey() || contador >= 3100) {
|
||||
exit = true;
|
||||
}
|
||||
|
||||
JD8_ClearScreen(255);
|
||||
|
||||
if (contador < 2750) {
|
||||
JD8_BlitCKCut(115, 200 - (contador / 6), vaddr2, 0, 0, 80, 200, 0);
|
||||
}
|
||||
|
||||
if ((contador > 1200) && (contador < 2280)) {
|
||||
JD8_BlitCKCut(100, 200 - ((contador - 1200) / 6), vaddr2, 85, 0, 120, 140, 0);
|
||||
} else if (contador >= 2250) {
|
||||
JD8_BlitCK(100, 20, vaddr2, 85, 0, 120, 140, 0);
|
||||
}
|
||||
|
||||
if (info::ctx.diamants == 16) {
|
||||
// scroll_final_joc(vaddr3, vaddr, contador_final);
|
||||
JD8_BlitCKScroll(50, vaddr3, ((contador >> 3) % 320) + 1, 0, 50, 255);
|
||||
JD8_BlitCKScroll(50, vaddr3, ((contador >> 2) % 320) + 1, 50, 50, 255);
|
||||
JD8_BlitCKScroll(50, vaddr3, ((contador >> 1) % 320) + 1, 100, 50, 255);
|
||||
JD8_BlitCKScroll(50, vaddr3, (contador % 320) + 1, 150, 50, 255);
|
||||
|
||||
JD8_BlitCK(100, 50, vaddr2, frames_coche[(contador / velocitat_coche) % n_frames_coche].x, frames_coche[(contador / velocitat_coche) % n_frames_coche].y, 106, 48, 255);
|
||||
} else {
|
||||
JD8_BlitCK(0, 50, vaddr3, 0, 0, 320, 50, 255);
|
||||
JD8_BlitCK(0, 50, vaddr3, 0, 50, 320, 50, 255);
|
||||
}
|
||||
|
||||
JD8_FillSquare(0, 50, 255);
|
||||
JD8_FillSquare(100, 10, 255);
|
||||
|
||||
JD8_Flip();
|
||||
contador++;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* ini = fopen("trick.ini", "wb");
|
||||
fwrite("1", 1, 1, ini);
|
||||
fclose(ini);
|
||||
info::ctx.nou_personatge = true;
|
||||
|
||||
JD8_FreeSurface(vaddr3);
|
||||
JD8_FreeSurface(vaddr2);
|
||||
}
|
||||
// doCredits() — migrat a scenes::CreditsScene (source/scenes/credits_scene.cpp)
|
||||
|
||||
// doMort() — migrat a scenes::MortScene (source/scenes/mort_scene.cpp)
|
||||
|
||||
@@ -24,7 +24,7 @@ class ModuleSequence {
|
||||
// doSlides() → migrat a scenes::SlidesScene
|
||||
// doBanner() → migrat a scenes::BannerScene
|
||||
void doSecreta();
|
||||
void doCredits();
|
||||
// doCredits() → migrat a scenes::CreditsScene
|
||||
// doMort() → migrat a scenes::MortScene
|
||||
|
||||
int contador;
|
||||
|
||||
@@ -144,6 +144,8 @@ namespace Options {
|
||||
game.piramide_inicial = node["piramide_inicial"].get_value<int>();
|
||||
if (node.contains("vides"))
|
||||
game.vides = node["vides"].get_value<int>();
|
||||
if (node.contains("diamants_inicial"))
|
||||
game.diamants_inicial = node["diamants_inicial"].get_value<int>();
|
||||
if (node.contains("use_new_logo"))
|
||||
game.use_new_logo = node["use_new_logo"].get_value<bool>();
|
||||
if (node.contains("show_title_credits"))
|
||||
@@ -278,6 +280,7 @@ namespace Options {
|
||||
file << " habitacio_inicial: " << game.habitacio_inicial << "\n";
|
||||
file << " piramide_inicial: " << game.piramide_inicial << "\n";
|
||||
file << " vides: " << game.vides << "\n";
|
||||
file << " diamants_inicial: " << game.diamants_inicial << "\n";
|
||||
file << " use_new_logo: " << (game.use_new_logo ? "true" : "false") << "\n";
|
||||
file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n";
|
||||
file << "\n";
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace Options {
|
||||
int habitacio_inicial{Defaults::Game::HABITACIO_INICIAL};
|
||||
int piramide_inicial{Defaults::Game::PIRAMIDE_INICIAL};
|
||||
int vides{Defaults::Game::VIDES};
|
||||
int diamants_inicial{Defaults::Game::DIAMANTS_INICIAL};
|
||||
bool use_new_logo{Defaults::Game::USE_NEW_LOGO};
|
||||
bool show_title_credits{Defaults::Game::SHOW_TITLE_CREDITS};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user