This commit is contained in:
parent
dccf624060
commit
2c9d0f417e
2 changed files with 18 additions and 3 deletions
|
@ -19,27 +19,38 @@
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PAD_VIBE_H__
|
||||||
|
#include "pad\vibe.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcDropPlatform::postInit()
|
void CNpcDropPlatform::postInit()
|
||||||
{
|
{
|
||||||
m_dropHit = false;
|
m_dropHit = true;
|
||||||
|
|
||||||
CNpcPlatform::postInit();
|
CNpcPlatform::postInit();
|
||||||
|
|
||||||
|
m_initTimer = 2 * GameState::getOneSecondInFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcDropPlatform::processMovement( int _frames )
|
void CNpcDropPlatform::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
|
if ( m_initTimer > 0 )
|
||||||
|
{
|
||||||
|
m_initTimer -= _frames;
|
||||||
|
}
|
||||||
|
|
||||||
s32 moveY = m_speed * _frames;
|
s32 moveY = m_speed * _frames;
|
||||||
|
|
||||||
s32 groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy + moveY, 16 );
|
s32 groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, moveY );
|
||||||
|
|
||||||
if ( groundHeight < moveY )
|
if ( groundHeight < moveY )
|
||||||
{
|
{
|
||||||
if ( !m_dropHit )
|
if ( !m_dropHit && m_initTimer <= 0 )
|
||||||
{
|
{
|
||||||
if( m_soundId != NOT_PLAYING )
|
if( m_soundId != NOT_PLAYING )
|
||||||
{
|
{
|
||||||
|
@ -47,6 +58,9 @@ void CNpcDropPlatform::processMovement( int _frames )
|
||||||
}
|
}
|
||||||
|
|
||||||
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__FALLING_ROCK_LAND, true );
|
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__FALLING_ROCK_LAND, true );
|
||||||
|
|
||||||
|
CGameScene::setCameraShake(0,8);
|
||||||
|
CPadVibrationManager::setVibration(0,CPadVibrationManager::VIBE_MEDIUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dropHit = true;
|
m_dropHit = true;
|
||||||
|
|
|
@ -27,6 +27,7 @@ protected:
|
||||||
void processMovement( int _frames );
|
void processMovement( int _frames );
|
||||||
|
|
||||||
u8 m_dropHit;
|
u8 m_dropHit;
|
||||||
|
s32 m_initTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue