diff --git a/source/player/pmcart.cpp b/source/player/pmcart.cpp new file mode 100644 index 000000000..b7df46083 --- /dev/null +++ b/source/player/pmcart.cpp @@ -0,0 +1,118 @@ +/*========================================================================= + + pmcart.cpp + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#include "player\pmcart.h" + +#ifndef __GAME_GAME_H__ +#include "game\game.h" +#endif + +#ifndef __PLATFORM_PLATFORM_H__ +#include "platform\platform.h" +#endif + + +/* Std Lib + ------- */ + +/* Data + ---- */ + +#ifndef __ANIM_SPONGEBOB_HEADER__ +#include +#endif + + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerModeCart::enter() +{ + setState( STATE_CART ); +} + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayerModeCart::think() +{ + DVECTOR newPos; + + CThing *platform; + platform=m_player->isOnPlatform(); + + if ( platform ) + { + newPos.vx = platform->getPos().vx; + newPos.vy = platform->getPos().vy; + + int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( newPos.vx, newPos.vy ); + newPos.vy += platformOffset; + + m_player->setPos( newPos ); + + getStateTable()[getState()]->think(this); + } + else + { + m_player->setMode( PLAYER_MODE_BASICUNARMED ); + setState( STATE_IDLE ); + } +} + +/*---------------------------------------------------------------------- + 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); +} +*/ + +/*=========================================================================== +end */ diff --git a/source/player/pmcart.h b/source/player/pmcart.h new file mode 100644 index 000000000..296c804f9 --- /dev/null +++ b/source/player/pmcart.h @@ -0,0 +1,61 @@ +/*========================================================================= + + pmcart.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLAYER_PMCART_H__ +#define __PLAYER_PMCART_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __PLAYER_PMODES_H__ +#include "player\pmodes.h" +#endif + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CPlayerModeCart : public CPlayerModeBase +{ +public: + virtual void enter(); + virtual void think(); +}; + + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __PLAYER_PMCART_H__ */ + +/*=========================================================================== + end */ + + + diff --git a/source/player/pscart.cpp b/source/player/pscart.cpp new file mode 100644 index 000000000..2e5a82f0c --- /dev/null +++ b/source/player/pscart.cpp @@ -0,0 +1,103 @@ +/*========================================================================= + + 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 +#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) +{ + int controlDown; + + controlDown=_playerMode->getPadInputDown(); + + if(controlDown&PI_JUMP) + { + CNpcPlatform *platform; + platform = (CNpcPlatform *) _playerMode->getPlayer()->isOnPlatform(); + + ASSERT( platform ); + + platform->jump(); + } +} + + +/*=========================================================================== + end */ diff --git a/source/player/pscart.h b/source/player/pscart.h new file mode 100644 index 000000000..df51ad808 --- /dev/null +++ b/source/player/pscart.h @@ -0,0 +1,58 @@ +/*========================================================================= + + pscart.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLAYER_PSCART_H__ +#define __PLAYER_PSCART_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#include "player\pstates.h" + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CPlayerStateCart : public CPlayerState +{ +public: + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); +}; + + +/*---------------------------------------------------------------------- + Globals + ------- */ + +extern CPlayerStateCart s_stateCart; + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __PLAYER_PSCART_H__ */ + +/*=========================================================================== + end */