This commit is contained in:
Charles 2001-07-31 18:52:10 +00:00
parent 8f7bb1e61b
commit a84e8bbf51
2 changed files with 30 additions and 12 deletions

View File

@ -132,20 +132,37 @@ void CNpcFallingHazard::processMovement( int _frames )
if ( groundHeight < yMovement ) if ( groundHeight < yMovement )
{ {
if ( m_soundId == NOT_PLAYING ) switch ( CGameScene::getCollision()->getCollisionBlock( Pos.vx, Pos.vy + groundHeight + 8 ) & COLLISION_TYPE_MASK )
{ {
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); case COLLISION_TYPE_FLAG_SOLID:
{
// drop down
Pos.vy += yMovement;
break;
}
default:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true );
}
// colliding with ground
Pos.vy += groundHeight;
m_bounceFinish = true;
m_speed = -5;
m_bounceDir = getRnd() % 2;
m_bouncePos = Pos;
break;
}
} }
// colliding with ground
Pos.vy += groundHeight;
m_bounceFinish = true;
m_speed = -5;
m_bounceDir = getRnd() % 2;
m_bouncePos = Pos;
} }
else else
{ {

View File

@ -24,6 +24,7 @@ public:
void init(); void init();
void setWaypoints( sThingHazard *ThisHazard ); void setWaypoints( sThingHazard *ThisHazard );
void render(); void render();
bool alwaysThink() {return(m_bounceFinish);}
protected: protected:
void processMovement( int _frames ); void processMovement( int _frames );
void processTimer( int _frames ); void processTimer( int _frames );