diff --git a/Graphics/pickups/+balloon.bmp b/Graphics/pickups/+balloon.bmp index 7e730010d..2a8045097 100644 Binary files a/Graphics/pickups/+balloon.bmp and b/Graphics/pickups/+balloon.bmp differ diff --git a/Graphics/pickups/+bubblemixture.bmp b/Graphics/pickups/+bubblemixture.bmp index 25687746c..0bfb5b603 100644 Binary files a/Graphics/pickups/+bubblemixture.bmp and b/Graphics/pickups/+bubblemixture.bmp differ diff --git a/Graphics/pickups/+glasses.bmp b/Graphics/pickups/+glasses.bmp index eda8cdc27..25c639c0f 100644 Binary files a/Graphics/pickups/+glasses.bmp and b/Graphics/pickups/+glasses.bmp differ diff --git a/Graphics/pickups/+health100.bmp b/Graphics/pickups/+health100.bmp index a51f706e2..7eb075c3d 100644 Binary files a/Graphics/pickups/+health100.bmp and b/Graphics/pickups/+health100.bmp differ diff --git a/Graphics/pickups/+health25.bmp b/Graphics/pickups/+health25.bmp index f12fbeed1..62d687ef5 100644 Binary files a/Graphics/pickups/+health25.bmp and b/Graphics/pickups/+health25.bmp differ diff --git a/Graphics/pickups/+health50.bmp b/Graphics/pickups/+health50.bmp index e0ddf1667..d840b01a5 100644 Binary files a/Graphics/pickups/+health50.bmp and b/Graphics/pickups/+health50.bmp differ diff --git a/Graphics/pickups/+jellyammo.bmp b/Graphics/pickups/+jellyammo.bmp index 90fc0fd93..8b6959964 100644 Binary files a/Graphics/pickups/+jellyammo.bmp and b/Graphics/pickups/+jellyammo.bmp differ diff --git a/Graphics/pickups/+pants.bmp b/Graphics/pickups/+pants.bmp index 880d6034b..9e5299b16 100644 Binary files a/Graphics/pickups/+pants.bmp and b/Graphics/pickups/+pants.bmp differ diff --git a/Graphics/pickups/+spatula.bmp b/Graphics/pickups/+spatula.bmp index 590138a5c..aab0b50c6 100644 Binary files a/Graphics/pickups/+spatula.bmp and b/Graphics/pickups/+spatula.bmp differ diff --git a/makefile.gaz b/makefile.gaz index 3bf5e54c1..b462ddffc 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -157,6 +157,7 @@ player_src := demoplay \ panimsfx \ player \ pmodes \ + pmbloon \ pmfly \ psbutt \ psduck \ diff --git a/source/game/pause.cpp b/source/game/pause.cpp index 411513050..8d28522fb 100644 --- a/source/game/pause.cpp +++ b/source/game/pause.cpp @@ -99,26 +99,25 @@ void CPauseMenu::init() (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*5,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BASICUNARMED_MODE, &newmode,PLAYER_MODE_BASICUNARMED); -/* + #ifdef __USER_paul__ - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__FULLUNARMED_MODE, - &newmode,PLAYER_MODE_FULLUNARMED); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__NET_MODE, - &newmode,PLAYER_MODE_NET); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*6,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__FULLUNARMED_MODE, +// &newmode,PLAYER_MODE_FULLUNARMED); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*7,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__NET_MODE, +// &newmode,PLAYER_MODE_NET); CGUIFactory::createValueButtonFrame(m_guiFrame, (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, STR__DEBUG__BALLOON_MODE, &newmode,PLAYER_MODE_BALLOON); - CGUIFactory::createValueButtonFrame(m_guiFrame, - (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, - STR__DEBUG__CORALBLOWER_MODE, - &newmode,PLAYER_MODE_CORALBLOWER); +// CGUIFactory::createValueButtonFrame(m_guiFrame, +// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT, +// STR__DEBUG__CORALBLOWER_MODE, +// &newmode,PLAYER_MODE_CORALBLOWER); #endif -*/ m_active=false; } diff --git a/source/pickups/pballoon.cpp b/source/pickups/pballoon.cpp index df47806ec..9fc12e8bc 100644 --- a/source/pickups/pballoon.cpp +++ b/source/pickups/pballoon.cpp @@ -94,7 +94,7 @@ void CBalloonPickup::init() ---------------------------------------------------------------------- */ void CBalloonPickup::collect(class CPlayer *_player) { -// _player->setMode(PLAYER_MODE_BALLOON); + _player->setMode(PLAYER_MODE_BALLOON); CBaseRespawningPickup::collect(_player); } @@ -105,14 +105,18 @@ void CBalloonPickup::collect(class CPlayer *_player) Returns: ---------------------------------------------------------------------- */ int balloon_height=30; -int balloon_r=180; -int balloon_g=180; -int balloon_b=180; +int balloon_r1=251; +int balloon_g1=207; +int balloon_b1=167; +int balloon_r2=147; +int balloon_g2=95; +int balloon_b2=75; int balloon_speed=25; int balloon_scale1=5; int balloon_scale2=2; int balloon_phase=1024; int balloon_vissize=40; +int balloon_stringx=-3; int CBalloonPickup::getVisibilityRadius() { return balloon_vissize; @@ -163,9 +167,11 @@ void CBalloonPickup::renderPickup(DVECTOR *_pos) sprites->printFT4(fh,x+xo1,y,0,0,PICKUPS_OT_POS); setCollisionCentreOffset(xo1,0); - x=_pos->vx; + x=_pos->vx+balloon_stringx; y=_pos->vy+(fh->H/2); - DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r,balloon_g,balloon_b,PICKUPS_OT_POS); + DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r1,balloon_g1,balloon_b1,PICKUPS_OT_POS); + x++; + DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r2,balloon_g2,balloon_b2,PICKUPS_OT_POS); } /*=========================================================================== diff --git a/source/player/player.cpp b/source/player/player.cpp index 6e48afabb..b71ba2660 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -37,6 +37,10 @@ #include "player\pmfly.h" #endif +#ifndef __PLAYER_PMBLOON_H__ +#include "player\pmbloon.h" +#endif + // to be removed #include "gfx\tpage.h" @@ -127,7 +131,7 @@ static const char *s_modeText[NUM_PLAYERMODES]= { "BASICUNARMED", // "FULLUNARMED", -// "BALLOON", + "BALLOON", // "NET", // "CORALBLOWER", "FLY", @@ -158,13 +162,15 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every -CPlayerModeBasic PLAYERMODE; +CPlayerModeBase PLAYERMODE; +CPlayerModeBalloon PLAYERMODEBALLOON; CPlayerModeFly PLAYERMODEFLY; CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]= { - &PLAYERMODE, // PLAYER_MODE_BASICUNARMED - &PLAYERMODEFLY, // PLAYER_MODE_FLY + &PLAYERMODE, // PLAYER_MODE_BASICUNARMED + &PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON + &PLAYERMODEFLY, // PLAYER_MODE_FLY }; diff --git a/source/player/player.h b/source/player/player.h index c311a4702..725b0a07e 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -50,7 +50,7 @@ typedef enum { PLAYER_MODE_BASICUNARMED, // PLAYER_MODE_FULLUNARMED, -// PLAYER_MODE_BALLOON, + PLAYER_MODE_BALLOON, //PLAYER_MODE_BUBBLE_MIXTURE, //PLAYER_MODE_HELMET, // PLAYER_MODE_NET, diff --git a/source/player/pmbloon.cpp b/source/player/pmbloon.cpp index f16a523ae..307f4a357 100644 --- a/source/player/pmbloon.cpp +++ b/source/player/pmbloon.cpp @@ -11,51 +11,11 @@ ===========================================================================*/ -void a(){} -#if 0 - /*---------------------------------------------------------------------- Includes -------- */ -#include "player\pmodes.h" - -#ifndef __PLAYER_PLAYER_H__ -#include "player\player.h" -#endif - -#ifndef __PLAYER_PSTATES_H__ -#include "player\pstates.h" -#endif - -#ifndef __LAYER_COLLISION_H__ -#include "level\layercollision.h" -#endif - -// States -#ifndef __PLAYER__PSJUMP_H__ -#include "player\psjump.h" -#endif - -#ifndef __PLAYER__PSRUN_H__ -#include "player\psrun.h" -#endif - -#ifndef __PLAYER__PSFALL_H__ -#include "player\psfall.h" -#endif - -#ifndef __PLAYER__PSIDLE_H__ -#include "player\psidle.h" -#endif - -#ifndef __PLAYER__PSBUTT_H__ -#include "player\psbutt.h" -#endif - -#ifndef __PLAYER__PSDUCK_H__ -#include "player\psduck.h" -#endif +#include "player\pmbloon.h" /* Std Lib @@ -64,11 +24,6 @@ void a(){} /* Data ---- */ -#ifndef __ANIM_SPONGEBOB_HEADER__ -#include -#endif - - /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ @@ -85,570 +40,31 @@ void a(){} Vars ---- */ -static CPlayerStateUnarmedIdle stateUnarmedIdle; -static CPlayerStateTeeterIdle stateTeeterIdle; -static CPlayerStateJump stateJump; -static CPlayerStateRun stateRun; -static CPlayerStateFall stateFall; -static CPlayerStateFallFar stateFallFar; -static CPlayerStateDuck stateDuck; -static CPlayerStateSoakUp stateSoakUp; -static CPlayerStateGetUp stateGetUp; -static CPlayerStateButtBounce stateButtBounce; -static CPlayerStateButtBounceFall stateButtBounceFall; -static CPlayerStateButtBounceLand stateButtBounceLand; - -/* -static CPlayerStateDead stateDead; -*/ - -CPlayerState *CPlayerModeBasic::s_stateTable[]= -{ - &stateUnarmedIdle, // STATE_IDLE - &stateTeeterIdle, // STATE_IDLETEETER - &stateJump, // STATE_JUMP - &stateRun, // STATE_RUN - &stateFall, // STATE_FALL - &stateFallFar, // STATE_FALLFAR - &stateButtBounce, // STATE_BUTTBOUNCE - &stateButtBounceFall, // STATE_BUTTFALL - &stateButtBounceLand, // STATE_BUTTLAND - &stateDuck, // STATE_DUCK - &stateSoakUp, // STATE_SOAKUP - &stateGetUp, // STATE_GETUP -}; - -PlayerMetrics CPlayerModeBasic::s_playerMetrics= +static PlayerMetrics s_playerMetrics= { { DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY - DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES + DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES DEFAULT_PLAYER_MAX_RUN_VELOCITY, // PM__MAX_RUN_VELOCITY - DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP - DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN + DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP + DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN + DEFAULT_PLAYER_PLAYER_GRAVITY/3, // PM__GRAVITY + DEFAULT_PLAYER_TERMINAL_VELOCITY/3, // PM__TERMINAL_VELOCITY } }; - - - - - - - - - - /*---------------------------------------------------------------------- Function: Purpose: Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerMode::getPadInputHeld() {return m_player->getPadInputHeld();} -int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();} -DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} -void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::enter() -{ - m_fallFrames=0; - setState(STATE_IDLE); - m_moveVelocity.vx=m_moveVelocity.vy=0; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::think() -{ - s_stateTable[m_currentState]->think(this); - thinkVerticalMovement(); - thinkHorizontalMovement(); - - // Teeter if on an edge - if(canTeeter()&&isOnEdge()) - { - setState(STATE_IDLETEETER); - } - -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::render() -{ -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkVerticalMovement() -{ - CLayerCollision *collision; - DVECTOR pos; - int colHeight; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); - - colHeight=collision->getHeightFromGround(pos.vx,pos.vy,1); - -//New collision stuff (pkg) -//if(m_layerCollision->getCollisionType(Pos.vx,Pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT))&COLLISION_TYPE_MASK) -//{ -// m_moveVelocity.vy=0; -// return; -//} - if(colHeight>=0) - { - // Above or on the ground - // Are we falling? - if(m_moveVelocity.vy>0) - { - // Yes.. Check to see if we're about to hit/go through the ground - colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),PLAYER_TERMINAL_VELOCITY+1); - - if(colHeight<=0) - { - // Just hit the ground - // Stick at ground level - pos.vy+=(m_moveVelocity.vy>>VELOCITY_SHIFT)+colHeight; - m_moveVelocity.vy=0; - m_fallFrames=0; - if(m_currentState==STATE_BUTTFALL) - { - // Landed from a butt bounce - setState(STATE_BUTTLAND); - } - else if(m_currentState==STATE_FALLFAR) - { - // Landed from a painfully long fall - setState(STATE_IDLE); - m_player->takeDamage(DAMAGE__FALL); - m_moveVelocity.vx=0; - CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_LAND_AFTER_FALL); - } - else if(m_moveVelocity.vx) - { - // Landed from a jump with x movement - setState(STATE_RUN); - } - else - { - // Landed from a jump with no x movement - setState(STATE_IDLE); - setAnimNo(ANIM_SPONGEBOB_JUMPEND); - } - } - } - else if(colHeight) - { - if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& - m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&& - m_currentState!=STATE_JUMP) - { - // Was floating in the air.. fall! - -// if ( !m_onPlatform ) -// { - setState(STATE_FALL); -// } - } - } - } - else - { -/* - // Below ground - // Perhaps we should be falling? - if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& - m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&& - m_currentState!=STATE_JUMP) - { - setState(STATE_FALL); - } -*/ - } - - pos.vy+=m_moveVelocity.vy>>VELOCITY_SHIFT; - m_player->setPlayerPos(&pos); -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkHorizontalMovement() -{ - if(m_moveVelocity.vx) - { - CLayerCollision *collision; - DVECTOR pos; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); -//New collision stuff (pkg) -//if(m_layerCollision->getCollisionType(Pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),Pos.vy)&COLLISION_TYPE_MASK) -//{ -// m_moveVelocity.vx=0; -// return; -//} - int colHeight; - colHeight=collision->getHeightFromGround(pos.vx,pos.vy,5); - if(colHeight==0) - { - // Ok.. we're on the ground. What happens if we move left/right - colHeight=collision->getHeightFromGround(pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),pos.vy); - if(colHeight<-8) - { - // Big step up. Stop at the edge of the obstruction - int dir,vx,cx,i; - if(m_moveVelocity.vx<0) - { - dir=-1; - vx=-m_moveVelocity.vx>>VELOCITY_SHIFT; - } - else - { - dir=+1; - vx=m_moveVelocity.vx>>VELOCITY_SHIFT; - } - cx=pos.vx; - for(i=0;igetHeightFromGround(cx,pos.vy)<-8) - { - break; - } - cx+=dir; - } - pos.vx=cx-dir; - - // If running then go to idle, otherwise leave in same state - if(m_currentState==STATE_RUN) - { - setState(STATE_IDLE); - } - m_moveVelocity.vx=0; - - // Get the height at this new position and then try the step-up code below. - // Without this, there are problems when you run up a slope and hit a wall at the same time - colHeight=collision->getHeightFromGround(pos.vx,pos.vy); - } - if(colHeight&&colHeight>=-8&&colHeight<=8) - { - // Small step up/down. Follow the contour of the level - pos.vy+=colHeight; - } - } - else - { - // In the air -// if(!(colHeight<0&&m_currentState==STATE_JUMP)) // Lets you jump through platforms from below - if(colHeight>=0) // Lets you jump through platforms from below - { - colHeight=collision->getHeightFromGround(pos.vx+(m_moveVelocity.vx>>VELOCITY_SHIFT),pos.vy,5); - if(colHeight<0) - { - // Stop at the edge of the obstruction - int dir,vx,cx,i; - if(m_moveVelocity.vx<0) - { - dir=-1; - vx=-m_moveVelocity.vx>>VELOCITY_SHIFT; - } - else - { - dir=+1; - vx=m_moveVelocity.vx>>VELOCITY_SHIFT; - } - cx=pos.vx; - for(i=0;igetHeightFromGround(cx,pos.vy)<0) - { - break; - } - cx+=dir; - } - pos.vx=cx-dir; - m_moveVelocity.vx=0; - } - } - } - pos.vx+=m_moveVelocity.vx>>VELOCITY_SHIFT; - m_player->setPlayerPos(&pos); - } -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() +const struct PlayerMetrics *CPlayerModeBalloon::getPlayerMetrics() { return &s_playerMetrics; } -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::setState(int _state) -{ - CPlayerState *nextState; - int ret=false; - - nextState=s_stateTable[_state]; - if(nextState) - { - m_currentStateClass=nextState; - m_currentStateClass->enter(this); - m_currentState=(PLAYER_STATE)_state; - ret=true; - } - return ret; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::getFacing() {return m_player->getFacing();} -void CPlayerModeBasic::setFacing(int _facing) {m_player->setFacing(_facing);} -void CPlayerModeBasic::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} -void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() -{ - int animFrame,frameCount; - int looped; - animFrame=m_player->getAnimFrame()+1; - frameCount=m_player->getAnimFrameCount(); - looped=false; - if(animFrame>=frameCount) - { - looped=true; - animFrame=0; - } - m_player->setAnimFrame(animFrame); - return looped; - -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -DVECTOR CPlayerModeBasic::getMoveVelocity() {return m_moveVelocity;} -void CPlayerModeBasic::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} -void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: FACING_LEFT if left half of player is hanging, FACING_RIGHT - if right half of player is hanging or 0 if no part of the - player is hanging - ---------------------------------------------------------------------- */ -int csize=5; -int cheight=15; -int CPlayerModeBasic::isOnEdge() -{ - CLayerCollision *collision; - DVECTOR pos; - int ret; - - collision=m_player->getLayerCollision(); - pos=m_player->getPlayerPos(); - ret=0; - if(collision->getHeightFromGround(pos.vx-csize,pos.vy,cheight+1)>cheight) - { - ret=FACING_LEFT; - } - else if(collision->getHeightFromGround(pos.vx+csize,pos.vy,cheight+1)>cheight) - { - ret=FACING_RIGHT; - } - return ret; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -int CPlayerModeBasic::canMoveLeft() -{ - DVECTOR pos; - pos=m_player->getPlayerPos(); - return m_player->getLayerCollision()->getHeightFromGround(pos.vx-1,pos.vy,16)>-8?true:false; -} - -int CPlayerModeBasic::canMoveRight() -{ - DVECTOR pos; - pos=m_player->getPlayerPos(); - return m_player->getLayerCollision()->getHeightFromGround(pos.vx+1,pos.vy,16)>-8?true:false; -} - -/*---------------------------------------------------------------------- - Function: - Purpose: - Params: - Returns: - ---------------------------------------------------------------------- */ -void CPlayerModeBasic::moveLeft() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - - setFacing(FACING_LEFT); - if(m_moveVelocity.vx<=0) - { - m_moveVelocity.vx-=metrics->m_metric[PM__RUN_SPEEDUP]; - if(m_moveVelocity.vx<-metrics->m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__RUN_REVERSESLOWDOWN]; - } - - /* - if(m_moveVelocity.vx<-CAMERA_STARTMOVETHRESHOLD||m_cameraScrollPos.vx<-CAMERA_SCROLLTHRESHOLD<<8) - { - m_cameraScrollDir=+1; - } - else if(m_moveVelocity.vx>-CAMERA_STOPMOVETHRESHOLD) - { - m_cameraScrollDir=0; - } - */ -} - -void CPlayerModeBasic::moveRight() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - - setFacing(FACING_RIGHT); - if(m_moveVelocity.vx>=0) - { - m_moveVelocity.vx+=metrics->m_metric[PM__RUN_SPEEDUP]; - if(m_moveVelocity.vx>metrics->m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__MAX_RUN_VELOCITY]<m_metric[PM__RUN_REVERSESLOWDOWN]; - } - - /* - if(m_moveVelocity.vx>CAMERA_STARTMOVETHRESHOLD||m_cameraScrollPos.vx>CAMERA_SCROLLTHRESHOLD<<8) - { - m_cameraScrollDir=-1; - } - else if(m_moveVelocity.vxm_metric[PM__RUN_SLOWDOWN]; - if(m_moveVelocity.vx>=0) - { - m_moveVelocity.vx=0; - ret=true; - } - } - else if(m_moveVelocity.vx>0) - { - m_moveVelocity.vx-=metrics->m_metric[PM__RUN_SLOWDOWN]; - if(m_moveVelocity.vx<=0) - { - m_moveVelocity.vx=0; - ret=true; - } - } - return ret; -} -void CPlayerModeBasic::jump() -{ - const PlayerMetrics *metrics; - metrics=getPlayerMetrics(); - m_moveVelocity.vy=-metrics->m_metric[PM__JUMP_VELOCITY]<=PLAYER_TERMINAL_VELOCITY<metrics->m_metric[PM__MAX_SAFE_FALL_FRAMES]) - { - setState(STATE_FALLFAR); - } - } - } -} - - /*=========================================================================== end */ - -#endif \ No newline at end of file diff --git a/source/player/pmbloon.h b/source/player/pmbloon.h index c54f240e6..26b269ba5 100644 --- a/source/player/pmbloon.h +++ b/source/player/pmbloon.h @@ -34,8 +34,11 @@ Structure defintions -------------------- */ -class CPlayerModeBalloon : public CPlayerModeBasic +class CPlayerModeBalloon : public CPlayerModeBase { +public: + virtual int canFallForever() {return true;} + virtual const struct PlayerMetrics *getPlayerMetrics(); }; diff --git a/source/player/pmfly.h b/source/player/pmfly.h index b6770cb1a..bda302299 100644 --- a/source/player/pmfly.h +++ b/source/player/pmfly.h @@ -34,7 +34,7 @@ Structure defintions -------------------- */ -class CPlayerModeFly : public CPlayerModeBasic +class CPlayerModeFly : public CPlayerModeBase { public: virtual void enter(); diff --git a/source/player/pmodes.cpp b/source/player/pmodes.cpp index 2e78013a6..67af86801 100644 --- a/source/player/pmodes.cpp +++ b/source/player/pmodes.cpp @@ -99,7 +99,7 @@ static CPlayerStateButtBounceLand stateButtBounceLand; static CPlayerStateDead stateDead; */ -CPlayerState *CPlayerModeBasic::s_stateTable[]= +CPlayerState *CPlayerModeBase::s_stateTable[]= { &stateUnarmedIdle, // STATE_IDLE &stateTeeterIdle, // STATE_IDLETEETER @@ -115,15 +115,17 @@ CPlayerState *CPlayerModeBasic::s_stateTable[]= &stateGetUp, // STATE_GETUP }; -PlayerMetrics CPlayerModeBasic::s_playerMetrics= +static PlayerMetrics s_playerMetrics= { { DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY - DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES + DEFAULT_PLAYER_MAX_JUMP_FRAMES, // PM__MAX_JUMP_FRAMES DEFAULT_PLAYER_MAX_SAFE_FALL_FRAMES, // PM__MAX_SAFE_FALL_FRAMES DEFAULT_PLAYER_MAX_RUN_VELOCITY, // PM__MAX_RUN_VELOCITY - DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP - DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN + DEFAULT_PLAYER_RUN_SPEEDUP, // PM__RUN_SPEEDUP + DEFAULT_PLAYER_RUN_REVERSESLOWDOWN, // PM__RUN_REVERSESLOWDOWN DEFAULT_PLAYER_RUN_SLOWDOWN, // PM__RUN_SLOWDOWN + DEFAULT_PLAYER_PLAYER_GRAVITY, // PM__GRAVITY + DEFAULT_PLAYER_TERMINAL_VELOCITY, // PM__TERMINAL_VELOCITY } }; @@ -145,8 +147,8 @@ PlayerMetrics CPlayerModeBasic::s_playerMetrics= ---------------------------------------------------------------------- */ int CPlayerMode::getPadInputHeld() {return m_player->getPadInputHeld();} int CPlayerMode::getPadInputDown() {return m_player->getPadInputDown();} -DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} -void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} +DVECTOR CPlayerMode::getPlayerPos() {return m_player->getPlayerPos();} +void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} /*---------------------------------------------------------------------- Function: @@ -154,7 +156,7 @@ void CPlayerMode::setPlayerPos(DVECTOR *_pos) {m_player->setPlayerPos(_pos);} Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::enter() +void CPlayerModeBase::enter() { m_fallFrames=0; setState(STATE_IDLE); @@ -167,7 +169,7 @@ void CPlayerModeBasic::enter() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::think() +void CPlayerModeBase::think() { s_stateTable[m_currentState]->think(this); thinkVerticalMovement(); @@ -187,7 +189,7 @@ void CPlayerModeBasic::think() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::render() +void CPlayerModeBase::render() { } @@ -197,7 +199,7 @@ void CPlayerModeBasic::render() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkVerticalMovement() +void CPlayerModeBase::thinkVerticalMovement() { CLayerCollision *collision; DVECTOR pos; @@ -221,7 +223,7 @@ void CPlayerModeBasic::thinkVerticalMovement() if(m_moveVelocity.vy>0) { // Yes.. Check to see if we're about to hit/go through the ground - colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),PLAYER_TERMINAL_VELOCITY+1); + colHeight=collision->getHeightFromGround(pos.vx,pos.vy+(m_moveVelocity.vy>>VELOCITY_SHIFT),getPlayerMetrics()->m_metric[PM__TERMINAL_VELOCITY]+1); if(colHeight<=0) { @@ -295,7 +297,7 @@ void CPlayerModeBasic::thinkVerticalMovement() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::thinkHorizontalMovement() +void CPlayerModeBase::thinkHorizontalMovement() { if(m_moveVelocity.vx) { @@ -404,7 +406,7 @@ void CPlayerModeBasic::thinkHorizontalMovement() Params: Returns: ---------------------------------------------------------------------- */ -const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() +const struct PlayerMetrics *CPlayerModeBase::getPlayerMetrics() { return &s_playerMetrics; } @@ -415,7 +417,7 @@ const struct PlayerMetrics *CPlayerModeBasic::getPlayerMetrics() Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::setState(int _state) +int CPlayerModeBase::setState(int _state) { CPlayerState *nextState; int ret=false; @@ -437,10 +439,10 @@ int CPlayerModeBasic::setState(int _state) Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::getFacing() {return m_player->getFacing();} -void CPlayerModeBasic::setFacing(int _facing) {m_player->setFacing(_facing);} -void CPlayerModeBasic::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} -void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} +int CPlayerModeBase::getFacing() {return m_player->getFacing();} +void CPlayerModeBase::setFacing(int _facing) {m_player->setFacing(_facing);} +void CPlayerModeBase::setAnimNo(int _animNo) {m_player->setAnimNo(_animNo);} +void CPlayerModeBase::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_animFrame);} /*---------------------------------------------------------------------- Function: @@ -448,7 +450,7 @@ void CPlayerModeBasic::setAnimFrame(int _animFrame) {m_player->setAnimFrame(_ Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() +int CPlayerModeBase::advanceAnimFrameAndCheckForEndOfAnim() { int animFrame,frameCount; int looped; @@ -471,9 +473,9 @@ int CPlayerModeBasic::advanceAnimFrameAndCheckForEndOfAnim() Params: Returns: ---------------------------------------------------------------------- */ -DVECTOR CPlayerModeBasic::getMoveVelocity() {return m_moveVelocity;} -void CPlayerModeBasic::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} -void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} +DVECTOR CPlayerModeBase::getMoveVelocity() {return m_moveVelocity;} +void CPlayerModeBase::zeroMoveVelocity() {m_moveVelocity.vx=m_moveVelocity.vy=0;} +void CPlayerModeBase::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_moveVel;} /*---------------------------------------------------------------------- Function: @@ -485,7 +487,7 @@ void CPlayerModeBasic::setMoveVelocity(DVECTOR *_moveVel) {m_moveVelocity=*_mo ---------------------------------------------------------------------- */ int csize=5; int cheight=15; -int CPlayerModeBasic::isOnEdge() +int CPlayerModeBase::isOnEdge() { CLayerCollision *collision; DVECTOR pos; @@ -511,14 +513,14 @@ int CPlayerModeBasic::isOnEdge() Params: Returns: ---------------------------------------------------------------------- */ -int CPlayerModeBasic::canMoveLeft() +int CPlayerModeBase::canMoveLeft() { DVECTOR pos; pos=m_player->getPlayerPos(); return m_player->getLayerCollision()->getHeightFromGround(pos.vx-1,pos.vy,16)>-8?true:false; } -int CPlayerModeBasic::canMoveRight() +int CPlayerModeBase::canMoveRight() { DVECTOR pos; pos=m_player->getPlayerPos(); @@ -531,7 +533,7 @@ int CPlayerModeBasic::canMoveRight() Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerModeBasic::moveLeft() +void CPlayerModeBase::moveLeft() { const PlayerMetrics *metrics; metrics=getPlayerMetrics(); @@ -562,7 +564,7 @@ void CPlayerModeBasic::moveLeft() */ } -void CPlayerModeBasic::moveRight() +void CPlayerModeBase::moveRight() { const PlayerMetrics *metrics; metrics=getPlayerMetrics(); @@ -592,7 +594,7 @@ void CPlayerModeBasic::moveRight() } */ } -int CPlayerModeBasic::slowdown() +int CPlayerModeBase::slowdown() { const PlayerMetrics *metrics; int ret=false; @@ -618,18 +620,20 @@ int CPlayerModeBasic::slowdown() } return ret; } -void CPlayerModeBasic::jump() +void CPlayerModeBase::jump() +{ + m_moveVelocity.vy=-getPlayerMetrics()->m_metric[PM__JUMP_VELOCITY]<m_metric[PM__JUMP_VELOCITY]<=PLAYER_TERMINAL_VELOCITY<m_metric[PM__GRAVITY]; + if(m_moveVelocity.vy>=metrics->m_metric[PM__TERMINAL_VELOCITY]<m_metric[PM__TERMINAL_VELOCITY]<zeroMoveVelocity(); _playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCESTART); @@ -78,7 +78,7 @@ void CPlayerStateButtBounce::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounce::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounce::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { @@ -93,7 +93,7 @@ void CPlayerStateButtBounce::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceFall::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceFall::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_BUTTBOUNCEEND); } @@ -105,7 +105,7 @@ void CPlayerStateButtBounceFall::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceFall::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode) { _playerMode->fall(); } @@ -117,7 +117,7 @@ void CPlayerStateButtBounceFall::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceLand::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode) { // DVECTOR pos; // @@ -132,7 +132,7 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateButtBounceLand::think(CPlayerModeBasic *_playerMode) +void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { diff --git a/source/player/psbutt.h b/source/player/psbutt.h index 3d1beca5a..d3abab5cf 100644 --- a/source/player/psbutt.h +++ b/source/player/psbutt.h @@ -35,24 +35,24 @@ class CPlayerStateButtBounce : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; class CPlayerStateButtBounceFall : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; class CPlayerStateButtBounceLand : public CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); private: diff --git a/source/player/psduck.cpp b/source/player/psduck.cpp index 1f5a00364..78e493436 100644 --- a/source/player/psduck.cpp +++ b/source/player/psduck.cpp @@ -61,7 +61,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateDuck::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateDuck::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_SOAKUP); } @@ -73,7 +73,7 @@ void CPlayerStateDuck::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateDuck::think(CPlayerModeBasic *_playerMode) +void CPlayerStateDuck::think(CPlayerModeBase *_playerMode) { _playerMode->slowdown(); if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) @@ -89,7 +89,7 @@ void CPlayerStateDuck::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateSoakUp::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateSoakUp::enter(CPlayerModeBase *_playerMode) { _playerMode->zeroMoveVelocity(); _playerMode->setAnimNo(ANIM_SPONGEBOB_GETUP); @@ -102,7 +102,7 @@ void CPlayerStateSoakUp::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateSoakUp::think(CPlayerModeBasic *_playerMode) +void CPlayerStateSoakUp::think(CPlayerModeBase *_playerMode) { int controlHeld; @@ -120,7 +120,7 @@ void CPlayerStateSoakUp::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateGetUp::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateGetUp::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_GETUP); } @@ -132,7 +132,7 @@ void CPlayerStateGetUp::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateGetUp::think(CPlayerModeBasic *_playerMode) +void CPlayerStateGetUp::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { diff --git a/source/player/psduck.h b/source/player/psduck.h index c6813c272..d91d073a7 100644 --- a/source/player/psduck.h +++ b/source/player/psduck.h @@ -35,8 +35,8 @@ class CPlayerStateDuck : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateSoakUp : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -53,8 +53,8 @@ public: class CPlayerStateGetUp : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; diff --git a/source/player/psfall.cpp b/source/player/psfall.cpp index 41028c5ae..61359ab50 100644 --- a/source/player/psfall.cpp +++ b/source/player/psfall.cpp @@ -60,7 +60,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFall::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateFall::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_HOVER); } @@ -72,7 +72,7 @@ void CPlayerStateFall::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFall::think(CPlayerModeBasic *_playerMode) +void CPlayerStateFall::think(CPlayerModeBase *_playerMode) { const PlayerMetrics *metrics; int controlHeld,controlDown; @@ -109,7 +109,7 @@ void CPlayerStateFall::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFallFar::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateFallFar::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_FALL); } @@ -121,7 +121,7 @@ void CPlayerStateFallFar::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateFallFar::think(CPlayerModeBasic *_playerMode) +void CPlayerStateFallFar::think(CPlayerModeBase *_playerMode) { int controlHeld; DVECTOR move; diff --git a/source/player/psfall.h b/source/player/psfall.h index 281106711..392043949 100644 --- a/source/player/psfall.h +++ b/source/player/psfall.h @@ -35,8 +35,8 @@ class CPlayerStateFall : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateFallFar : public CPlayerStateFall { private: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); }; diff --git a/source/player/psidle.cpp b/source/player/psidle.cpp index 369a00058..cb3f8744d 100644 --- a/source/player/psidle.cpp +++ b/source/player/psidle.cpp @@ -61,7 +61,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateBaseIdle::thinkControl(CPlayerModeBasic *_playerMode) +void CPlayerStateBaseIdle::thinkControl(CPlayerModeBase *_playerMode) { int controlDown,controlHeld; controlDown=_playerMode->getPadInputDown(); @@ -98,7 +98,7 @@ void CPlayerStateBaseIdle::thinkControl(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateTeeterIdle::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateTeeterIdle::enter(CPlayerModeBase *_playerMode) { int edgeType,dir; int anim; @@ -124,7 +124,7 @@ void CPlayerStateTeeterIdle::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateTeeterIdle::think(CPlayerModeBasic *_playerMode) +void CPlayerStateTeeterIdle::think(CPlayerModeBase *_playerMode) { _playerMode->advanceAnimFrameAndCheckForEndOfAnim(); thinkControl(_playerMode); @@ -137,7 +137,7 @@ void CPlayerStateTeeterIdle::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::enter(CPlayerModeBase *_playerMode) { m_idleTime=0; m_currentIdleAnim=0; @@ -153,7 +153,7 @@ void CPlayerStateIdle::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::think(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::think(CPlayerModeBase *_playerMode) { if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { @@ -169,7 +169,7 @@ void CPlayerStateIdle::think(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateIdle::setNextIdleAnim(CPlayerModeBasic *_playerMode) +void CPlayerStateIdle::setNextIdleAnim(CPlayerModeBase *_playerMode) { IdleAnims *anims; int finished=false; diff --git a/source/player/psidle.h b/source/player/psidle.h index 2ee5dee1c..84a0f26a3 100644 --- a/source/player/psidle.h +++ b/source/player/psidle.h @@ -36,7 +36,7 @@ class CPlayerStateBaseIdle : public CPlayerState { public: - void thinkControl(class CPlayerModeBasic *CPlayerMode); + void thinkControl(class CPlayerModeBase *CPlayerMode); }; @@ -44,8 +44,8 @@ public: class CPlayerStateTeeterIdle : public CPlayerStateBaseIdle { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); }; @@ -62,8 +62,8 @@ typedef struct class CPlayerStateIdle : public CPlayerStateBaseIdle { public: - virtual void enter(class CPlayerModeBasic *_playerMode); - virtual void think(class CPlayerModeBasic *_playerMode); + virtual void enter(class CPlayerModeBase *_playerMode); + virtual void think(class CPlayerModeBase *_playerMode); private: typedef enum @@ -73,7 +73,7 @@ private: ANIMSTATE_END, } ANIMSTATE; - void setNextIdleAnim(class CPlayerModeBasic *_playerMode); + void setNextIdleAnim(class CPlayerModeBase *_playerMode); virtual IdleAnims *getIdleAnimsDb(int _animNo)=0; virtual int getNumIdleAnims()=0; diff --git a/source/player/psjump.cpp b/source/player/psjump.cpp index 3670f95b6..f96740132 100644 --- a/source/player/psjump.cpp +++ b/source/player/psjump.cpp @@ -65,7 +65,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateJump::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateJump::enter(CPlayerModeBase *_playerMode) { _playerMode->setAnimNo(ANIM_SPONGEBOB_HOVER); m_jumpFrames=0; @@ -82,7 +82,7 @@ void CPlayerStateJump::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateJump::think(CPlayerModeBasic *_playerMode) +void CPlayerStateJump::think(CPlayerModeBase *_playerMode) { const PlayerMetrics *metrics; int controlHeld,controlDown; diff --git a/source/player/psjump.h b/source/player/psjump.h index 3f6f6083b..49a058db6 100644 --- a/source/player/psjump.h +++ b/source/player/psjump.h @@ -35,8 +35,8 @@ class CPlayerStateJump : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); private: int m_jumpFrames; diff --git a/source/player/psrun.cpp b/source/player/psrun.cpp index e0114c7dc..3b13da8c5 100644 --- a/source/player/psrun.cpp +++ b/source/player/psrun.cpp @@ -60,7 +60,7 @@ Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateRun::enter(CPlayerModeBasic *_playerMode) +void CPlayerStateRun::enter(CPlayerModeBase *_playerMode) { int controlHeld; controlHeld=_playerMode->getPadInputHeld(); @@ -93,7 +93,7 @@ void CPlayerStateRun::enter(CPlayerModeBasic *_playerMode) Params: Returns: ---------------------------------------------------------------------- */ -void CPlayerStateRun::think(CPlayerModeBasic *_playerMode) +void CPlayerStateRun::think(CPlayerModeBase *_playerMode) { int controlDown,controlHeld; int switchedState=false; diff --git a/source/player/psrun.h b/source/player/psrun.h index b1e61f0c2..376b4b474 100644 --- a/source/player/psrun.h +++ b/source/player/psrun.h @@ -35,8 +35,8 @@ class CPlayerStateRun : public CPlayerState { public: - void enter(class CPlayerModeBasic *_playerMode); - void think(class CPlayerModeBasic *_playerMode); + void enter(class CPlayerModeBase *_playerMode); + void think(class CPlayerModeBase *_playerMode); private: int m_numberOfTimeAnimHasLooped; diff --git a/source/player/pstates.h b/source/player/pstates.h index 7f1890c3d..1ca7bf4ec 100644 --- a/source/player/pstates.h +++ b/source/player/pstates.h @@ -32,8 +32,8 @@ class CPlayerState { public: - virtual void enter(class CPlayerModeBasic *_playerMode) {;} - virtual void think(class CPlayerModeBasic *_playerMode) {;} + virtual void enter(class CPlayerModeBase *_playerMode) {;} + virtual void think(class CPlayerModeBase *_playerMode) {;} }; diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 5107ec914..1a42acc0d 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -820,6 +820,14 @@ SOURCE=..\..\..\source\player\pstates.h # End Group # Begin Source File +SOURCE=..\..\..\source\player\pmbloon.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\player\pmbloon.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\player\pmfly.cpp # End Source File # Begin Source File