2001-01-19 23:54:48 +01:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
psfall.cpp
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
|
|
|
#include "player\psfall.h"
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PLAYER_H__
|
|
|
|
#include "player\player.h"
|
|
|
|
#endif
|
|
|
|
|
2001-03-23 21:09:14 +01:00
|
|
|
#ifndef __PLAYER_PMODES_H__
|
|
|
|
#include "player\pmodes.h"
|
|
|
|
#endif
|
|
|
|
|
2001-01-19 23:54:48 +01:00
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
2001-02-26 21:05:31 +01:00
|
|
|
#ifndef __ANIM_SPONGEBOB_HEADER__
|
|
|
|
#include <ACTOR_SPONGEBOB_ANIM.h>
|
2001-01-19 23:54:48 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-03-23 21:09:14 +01:00
|
|
|
void CPlayerStateFall::enter(CPlayerModeBasic *_playerMode)
|
2001-01-19 23:54:48 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->setAnimNo(ANIM_SPONGEBOB_HOVER);
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-03-23 21:09:14 +01:00
|
|
|
void CPlayerStateFall::think(CPlayerModeBasic *_playerMode)
|
2001-01-19 23:54:48 +01:00
|
|
|
{
|
2001-01-22 23:58:12 +01:00
|
|
|
const PlayerMetrics *metrics;
|
2001-02-09 22:41:55 +01:00
|
|
|
int controlHeld,controlDown;
|
2001-01-22 23:58:12 +01:00
|
|
|
DVECTOR move;
|
2001-01-19 23:54:48 +01:00
|
|
|
|
2001-03-23 21:09:14 +01:00
|
|
|
metrics=_playerMode->getPlayerMetrics();
|
|
|
|
controlHeld=_playerMode->getPadInputHeld();
|
|
|
|
controlDown=_playerMode->getPadInputDown();
|
2001-01-19 23:54:48 +01:00
|
|
|
|
2001-02-09 18:01:04 +01:00
|
|
|
if(controlHeld&PI_LEFT)
|
2001-01-19 23:54:48 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->moveLeft();
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
2001-02-09 18:01:04 +01:00
|
|
|
else if(controlHeld&PI_RIGHT)
|
2001-01-19 23:54:48 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->moveRight();
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->slowdown();
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->fall();
|
2001-01-19 23:54:48 +01:00
|
|
|
|
2001-03-23 21:09:14 +01:00
|
|
|
if(controlHeld&PI_DOWN)
|
2001-01-25 16:25:46 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->setState(STATE_BUTTBOUNCE);
|
2001-01-25 16:25:46 +01:00
|
|
|
}
|
2001-01-22 22:02:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-03-23 21:09:14 +01:00
|
|
|
void CPlayerStateFallFar::enter(CPlayerModeBasic *_playerMode)
|
2001-01-22 22:02:59 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->setAnimNo(ANIM_SPONGEBOB_FALL);
|
2001-01-22 22:02:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-03-23 21:09:14 +01:00
|
|
|
void CPlayerStateFallFar::think(CPlayerModeBasic *_playerMode)
|
2001-01-22 22:02:59 +01:00
|
|
|
{
|
2001-01-29 23:35:18 +01:00
|
|
|
int controlHeld;
|
|
|
|
DVECTOR move;
|
2001-01-22 22:02:59 +01:00
|
|
|
|
2001-03-23 21:09:14 +01:00
|
|
|
controlHeld=_playerMode->getPadInputHeld();
|
2001-01-22 22:02:59 +01:00
|
|
|
|
2001-02-09 18:01:04 +01:00
|
|
|
if(controlHeld&PI_LEFT)
|
2001-01-22 22:02:59 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->moveLeft();
|
2001-01-22 22:02:59 +01:00
|
|
|
}
|
2001-02-09 18:01:04 +01:00
|
|
|
else if(controlHeld&PI_RIGHT)
|
2001-01-22 22:02:59 +01:00
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->moveRight();
|
2001-01-22 22:02:59 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->slowdown();
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
2001-03-23 21:09:14 +01:00
|
|
|
_playerMode->fall();
|
2001-01-19 23:54:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|