This commit is contained in:
Charles 2001-05-30 14:49:38 +00:00
parent f4d6cbe701
commit 86b0dc7ac7
2 changed files with 95 additions and 66 deletions

View file

@ -44,11 +44,35 @@ void CNpcFallingHazard::init()
m_bounceFinish = false;
m_spinFinish = false;
m_rotation = 0;
m_growing = true;
m_scale = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFallingHazard::processMovement( int _frames )
{
if ( m_growing )
{
m_scale = ( ( ( 2 * GameState::getOneSecondInFrames() ) - m_movementTimer ) << 12 ) / ( 2 * GameState::getOneSecondInFrames() );
if ( m_movementTimer > 0 )
{
m_movementTimer -= _frames;
if ( m_movementTimer < 0 )
{
m_movementTimer = 0;
}
}
else
{
m_growing = false;
m_movementTimer = 2 * GameState::getOneSecondInFrames();
}
}
else
{
s8 groundHeight;
s8 yMovement;
@ -136,6 +160,9 @@ void CNpcFallingHazard::processMovement( int _frames )
m_isActive = false;
m_timerActive = true;
m_timer = ( m_respawnRate - 1 ) * GameState::getOneSecondInFrames();
m_growing = true;
m_scale = 0;
}
}
}
@ -245,9 +272,9 @@ void CNpcFallingHazard::render()
rotation.vz = m_rotation;
VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
scale.vx = m_scale;
scale.vy = m_scale;
scale.vz = m_scale;
m_modelGfx->Render(renderPos,&rotation,&scale);
}

View file

@ -37,6 +37,8 @@ protected:
u8 m_bounceDir;
DVECTOR m_bouncePos;
s16 m_rotation;
s16 m_scale;
u8 m_growing;
};
#endif