This commit is contained in:
Paul 2001-08-10 20:14:50 +00:00
parent ea030fb8c3
commit ed0f08902a
4 changed files with 15 additions and 6 deletions

View file

@ -133,14 +133,17 @@ void CBossText::shutdown()
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CBossText::select() void CBossText::select(int _dontChangeMusic)
{ {
m_readyToExit=false; m_readyToExit=false;
m_currentPage=0; m_currentPage=0;
if(!_dontChangeMusic)
{
CSoundMediator::stopSong(); CSoundMediator::stopSong();
CSoundMediator::setSong(s_bossData[GameScene.GetLevel().getCurrentChapter()-1].m_songId); CSoundMediator::setSong(s_bossData[GameScene.GetLevel().getCurrentChapter()-1].m_songId);
} }
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:

View file

@ -40,7 +40,7 @@ public:
void init(); void init();
void shutdown(); void shutdown();
void select(); void select(int _dontChangeMusic=false);
void think(int _frames); void think(int _frames);
void render(); void render();
int isReadyToExit(); int isReadyToExit();

View file

@ -226,6 +226,7 @@ void CGameScene::init()
m_showingLivesTimer=0; m_showingLivesTimer=0;
s_showBossTextOnRespawn=false; s_showBossTextOnRespawn=false;
m_playingBossMusic=false;
} }
/*****************************************************************************/ /*****************************************************************************/
// This is a seperate funtion ( and virtual ) so that we can overload it for // This is a seperate funtion ( and virtual ) so that we can overload it for
@ -419,7 +420,11 @@ void CGameScene::think(int _frames)
if(m_bossText->isReadyToExit()) if(m_bossText->isReadyToExit())
{ {
m_gamestate=GAMESTATE_PLAYING; m_gamestate=GAMESTATE_PLAYING;
if(!m_playingBossMusic)
{
CSoundMediator::playSong(); CSoundMediator::playSong();
m_playingBossMusic=true;
}
sendEvent( BOSS_FOUND_EVENT, NULL ); sendEvent( BOSS_FOUND_EVENT, NULL );
CFader::setFadingIn(); CFader::setFadingIn();
} }
@ -739,7 +744,7 @@ void CGameScene::respawnLevel()
else else
{ {
m_gamestate=GAMESTATE_SHOWING_LIVES_BUT_GOING_TO_BOSS_TEXT; m_gamestate=GAMESTATE_SHOWING_LIVES_BUT_GOING_TO_BOSS_TEXT;
m_bossText->select(); m_bossText->select(m_playingBossMusic);
} }
m_showingLivesTimer=0; m_showingLivesTimer=0;
CSoundMediator::setCanPlaySfx(true); CSoundMediator::setCanPlaySfx(true);

View file

@ -139,6 +139,7 @@ static CLayerCollision *s_GlobalCollision;
static int s_bossHasBeenKilled; static int s_bossHasBeenKilled;
static DVECTOR s_CamShake; static DVECTOR s_CamShake;
static int s_showBossTextOnRespawn; static int s_showBossTextOnRespawn;
int m_playingBossMusic;
int m_levelHasTimer; int m_levelHasTimer;