SBSPSS/source/player/pmdead.cpp

122 lines
2.6 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"
/* 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-03-25 23:33:20 +02:00
m_deadTime=0;
2001-04-19 16:33:27 +02:00
m_player->setAnimNo(ANIM_SPONGEBOB_DEATHSPIN);
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-04-25 20:38:33 +02:00
m_player->moveVertical(5);
2001-03-25 23:33:20 +02:00
if((m_deadTime>DEATH_DELAY&&m_player->getPadInputDown()&PI_ACTION)||
m_deadTime>DEATH_TIMEOUT)
2001-03-25 23:09:06 +02:00
{
2001-03-25 23:33:20 +02:00
respawn();
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 */