This commit is contained in:
Charles 2001-08-14 15:53:38 +00:00
parent dccf624060
commit 2c9d0f417e
2 changed files with 18 additions and 3 deletions

View File

@ -19,27 +19,38 @@
#include "game\game.h"
#endif
#ifndef __PAD_VIBE_H__
#include "pad\vibe.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcDropPlatform::postInit()
{
m_dropHit = false;
m_dropHit = true;
CNpcPlatform::postInit();
m_initTimer = 2 * GameState::getOneSecondInFrames();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcDropPlatform::processMovement( int _frames )
{
if ( m_initTimer > 0 )
{
m_initTimer -= _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 ( !m_dropHit )
if ( !m_dropHit && m_initTimer <= 0 )
{
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 );
CGameScene::setCameraShake(0,8);
CPadVibrationManager::setVibration(0,CPadVibrationManager::VIBE_MEDIUM);
}
m_dropHit = true;

View File

@ -27,6 +27,7 @@ protected:
void processMovement( int _frames );
u8 m_dropHit;
s32 m_initTimer;
};
#endif