SBSPSS/source/player/psdead.cpp

100 lines
2.0 KiB
C++
Raw Normal View History

2001-02-06 21:25:27 +01:00
/*=========================================================================
psdead.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\psdead.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
2001-02-12 18:55:01 +01:00
#ifndef __SYSTEM_GSTATE_H__
#include "system\gstate.h"
#endif
2001-02-06 21:25:27 +01:00
/* Std Lib
------- */
/* Data
---- */
2001-02-26 21:05:31 +01:00
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
2001-02-06 21:25:27 +01:00
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateDead::enter(CPlayer *_player)
{
2001-02-26 21:05:31 +01:00
setAnimNo(_player,ANIM_SPONGEBOB_DEATHSPIN);
2001-02-12 18:55:01 +01:00
m_deadCounter=0;
2001-02-06 21:25:27 +01:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateDead::think(CPlayer *_player)
{
2001-02-12 18:55:01 +01:00
if(!m_deadCounter)
2001-02-06 21:25:27 +01:00
{
2001-02-12 18:55:01 +01:00
if(advanceAnimFrameAndCheckForEndOfAnim(_player))
{
retreatAnimFrameAndCheckForEndOfAnim(_player);
m_deadCounter=1;
}
}
else
{
if(++m_deadCounter>10*GameState::getOneSecondInFrames()||
getPadInputDown(_player)&PI_ACTION)
{
respawn(_player);
}
2001-02-06 21:25:27 +01:00
}
}
/*===========================================================================
end */