This commit is contained in:
parent
d26f36461e
commit
293ce2cc9a
12 changed files with 140 additions and 73 deletions
|
@ -151,8 +151,6 @@ eng=RESTART LEVEL
|
|||
; The following texts DO NOT require translation
|
||||
; ---------------------------------------------------------------
|
||||
|
||||
[STR__DEBUG__FLY_MODE]
|
||||
eng=Set FLY mode
|
||||
[STR__DEBUG__BASICUNARMED_MODE]
|
||||
eng=Set BASICUNARMED mode
|
||||
[STR__DEBUG__FULLUNARMED_MODE]
|
||||
|
@ -165,6 +163,10 @@ eng=Set BALLOON mode
|
|||
eng=Set NET mode
|
||||
[STR__DEBUG__CORALBLOWER_MODE]
|
||||
eng=Set CORALBLOWER mode
|
||||
[STR__DEBUG__DEAD_MODE]
|
||||
eng=Set DEAD mode
|
||||
[STR__DEBUG__FLY_MODE]
|
||||
eng=Set FLY mode
|
||||
|
||||
[STR__DEBUG__LEVEL_SELECT]
|
||||
eng=LEVEL SELECT
|
||||
|
|
|
@ -158,6 +158,7 @@ player_src := demoplay \
|
|||
player \
|
||||
pmodes \
|
||||
pmbloon \
|
||||
pmdead \
|
||||
pmfly \
|
||||
psbutt \
|
||||
psduck \
|
||||
|
|
|
@ -83,41 +83,52 @@ void CPauseMenu::init()
|
|||
m_guiFrame->setOt(OT_POS);
|
||||
m_guiFrame->setFlags(CGUIObject::FLAG_DRAWBORDER);
|
||||
|
||||
int xpos=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__PAUSE_MENU__CONTINUE,
|
||||
&m_exitPauseMenuFlag,true);
|
||||
xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*2,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__PAUSE_MENU__QUIT,
|
||||
&m_quitGameFlag,true);
|
||||
xpos+=TEXT_SPACING*2;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*4,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__FLY_MODE,
|
||||
&newmode,PLAYER_MODE_FLY);
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*5,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__BASICUNARMED_MODE,
|
||||
&newmode,PLAYER_MODE_BASICUNARMED);
|
||||
|
||||
#ifdef __USER_paul__
|
||||
xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__FULLUNARMED_MODE,
|
||||
&newmode,PLAYER_MODE_FULLUNARMED);
|
||||
xpos+=TEXT_SPACING;
|
||||
// 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,
|
||||
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
// STR__DEBUG__NET_MODE,
|
||||
// &newmode,PLAYER_MODE_NET);
|
||||
// xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*8,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__BALLOON_MODE,
|
||||
&newmode,PLAYER_MODE_BALLOON);
|
||||
xpos+=TEXT_SPACING;
|
||||
// CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,TEXT_SPACING*9,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
// (FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
// STR__DEBUG__CORALBLOWER_MODE,
|
||||
// &newmode,PLAYER_MODE_CORALBLOWER);
|
||||
#endif
|
||||
// xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__DEAD_MODE,
|
||||
&newmode,PLAYER_MODE_DEAD);
|
||||
xpos+=TEXT_SPACING;
|
||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,xpos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||
STR__DEBUG__FLY_MODE,
|
||||
&newmode,PLAYER_MODE_FLY);
|
||||
xpos+=TEXT_SPACING;
|
||||
|
||||
m_active=false;
|
||||
}
|
||||
|
|
|
@ -33,14 +33,22 @@
|
|||
#include "player\pmodes.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMFLY_H__
|
||||
#include "player\pmfly.h"
|
||||
#ifndef __PLAYER_PMCHOP_H__
|
||||
#include "player\pmchop.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMBLOON_H__
|
||||
#include "player\pmbloon.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMDEAD_H__
|
||||
#include "player\pmdead.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PMFLY_H__
|
||||
#include "player\pmfly.h"
|
||||
#endif
|
||||
|
||||
// to be removed
|
||||
#include "gfx\tpage.h"
|
||||
|
||||
|
@ -130,7 +138,7 @@ static void writeDemoControls()
|
|||
static const char *s_modeText[NUM_PLAYERMODES]=
|
||||
{
|
||||
"BASICUNARMED",
|
||||
// "FULLUNARMED",
|
||||
"FULLUNARMED",
|
||||
"BALLOON",
|
||||
// "NET",
|
||||
// "CORALBLOWER",
|
||||
|
@ -163,13 +171,17 @@ int CAMERA_SCROLLSPEED=60; // Speed of the scroll ( 60=1 tile scrolled every
|
|||
|
||||
|
||||
CPlayerModeBase PLAYERMODE;
|
||||
CPlayerModeChop PLAYERMODECHOP;
|
||||
CPlayerModeBalloon PLAYERMODEBALLOON;
|
||||
CPlayerModeDead PLAYERMODEDEAD;
|
||||
CPlayerModeFly PLAYERMODEFLY;
|
||||
|
||||
CPlayerMode *CPlayer::s_playerModes[NUM_PLAYERMODES]=
|
||||
{
|
||||
&PLAYERMODE, // PLAYER_MODE_BASICUNARMED
|
||||
&PLAYERMODECHOP, // PLAYER_MODE_FULLUNARMED
|
||||
&PLAYERMODEBALLOON, // PLAYER_MODE_BALLOON
|
||||
&PLAYERMODEDEAD, // PLAYER_MODE_DEAD
|
||||
&PLAYERMODEFLY, // PLAYER_MODE_FLY
|
||||
};
|
||||
|
||||
|
@ -634,14 +646,14 @@ void CPlayer::respawn()
|
|||
// setState(STATE_IDLE);
|
||||
|
||||
// Strip any items that the player might be holding
|
||||
// if(m_currentMode!=PLAYER_MODE_BASICUNARMED)
|
||||
// {
|
||||
// setMode(PLAYER_MODE_FULLUNARMED);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
if(m_currentMode!=PLAYER_MODE_BASICUNARMED)
|
||||
{
|
||||
setMode(PLAYER_MODE_FULLUNARMED);
|
||||
}
|
||||
else
|
||||
{
|
||||
setMode(PLAYER_MODE_BASICUNARMED);
|
||||
// }
|
||||
}
|
||||
|
||||
s_health=MAX_HEALTH;
|
||||
m_invincibleFrameCount=INVIBCIBLE_FRAMES__START;
|
||||
|
@ -704,6 +716,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
|
|||
else
|
||||
{
|
||||
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_DEFEATED_JINGLE);
|
||||
setMode(PLAYER_MODE_DEAD);
|
||||
// setState(STATE_DEAD);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
typedef enum
|
||||
{
|
||||
PLAYER_MODE_BASICUNARMED,
|
||||
// PLAYER_MODE_FULLUNARMED,
|
||||
PLAYER_MODE_FULLUNARMED,
|
||||
PLAYER_MODE_BALLOON,
|
||||
//PLAYER_MODE_BUBBLE_MIXTURE,
|
||||
//PLAYER_MODE_HELMET,
|
||||
|
@ -57,6 +57,8 @@ typedef enum
|
|||
// PLAYER_MODE_CORALBLOWER,
|
||||
//PLAYER_MODE_JELLY_LAUNCHER,
|
||||
|
||||
PLAYER_MODE_DEAD,
|
||||
|
||||
PLAYER_MODE_FLY,
|
||||
|
||||
NUM_PLAYERMODES,
|
||||
|
@ -163,10 +165,8 @@ public:
|
|||
PLAYERINPUT getPadInputDown() {return m_padInputDown;}
|
||||
class CLayerCollision *getLayerCollision() {return m_layerCollision;}
|
||||
|
||||
|
||||
void takeDamage(DAMAGE_TYPE _damage);
|
||||
|
||||
private:
|
||||
void respawn();
|
||||
|
||||
|
||||
|
|
|
@ -54,6 +54,34 @@ static PlayerMetrics s_playerMetrics=
|
|||
} };
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeBalloon::enter()
|
||||
{
|
||||
CPlayerModeBase::enter();
|
||||
m_ballonTimer=BALLOON_TIME;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeBalloon::think()
|
||||
{
|
||||
CPlayerModeBase::think();
|
||||
if(--m_ballonTimer==0)
|
||||
{
|
||||
m_player->setMode(PLAYER_MODE_FULLUNARMED);
|
||||
PAUL_DBGMSG("*pop*");
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -65,6 +93,5 @@ const struct PlayerMetrics *CPlayerModeBalloon::getPlayerMetrics()
|
|||
return &s_playerMetrics;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -37,8 +37,18 @@
|
|||
class CPlayerModeBalloon : public CPlayerModeBase
|
||||
{
|
||||
public:
|
||||
virtual void enter();
|
||||
virtual void think();
|
||||
|
||||
virtual int canFallForever() {return true;}
|
||||
virtual const struct PlayerMetrics *getPlayerMetrics();
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
BALLOON_TIME=10*60,
|
||||
};
|
||||
int m_ballonTimer;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
|
||||
#include "player\pmdead.h"
|
||||
|
||||
//#ifndef __PLAYER_PLAYER_H__
|
||||
//#include "player\player.h"
|
||||
//#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -52,6 +48,7 @@
|
|||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeDead::enter()
|
||||
{
|
||||
m_deadTime=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -62,28 +59,12 @@ void CPlayerModeDead::enter()
|
|||
---------------------------------------------------------------------- */
|
||||
void CPlayerModeDead::think()
|
||||
{
|
||||
DVECTOR pos;
|
||||
int controlHeld;
|
||||
|
||||
pos=getPlayerPos();
|
||||
controlHeld=getPadInputHeld();
|
||||
if(controlHeld&PI_LEFT)
|
||||
m_deadTime++;
|
||||
if((m_deadTime>DEATH_DELAY&&m_player->getPadInputDown()&PI_ACTION)||
|
||||
m_deadTime>DEATH_TIMEOUT)
|
||||
{
|
||||
pos.vx-=5;
|
||||
respawn();
|
||||
}
|
||||
else if(controlHeld&PI_RIGHT)
|
||||
{
|
||||
pos.vx+=5;
|
||||
}
|
||||
if(controlHeld&PI_UP)
|
||||
{
|
||||
pos.vy-=5;
|
||||
}
|
||||
else if(controlHeld&PI_DOWN)
|
||||
{
|
||||
pos.vy+=5;
|
||||
}
|
||||
setPlayerPos(&pos);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
|
|
@ -36,6 +36,18 @@
|
|||
|
||||
class CPlayerModeDead : public CPlayerMode
|
||||
{
|
||||
public:
|
||||
virtual void enter();
|
||||
virtual void think();
|
||||
|
||||
private:
|
||||
// Player can press ACTION to respawn after death
|
||||
enum
|
||||
{
|
||||
DEATH_DELAY=2*60, // Can't force a respawn for this long
|
||||
DEATH_TIMEOUT=5*60, // SB respawns automatically after this long
|
||||
};
|
||||
int m_deadTime;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -95,10 +95,6 @@ static CPlayerStateButtBounce stateButtBounce;
|
|||
static CPlayerStateButtBounceFall stateButtBounceFall;
|
||||
static CPlayerStateButtBounceLand stateButtBounceLand;
|
||||
|
||||
/*
|
||||
static CPlayerStateDead stateDead;
|
||||
*/
|
||||
|
||||
CPlayerState *CPlayerModeBase::s_stateTable[]=
|
||||
{
|
||||
&stateUnarmedIdle, // STATE_IDLE
|
||||
|
@ -129,16 +125,6 @@ static PlayerMetrics s_playerMetrics=
|
|||
} };
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -150,6 +136,14 @@ 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 CPlayerMode::respawn() {m_player->respawn();}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
|
|
@ -88,6 +88,8 @@ protected:
|
|||
DVECTOR getPlayerPos();
|
||||
void setPlayerPos(DVECTOR *_pos);
|
||||
|
||||
void respawn();
|
||||
|
||||
class CPlayer *m_player;
|
||||
|
||||
};
|
||||
|
@ -135,8 +137,6 @@ public:
|
|||
void jump();
|
||||
void fall();
|
||||
|
||||
// virtual void respawn(class CPlayer *_player);
|
||||
|
||||
|
||||
private:
|
||||
int m_fallFrames;
|
||||
|
|
|
@ -828,6 +828,22 @@ SOURCE=..\..\..\source\player\pmbloon.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmchop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmchop.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmdead.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmdead.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\player\pmfly.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue