This commit is contained in:
Paul 2001-06-12 21:45:33 +00:00
parent 62165fff5c
commit 2dfc0db9c4
5 changed files with 21 additions and 2 deletions

View File

@ -448,6 +448,10 @@ void CGameScene::initLevel()
createPlayer(); createPlayer();
m_player->setRespawnPos(Level.getPlayerSpawnPos()); m_player->setRespawnPos(Level.getPlayerSpawnPos());
m_player->init(); m_player->init();
if(getLevelNumber()==5)
{
m_player->setCanExitLevelNow();
}
DVECTOR mapSize=Level.getMapSize(); DVECTOR mapSize=Level.getMapSize();
CPlayer::CameraBox camBox={0,0,mapSize.vx<<4,mapSize.vy<<4}; CPlayer::CameraBox camBox={0,0,mapSize.vx<<4,mapSize.vy<<4};
m_player->setCameraBox(camBox); m_player->setCameraBox(camBox);

View File

@ -37,6 +37,10 @@
#include "game\game.h" #include "game\game.h"
#endif #endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -168,7 +172,7 @@ DVECTOR CQuestItemPickup::getSizeForPlacement()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CQuestItemPickup::collect(class CPlayer *_player) void CQuestItemPickup::collect(class CPlayer *_player)
{ {
CGameScene::levelFinished(); _player->setCanExitLevelNow();
CBasePickup::collect(_player); CBasePickup::collect(_player);
} }

View File

@ -637,6 +637,7 @@ m_animFrame=0;
m_currentPlayerModeClass=NULL; m_currentPlayerModeClass=NULL;
m_lastModeBeforeDeath=PLAYER_MODE_FULLUNARMED; // Player will then respawn into this mode m_lastModeBeforeDeath=PLAYER_MODE_FULLUNARMED; // Player will then respawn into this mode
m_lives++;respawn(); m_lives++;respawn();
m_canExitLevel=false;
m_lives=CGameSlotManager::getSlotData()->m_lives; m_lives=CGameSlotManager::getSlotData()->m_lives;

View File

@ -273,6 +273,8 @@ public:
void takeDamage(DAMAGE_TYPE _damage,REACT_DIRECTION _reactDirection=REACT__UP,CThing *_thing=NULL); void takeDamage(DAMAGE_TYPE _damage,REACT_DIRECTION _reactDirection=REACT__UP,CThing *_thing=NULL);
void respawn(); void respawn();
void setCanExitLevelNow() {m_canExitLevel=true;}
int getCanExitLevelNow() {return m_canExitLevel;}
int getLivesLeft() {return m_lives;} int getLivesLeft() {return m_lives;}
@ -355,6 +357,7 @@ private:
CameraBox m_cameraPosLimitBox; CameraBox m_cameraPosLimitBox;
CameraBox m_playerPosLimitBox; CameraBox m_playerPosLimitBox;
DVECTOR m_respawnPos; DVECTOR m_respawnPos;
int m_canExitLevel;

View File

@ -22,6 +22,10 @@
#include "game\game.h" #include "game\game.h"
#endif #endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -101,7 +105,10 @@ void CLevelExitTrigger::collidedWith(CThing *_thisThing)
case TYPE_PLAYER: case TYPE_PLAYER:
{ {
#if !defined (__USER_art__) && !defined (__USER_sbart__) #if !defined (__USER_art__) && !defined (__USER_sbart__)
CGameScene::levelFinished(); if(((CPlayer*)_thisThing)->getCanExitLevelNow())
{
CGameScene::levelFinished();
}
#endif #endif
break; break;
} }