This commit is contained in:
parent
62165fff5c
commit
2dfc0db9c4
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user