SBSPSS/source/player/psduck.cpp

147 lines
3.0 KiB
C++
Raw Normal View History

2001-01-22 21:58:36 +01:00
/*=========================================================================
psduck.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\psduck.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib
------- */
/* Data
---- */
2001-02-26 21:05:31 +01:00
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
2001-01-22 21:58:36 +01:00
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateDuck::enter(CPlayer *_player)
{
2001-02-26 21:05:31 +01:00
setAnimNo(_player,ANIM_SPONGEBOB_SOAKUP);
2001-01-22 21:58:36 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateDuck::think(CPlayer *_player)
{
slowdown(_player);
if(advanceAnimFrameAndCheckForEndOfAnim(_player))
{
setState(_player,STATE_SOAKUP);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateSoakUp::enter(CPlayer *_player)
{
DVECTOR move;
move=getMoveVelocity(_player);
move.vx=0;
setMoveVelocity(_player,&move);
2001-02-26 21:05:31 +01:00
setAnimNo(_player,ANIM_SPONGEBOB_GETUP);
2001-01-22 21:58:36 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateSoakUp::think(CPlayer *_player)
{
2001-01-29 23:35:18 +01:00
int controlHeld;
2001-01-22 21:58:36 +01:00
2001-01-29 23:35:18 +01:00
controlHeld=getPadInputHeld(_player);
2001-02-09 18:01:04 +01:00
if(!(controlHeld&PI_DOWN))
2001-01-22 21:58:36 +01:00
{
setState(_player,STATE_GETUP);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateGetUp::enter(CPlayer *_player)
{
2001-02-26 21:05:31 +01:00
setAnimNo(_player,ANIM_SPONGEBOB_GETUP);
2001-01-22 21:58:36 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateGetUp::think(CPlayer *_player)
{
if(advanceAnimFrameAndCheckForEndOfAnim(_player))
{
setState(_player,STATE_IDLE);
}
}
/*===========================================================================
end */