SBSPSS/source/player/psbutt.cpp
2001-04-03 16:47:07 +00:00

151 lines
3.4 KiB
C++

/*=========================================================================
psbutt.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\psbutt.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
#ifndef __PLAYER_PMODES_H__
#include "player\pmodes.h"
#endif
#ifndef __GAME_GAMEBUBS_H__
#include "game\gamebubs.h"
#endif
/* Std Lib
------- */
/* Data
---- */
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
CPlayerStateButtBounce s_stateButtBounce;
CPlayerStateButtBounceFall s_stateButtBounceFall;
CPlayerStateButtBounceLand s_stateButtBounceLand;
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounce::enter(CPlayerModeBase *_playerMode)
{
_playerMode->zeroMoveVelocity();
_playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCESTART);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounce::think(CPlayerModeBase *_playerMode)
{
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
{
_playerMode->setState(STATE_BUTTFALL);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceFall::enter(CPlayerModeBase *_playerMode)
{
_playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCEEND);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode)
{
_playerMode->fall();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode)
{
// DVECTOR pos;
//
// pos=_playerMode->getPlayerPos();
// CGameBubicleFactory::spawnBubicles(pos.vx,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode)
{
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
{
_playerMode->setState(STATE_IDLE);
}
}
/*===========================================================================
end */