2001-06-12 18:19:08 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
pscart.cpp
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
|
|
|
#include "player\pscart.h"
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PLAYER_H__
|
|
|
|
#include "player\player.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PMODES_H__
|
|
|
|
#include "player\pmodes.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __SOUND_SOUND_H__
|
|
|
|
#include "sound\sound.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __PLATFORM_PLATFORM_H__
|
|
|
|
#include "platform\platform.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
|
|
|
#ifndef __ANIM_SPONGEBOB_HEADER__
|
|
|
|
#include <ACTOR_SPONGEBOB_ANIM.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
|
|
|
|
CPlayerStateCart s_stateCart;
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPlayerStateCart::enter(CPlayerModeBase *_playerMode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPlayerStateCart::think(CPlayerModeBase *_playerMode)
|
|
|
|
{
|
2001-07-13 17:18:50 +02:00
|
|
|
int controlDown, controlHeld;
|
2001-06-12 18:19:08 +02:00
|
|
|
|
2001-06-12 18:28:39 +02:00
|
|
|
if ( _playerMode->advanceAnimFrameAndCheckForEndOfAnim() )
|
|
|
|
{
|
|
|
|
_playerMode->setAnimNo( ANIM_SPONGEBOB_IDLEBREATH );
|
|
|
|
}
|
2001-06-12 18:19:08 +02:00
|
|
|
controlDown=_playerMode->getPadInputDown();
|
2001-07-13 17:18:50 +02:00
|
|
|
controlHeld=_playerMode->getPadInputHeld();
|
2001-06-12 18:19:08 +02:00
|
|
|
|
2001-07-13 17:18:50 +02:00
|
|
|
CNpcPlatform *platform;
|
|
|
|
platform = (CNpcPlatform *) _playerMode->getPlayer()->isOnPlatform();
|
2001-06-12 18:19:08 +02:00
|
|
|
|
2001-07-13 17:18:50 +02:00
|
|
|
if ( platform )
|
|
|
|
{
|
|
|
|
if(controlDown&PI_JUMP)
|
|
|
|
{
|
|
|
|
platform->jump();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( controlHeld & PI_LEFT )
|
|
|
|
{
|
|
|
|
platform->slowDown();
|
|
|
|
}
|
|
|
|
else if ( controlHeld & PI_RIGHT )
|
|
|
|
{
|
|
|
|
platform->speedUp();
|
|
|
|
}
|
2001-06-12 18:19:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|