This commit is contained in:
Paul 2001-06-12 21:27:53 +00:00
parent d641b1c93c
commit 61ee8ac68b
2 changed files with 44 additions and 3 deletions

View File

@ -186,10 +186,14 @@ void CGameScene::init()
s_genericFont=new ("CGameScene::Init") FontBank(); s_genericFont=new ("CGameScene::Init") FontBank();
s_genericFont->initialise( &standardFont ); s_genericFont->initialise( &standardFont );
s_genericFont->setColour( 255, 255 , 0 ); s_genericFont->setColour( 255, 255 , 0 );
m_scalableFont=new ("CountdownTimer") ScalableFontBank();
m_scalableFont->initialise(&standardFont);
m_scalableFont->setColour(255,255,255);
m_scalableFont->setScale(511);
VidSetClearScreen(0); VidSetClearScreen(0);
m_pauseMenu=new ("Pause Menu") CPauseMenu(); m_pauseMenu=new ("Pause Menu") CPauseMenu();
m_pauseMenu->init(); m_pauseMenu->init();
@ -224,6 +228,7 @@ void CGameScene::shutdown()
shutdownLevel(); shutdownLevel();
m_pauseMenu->shutdown(); delete m_pauseMenu; m_pauseMenu->shutdown(); delete m_pauseMenu;
m_scalableFont->dump(); delete m_scalableFont;
s_genericFont->dump(); delete s_genericFont; s_genericFont->dump(); delete s_genericFont;
} }
@ -232,6 +237,17 @@ void CGameScene::render()
{ {
// CamMtx.t[2]=ZPos; // Temp // CamMtx.t[2]=ZPos; // Temp
if(m_levelHasTimer)
{
int timerValue;
char buf[10];
timerValue=m_timer/55;
if(timerValue<0)timerValue=0;
sprintf(buf,"%d",timerValue);
m_scalableFont->print(256,30,buf);
}
m_pauseMenu->render(); m_pauseMenu->render();
CConversation::render(); CConversation::render();
CThingManager::renderAllThings(); CThingManager::renderAllThings();
@ -255,6 +271,16 @@ void CGameScene::think(int _frames)
// } // }
//#endif //#endif
// Auto-timer stuff
if(m_levelHasTimer)
{
m_timer-=_frames;
if(m_timer<0)
{
s_levelFinished=true;
}
}
if(s_readyToExit) if(s_readyToExit)
{ {
// Temporarily.. exiting game scene always goes back to the front end (pkg) // Temporarily.. exiting game scene always goes back to the front end (pkg)
@ -287,6 +313,7 @@ void CGameScene::think(int _frames)
chapterToOpen=chapter+1; chapterToOpen=chapter+1;
} }
gameSlot->levelIsNowOpen(chapterToOpen-1,levelToOpen-1); gameSlot->levelIsNowOpen(chapterToOpen-1,levelToOpen-1);
// CMapScene::setLevelToStartOn(chapterToOpen-1,levelToOpen-1);
} }
// Level finished - go to map or fma // Level finished - go to map or fma
@ -427,12 +454,21 @@ void CGameScene::initLevel()
s_bossHasBeenKilled=false; s_bossHasBeenKilled=false;
if(getLevelNumber()==5&&getChapterNumber()==2)
{
m_levelHasTimer=true;
m_timer=30*55;
}
else
{
m_levelHasTimer=false;
}
// Song is loaded/dumped by the level, and played from here. This just gives some // Song is loaded/dumped by the level, and played from here. This just gives some
// better timing over when it starts (pkg) // better timing over when it starts (pkg)
CSoundMediator::playSong(); CSoundMediator::playSong();
CActorPool::SetUpCache(); CActorPool::SetUpCache();
SYSTEM_DBGMSG("InitLevelDone\n"); SYSTEM_DBGMSG("InitLevelDone\n");
} }

View File

@ -70,6 +70,7 @@ protected:
class CPauseMenu *m_pauseMenu; class CPauseMenu *m_pauseMenu;
class CPlayer *m_player; class CPlayer *m_player;
static FontBank *s_genericFont; static FontBank *s_genericFont;
class ScalableFontBank *m_scalableFont;
static MATRIX CamMtx; static MATRIX CamMtx;
static int s_restartLevel; static int s_restartLevel;
@ -93,6 +94,10 @@ static SpriteBank *s_GlobalSpritebank;
static CLayerCollision *s_GlobalCollision; static CLayerCollision *s_GlobalCollision;
static int s_bossHasBeenKilled; static int s_bossHasBeenKilled;
int m_levelHasTimer;
int m_timer;
}; };