This commit is contained in:
Charles 2001-05-25 16:44:30 +00:00
parent fcfa8641ae
commit 2984f36c4c
2 changed files with 17 additions and 0 deletions

View File

@ -45,6 +45,7 @@ void CNpcFishHookPlatform::postInit()
m_isShuttingDown = false;
m_lineBase.vx = Pos.vx;
m_lineBase.vy = 0;
m_bobTimer = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -87,6 +88,21 @@ void CNpcFishHookPlatform::processMovement( int _frames )
}
}
}
else
{
int second = GameState::getOneSecondInFrames();
m_bobTimer += _frames;
if ( m_bobTimer > ( 3 * second ) )
{
m_bobTimer -= 3 * second;
}
s16 sineVal = ( m_bobTimer << 12 ) / ( 3 * second );
Pos.vy = m_base.vy + ( ( 5 * rsin( sineVal ) ) >> 12 );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -31,6 +31,7 @@ protected:
u8 m_isMoving;
u8 m_isResetting;
DVECTOR m_lineBase;
s32 m_bobTimer;
};
#endif