This commit is contained in:
parent
1b977d9da6
commit
6a18346288
@ -66,10 +66,15 @@ CPlayerStateFallFar s_stateFallFar;
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerStateFall::enter(CPlayerModeBase *_playerMode)
|
||||
{
|
||||
// If already in this state then don't do the entry code
|
||||
if(_playerMode->getState()!=STATE_JUMP)
|
||||
{
|
||||
if(_playerMode->getAnimNo()!=ANIM_SPONGEBOB_JUMP)
|
||||
{
|
||||
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
|
||||
}
|
||||
}
|
||||
m_buttBounceTimer=0;
|
||||
}
|
||||
|
||||
|
||||
@ -105,10 +110,22 @@ void CPlayerStateFall::think(CPlayerModeBase *_playerMode)
|
||||
}
|
||||
_playerMode->fall();
|
||||
|
||||
if(controlDown&PI_DOWN)
|
||||
// Double-tap for butt bounce
|
||||
if(m_buttBounceTimer)
|
||||
{
|
||||
m_buttBounceTimer--;
|
||||
}
|
||||
if(controlDown&PI_JUMP)
|
||||
{
|
||||
if(m_buttBounceTimer==0)
|
||||
{
|
||||
m_buttBounceTimer=BUTT_BOUNCE_TIMEOUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerMode->setState(STATE_BUTTBOUNCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,10 +38,18 @@ public:
|
||||
void enter(class CPlayerModeBase *_playerMode);
|
||||
void think(class CPlayerModeBase *_playerMode);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
BUTT_BOUNCE_TIMEOUT=45,
|
||||
};
|
||||
|
||||
unsigned int m_buttBounceTimer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class CPlayerStateFallFar : public CPlayerStateFall
|
||||
class CPlayerStateFallFar : public CPlayerState
|
||||
{
|
||||
private:
|
||||
void enter(class CPlayerModeBase *_playerMode);
|
||||
|
Loading…
Reference in New Issue
Block a user