SBSPSS/source/player/pmdead.cpp

142 lines
3.0 KiB
C++
Raw Normal View History

2001-03-25 23:09:06 +02:00
/*=========================================================================
pmdead.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\pmdead.h"
2001-05-11 03:58:36 +02:00
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
2001-03-25 23:09:06 +02:00
/* Std Lib
------- */
/* Data
---- */
2001-04-05 18:26:17 +02:00
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
#endif
2001-03-25 23:09:06 +02:00
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeDead::enter()
{
2001-05-17 20:42:59 +02:00
int deathAnim;
2001-03-25 23:33:20 +02:00
m_deadTime=0;
2001-05-17 20:42:59 +02:00
switch(m_player->getDeathType())
{
default:
case DEATHTYPE__NORMAL:
deathAnim=ANIM_SPONGEBOB_DEATHSPIN;
break;
case DEATHTYPE__DRYUP:
deathAnim=ANIM_SPONGEBOB_DEATHDRY;
break;
case DEATHTYPE__SQUASH:
deathAnim=ANIM_SPONGEBOB_DEATHSQUASH;
break;
}
m_player->setAnimNo(deathAnim);
2001-03-25 23:09:06 +02:00
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeDead::think()
{
2001-03-25 23:33:20 +02:00
m_deadTime++;
2001-04-19 16:33:27 +02:00
if(m_deadTime<m_player->getAnimFrameCount())
{
m_player->setAnimFrame(m_deadTime);
}
2001-05-15 23:41:39 +02:00
m_player->moveVertical(5);
2001-04-25 20:38:33 +02:00
2001-05-18 20:05:24 +02:00
if((m_deadTime>DEATH_DELAY&&m_player->getPadInputDown()&(PI_JUMP|PI_FIRE))||
2001-03-25 23:33:20 +02:00
m_deadTime>DEATH_TIMEOUT)
2001-03-25 23:09:06 +02:00
{
2001-05-11 03:58:36 +02:00
CGameScene::restartlevel();
2001-03-25 23:09:06 +02:00
}
}
2001-04-05 18:26:17 +02:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
/*
void CPlayerModeDead::render(DVECTOR *_pos)
{
DVECTOR deadSbPos;
deadSbPos=*_pos;
deadSbPos.vy-=m_deadTime;
m_player->renderSb(&deadSbPos,ANIM_SPONGEBOB_DEATHANGLE,0);
}
*/
2001-04-19 16:33:27 +02:00
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeDead::fall()
{
2001-04-25 20:38:33 +02:00
/*
m_yVelocity+=getPlayerMetrics()->m_metric[DEFAULT_PLAYER_PLAYER_GRAVITY];
if(m_yVelocity>=metrics->m_metric[DEFAULT_PLAYER_TERMINAL_VELOCITY]<<VELOCITY_SHIFT)
2001-04-19 16:33:27 +02:00
{
2001-04-25 20:38:33 +02:00
m_yVelocity=metrics->m_metric[DEFAULT_PLAYER_TERMINAL_VELOCITY]<<VELOCITY_SHIFT;
2001-04-19 16:33:27 +02:00
}
2001-04-25 20:38:33 +02:00
*/
2001-04-19 16:33:27 +02:00
}
2001-03-25 23:09:06 +02:00
/*===========================================================================
end */