This commit is contained in:
parent
fcfa8641ae
commit
2984f36c4c
2 changed files with 17 additions and 0 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -31,6 +31,7 @@ protected:
|
|||
u8 m_isMoving;
|
||||
u8 m_isResetting;
|
||||
DVECTOR m_lineBase;
|
||||
s32 m_bobTimer;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue