This commit is contained in:
parent
4e45a631d0
commit
d3062a046c
@ -165,6 +165,7 @@ int CGameScene::s_skipToNextLevel;
|
||||
int CGameScene::s_restartLevel;
|
||||
int CGameScene::s_bossHasBeenKilled;
|
||||
int CGameScene::s_justHitBossArenaTrigger;
|
||||
DVECTOR CGameScene::s_CamShake={0,0};
|
||||
|
||||
/*****************************************************************************/
|
||||
static const CSoundMediator::SONGID s_bossMusicIds[]=
|
||||
@ -574,6 +575,7 @@ void CGameScene::think_playing(int _frames)
|
||||
CBubicleFactory::setMapOffset(&camPos);
|
||||
Level.setCameraCentre(camPos);
|
||||
Level.think(_frames);
|
||||
thinkCameraShake(_frames);
|
||||
m_HealthManager->think(_frames);
|
||||
m_HealthManager->checkPlayerCol(getPlayer());
|
||||
|
||||
@ -722,3 +724,43 @@ void CGameScene::shutdownLevel()
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CGameScene::setCameraShake(s16 X,s16 Y)
|
||||
{
|
||||
s_CamShake.vx=X;
|
||||
s_CamShake.vy=Y;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CGameScene::shakeCamera(DVECTOR &CamPos)
|
||||
{
|
||||
CamPos.vx+=s_CamShake.vx;
|
||||
CamPos.vy+=s_CamShake.vy;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CGameScene::thinkCameraShake(int _frames)
|
||||
{
|
||||
if (s_CamShake.vx)
|
||||
{
|
||||
if (s_CamShake.vx<0)
|
||||
{
|
||||
s_CamShake.vx=-(s_CamShake.vx+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_CamShake.vx=-(s_CamShake.vx-1);
|
||||
}
|
||||
}
|
||||
if (s_CamShake.vy)
|
||||
{
|
||||
if (s_CamShake.vy<0)
|
||||
{
|
||||
s_CamShake.vy=-(s_CamShake.vy+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_CamShake.vy=-(s_CamShake.vy-1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,6 +67,9 @@ static int getBossHasBeenKilled() {return s_bossHasBeenKilled;}
|
||||
static void dropHealth(DVECTOR &Pos,int Amount,int Vel);
|
||||
|
||||
|
||||
static void setCameraShake(s16 X,s16 Y);
|
||||
static void shakeCamera(DVECTOR &CamPos);
|
||||
void thinkCameraShake(int _frames);
|
||||
private:
|
||||
typedef enum
|
||||
{
|
||||
@ -128,6 +131,7 @@ static CLayerCollision *getCollision() {return(s_GlobalCollision);}
|
||||
static SpriteBank *s_GlobalSpritebank;
|
||||
static CLayerCollision *s_GlobalCollision;
|
||||
static int s_bossHasBeenKilled;
|
||||
static DVECTOR s_CamShake;
|
||||
|
||||
|
||||
int m_levelHasTimer;
|
||||
|
@ -1161,6 +1161,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
||||
{
|
||||
m_cameraPos.vx=m_currentCamFocusPoint.vx;
|
||||
m_cameraPos.vy=m_currentCamFocusPoint.vy+yoff;
|
||||
CGameScene::shakeCamera(m_cameraPos);
|
||||
}
|
||||
|
||||
// Limit camera scroll to the edges of the map
|
||||
|
@ -187,6 +187,7 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
|
||||
if(!m_bounceOffFloor)
|
||||
{
|
||||
CPadVibrationManager::setVibration(0,CPadVibrationManager::VIBE_SHORT);
|
||||
CGameScene::setCameraShake(0,8);
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,6 +227,7 @@ void CPlayerStateButtBounceUp::enter(CPlayerModeBase *_playerMode)
|
||||
pos=_playerMode->getPlayerPos();
|
||||
CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
|
||||
CPadVibrationManager::setVibration(0,CPadVibrationManager::VIBE_MEDIUM);
|
||||
CGameScene::setCameraShake(0,8);
|
||||
}
|
||||
|
||||
_playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCEEND);
|
||||
|
Loading…
Reference in New Issue
Block a user