This commit is contained in:
parent
01e9f62ea7
commit
3a83575bac
2 changed files with 16 additions and 3 deletions
|
@ -133,14 +133,19 @@ void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
|
void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
|
||||||
{
|
{
|
||||||
|
m_bounceOffFloor=false;
|
||||||
if(_playerMode->getIsInWater())
|
if(_playerMode->getIsInWater())
|
||||||
{
|
{
|
||||||
DVECTOR pos;
|
DVECTOR pos;
|
||||||
CLevel &level=GameScene.GetLevel();
|
|
||||||
|
|
||||||
pos=_playerMode->getPlayerPos();
|
pos=_playerMode->getPlayerPos();
|
||||||
|
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);
|
CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
|
||||||
level.destroyMapArea(pos);
|
level.destroyMapArea(pos);
|
||||||
|
m_bounceOffFloor=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,6 +158,11 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode)
|
void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode)
|
||||||
{
|
{
|
||||||
|
if(m_bounceOffFloor)
|
||||||
|
{
|
||||||
|
_playerMode->setState(STATE_BUTTBOUNCEUP);
|
||||||
|
}
|
||||||
|
|
||||||
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
|
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
|
||||||
{
|
{
|
||||||
_playerMode->setState(STATE_IDLE);
|
_playerMode->setState(STATE_IDLE);
|
||||||
|
|
|
@ -54,6 +54,9 @@ public:
|
||||||
virtual void enter(class CPlayerModeBase *_playerMode);
|
virtual void enter(class CPlayerModeBase *_playerMode);
|
||||||
virtual void think(class CPlayerModeBase *_playerMode);
|
virtual void think(class CPlayerModeBase *_playerMode);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_bounceOffFloor;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPlayerStateButtBounceUp : public CPlayerState
|
class CPlayerStateButtBounceUp : public CPlayerState
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue