From b5fdff59fcba2876b60440935f6879ce51aa323a Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 25 Jun 2001 16:01:46 +0000 Subject: [PATCH] --- source/player/psbutt.cpp | 40 +++++++++++++++++++++++++++++++++++++--- source/player/psjump.cpp | 8 ++++---- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/source/player/psbutt.cpp b/source/player/psbutt.cpp index 42dc5b32b..53e1b66e3 100644 --- a/source/player/psbutt.cpp +++ b/source/player/psbutt.cpp @@ -1,4 +1,3 @@ - /*========================================================================= psbutt.cpp @@ -81,8 +80,11 @@ CPlayerStateButtBounceUp s_stateButtBounceUp; ---------------------------------------------------------------------- */ void CPlayerStateButtBounce::enter(CPlayerModeBase *_playerMode) { - _playerMode->zeroMoveVelocity(); + DVECTOR move; _playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCESTART); + move=_playerMode->getMoveVelocity(); + move.vy=0; + _playerMode->setMoveVelocity(&move); } @@ -94,6 +96,22 @@ void CPlayerStateButtBounce::enter(CPlayerModeBase *_playerMode) ---------------------------------------------------------------------- */ void CPlayerStateButtBounce::think(CPlayerModeBase *_playerMode) { + int controlHeld; + controlHeld=_playerMode->getPadInputHeld(); + + if(controlHeld&PI_LEFT) + { + _playerMode->moveLeft(); + } + else if(controlHeld&PI_RIGHT) + { + _playerMode->moveRight(); + } + else + { + _playerMode->slowdown(); + } + if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { _playerMode->setState(STATE_BUTTFALL); @@ -121,6 +139,22 @@ void CPlayerStateButtBounceFall::enter(CPlayerModeBase *_playerMode) ---------------------------------------------------------------------- */ void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode) { + int controlHeld; + controlHeld=_playerMode->getPadInputHeld(); + + if(controlHeld&PI_LEFT) + { + _playerMode->moveLeft(); + } + else if(controlHeld&PI_RIGHT) + { + _playerMode->moveRight(); + } + else + { + _playerMode->slowdown(); + } + _playerMode->buttFall(); } @@ -142,7 +176,6 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode) if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_DESTRUCTABLE_WALL) { CLevel &level=GameScene.GetLevel(); - CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM); level.destroyMapArea(pos); m_bounceOffFloor=true; } @@ -167,6 +200,7 @@ void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode) { _playerMode->setState(STATE_IDLE); } + _playerMode->zeroMoveVelocity(); } diff --git a/source/player/psjump.cpp b/source/player/psjump.cpp index 4a48378ae..0e1857057 100644 --- a/source/player/psjump.cpp +++ b/source/player/psjump.cpp @@ -117,10 +117,10 @@ void CPlayerStateJump::think(CPlayerModeBase *_playerMode) _playerMode->slowdown(); } -// if(controlDown&PI_DOWN) -// { -// _playerMode->setState(STATE_BUTTBOUNCE); -// } + if(controlDown&PI_DOWN) + { + _playerMode->setState(STATE_BUTTBOUNCE); + } }