SBSPSS/source/player/psbutt.cpp
2001-02-28 16:16:05 +00:00

141 lines
3.0 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 __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
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounce::enter(CPlayer *_player)
{
setAnimNo(_player,ANIM_SPONGEBOB_BUTTBOUNCESTART);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounce::think(CPlayer *_player)
{
if(advanceAnimFrameAndCheckForEndOfAnim(_player))
{
setState(_player,STATE_BUTTFALL);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceFall::enter(CPlayer *_player)
{
setAnimNo(_player,ANIM_SPONGEBOB_BUTTBOUNCEEND);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceFall::think(CPlayer *_player)
{
fall(_player);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceLand::enter(CPlayer *_player)
{
DVECTOR pos;
pos=getPlayerPos(_player);
CGameBubicleFactory::spawnBubicles(pos.vx,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateButtBounceLand::think(CPlayer *_player)
{
if(advanceAnimFrameAndCheckForEndOfAnim(_player))
{
setState(_player,STATE_IDLE);
}
}
/*===========================================================================
end */