diff --git a/aee.xcodeproj/project.xcworkspace/xcuserdata/raimonzamora.xcuserdatad/UserInterfaceState.xcuserstate b/aee.xcodeproj/project.xcworkspace/xcuserdata/raimonzamora.xcuserdatad/UserInterfaceState.xcuserstate index e134f92..fe88e08 100644 Binary files a/aee.xcodeproj/project.xcworkspace/xcuserdata/raimonzamora.xcuserdatad/UserInterfaceState.xcuserstate and b/aee.xcodeproj/project.xcworkspace/xcuserdata/raimonzamora.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/aee.xcodeproj/xcuserdata/raimonzamora.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/aee.xcodeproj/xcuserdata/raimonzamora.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 71ef2fe..fe2b454 100644 --- a/aee.xcodeproj/xcuserdata/raimonzamora.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/aee.xcodeproj/xcuserdata/raimonzamora.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,22 +2,4 @@ - - - - - - diff --git a/jsound.cpp b/jsound.cpp index c2ce9d0..37daeb4 100755 --- a/jsound.cpp +++ b/jsound.cpp @@ -9,7 +9,7 @@ bool JS_Init() { return true; } -void JS_LoadMusic(char *musicFilename) +void JS_LoadMusic(const char *musicFilename) { if (music != NULL) { Mix_HaltMusic(); diff --git a/jsound.h b/jsound.h index 9050c59..929996f 100755 --- a/jsound.h +++ b/jsound.h @@ -5,7 +5,7 @@ typedef Mix_Chunk JS_Sound; bool JS_Init(); -void JS_LoadMusic(char *musicFilename); +void JS_LoadMusic(const char *musicFilename); void JS_SetMusicVolume(int volume); diff --git a/modulegame.cpp b/modulegame.cpp index 210e309..1a49c01 100755 --- a/modulegame.cpp +++ b/modulegame.cpp @@ -2,6 +2,7 @@ #include "jgame.h" #include "jdraw8.h" +#include "jsound.h" #include "jinput.h" #include "jfile.h" @@ -47,6 +48,10 @@ ModuleGame::~ModuleGame(void) { int ModuleGame::Go() { this->Draw(); + + JS_LoadMusic(this->info->num_piramide==3 ? "00000008.xm" : (this->info->num_piramide==2 ? "00000007.xm" : "00000006.xm")); + JS_PlayMusic(-1); + JD8_FadeToPal( JD8_LoadPalette( "frames.gif" ) ); while (this->final == 0 && !JG_Quitting()) { @@ -55,18 +60,22 @@ int ModuleGame::Go() { this->Update(); } + JS_FadeOutMusic(); + if( this->final == 1 ) { this->info->num_habitacio++; if( this->info->num_habitacio == 6 ) { this->info->num_habitacio = 1; this->info->num_piramide++; } - } + } else if (this->final == 2) { + this->info->num_piramide = 100; + } if( JG_Quitting() ) { return -1; } else { - if( this->info->num_habitacio == 1 ) { + if( this->info->num_habitacio == 1 || this->info->num_piramide == 100 ) { return 1; } else { return 0; diff --git a/modulesequence.cpp b/modulesequence.cpp index 23fe904..4a1ba2e 100755 --- a/modulesequence.cpp +++ b/modulesequence.cpp @@ -22,7 +22,7 @@ int ModuleSequence::Go() { case 255: // Intro doIntro(); break; - case 0: // Menú + case 0: // Menœ doMenu(); break; case 1: // Slides @@ -41,6 +41,9 @@ int ModuleSequence::Go() { case 8: // Credits doCredits(); break; + case 100: // Mort + doMort(); + break; } JD8_FadeOut(); @@ -59,6 +62,10 @@ int ModuleSequence::Go() { return 1; } else if( this->info->num_piramide == 8 ) { this->info->num_piramide = 255; + return 1; + } else if( this->info->num_piramide == 100 ) { + this->info->num_piramide = 0; + return 1; } else { return 0; } @@ -686,6 +693,7 @@ void ModuleSequence::doSlides() { step++; break; case 8: + JS_FadeOutMusic(); exit = true; break; } @@ -697,6 +705,9 @@ void ModuleSequence::doSlides() { } void ModuleSequence::doBanner() { + JS_LoadMusic("00000004.xm"); + JS_PlayMusic(-1); + this->contador = 5000; JD8_Surface gfx = JD8_LoadSurface( "ffase.gif" ); @@ -736,6 +747,7 @@ void ModuleSequence::doBanner() { if( contador == 0 ) exit = true; } } + JS_FadeOutMusic(); } void ModuleSequence::doSecreta() { @@ -744,3 +756,34 @@ void ModuleSequence::doSecreta() { void ModuleSequence::doCredits() { } +void ModuleSequence::doMort() { + JS_LoadMusic("00000001.xm"); + JS_PlayMusic(-1); + + this->contador = 5000; + + 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; + } + } + JS_FadeOutMusic(); +} + diff --git a/modulesequence.h b/modulesequence.h index 37e393b..a209cf5 100755 --- a/modulesequence.h +++ b/modulesequence.h @@ -19,6 +19,7 @@ private: void doBanner(); void doSecreta(); void doCredits(); + void doMort(); Info* info; int contador;