This commit is contained in:
parent
9e1c863edd
commit
6da99378f2
4 changed files with 340 additions and 0 deletions
118
source/player/pmcart.cpp
Normal file
118
source/player/pmcart.cpp
Normal file
|
@ -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 <ACTOR_SPONGEBOB_ANIM.h>
|
||||
#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 */
|
Loading…
Add table
Add a link
Reference in a new issue