This commit is contained in:
parent
024914d8f3
commit
a6b6cdbb57
11 changed files with 103 additions and 30 deletions
|
@ -151,6 +151,8 @@ eng=RESTART LEVEL
|
||||||
; The following texts DO NOT require translation
|
; The following texts DO NOT require translation
|
||||||
; ---------------------------------------------------------------
|
; ---------------------------------------------------------------
|
||||||
|
|
||||||
|
[STR__DEBUG__FLY_MODE]
|
||||||
|
eng=Set FLY mode
|
||||||
[STR__DEBUG__BASICUNARMED_MODE]
|
[STR__DEBUG__BASICUNARMED_MODE]
|
||||||
eng=Set BASICUNARMED mode
|
eng=Set BASICUNARMED mode
|
||||||
[STR__DEBUG__FULLUNARMED_MODE]
|
[STR__DEBUG__FULLUNARMED_MODE]
|
||||||
|
|
|
@ -153,6 +153,7 @@ player_src := demoplay \
|
||||||
psdead \
|
psdead \
|
||||||
psduck \
|
psduck \
|
||||||
psfall \
|
psfall \
|
||||||
|
psfly \
|
||||||
psidle \
|
psidle \
|
||||||
psjump \
|
psjump \
|
||||||
psrun \
|
psrun \
|
||||||
|
|
|
@ -30,6 +30,10 @@
|
||||||
#include "mem\memory.h"
|
#include "mem\memory.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER_PLAYER_H__
|
||||||
|
#include "player\player.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -37,10 +41,6 @@
|
||||||
/* Data
|
/* Data
|
||||||
---- */
|
---- */
|
||||||
|
|
||||||
#ifndef __SPR_UIGFX_H__
|
|
||||||
#include <uigfx.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __STRING_ENUMS__
|
#ifndef __STRING_ENUMS__
|
||||||
#include <trans.h>
|
#include <trans.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,27 +90,32 @@ void CPauseMenu::init()
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,30,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,30,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__PAUSE_MENU__QUIT,
|
STR__PAUSE_MENU__QUIT,
|
||||||
&m_quitGameFlag,true);
|
&m_quitGameFlag,true);
|
||||||
#ifdef __USER_paul__
|
|
||||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,60,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,60,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__DEBUG__BASICUNARMED_MODE,
|
STR__DEBUG__FLY_MODE,
|
||||||
&newmode,0);
|
&newmode,PLAYER_MODE_FLY);
|
||||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,80,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,80,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__DEBUG__FULLUNARMED_MODE,
|
STR__DEBUG__BASICUNARMED_MODE,
|
||||||
&newmode,1);
|
&newmode,PLAYER_MODE_BASICUNARMED);
|
||||||
|
#ifdef __USER_paul__
|
||||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,100,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,100,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__DEBUG__SQUEAKYBOOTS_MODE,
|
STR__DEBUG__FULLUNARMED_MODE,
|
||||||
&newmode,2);
|
&newmode,PLAYER_MODE_FULLUNARMED);
|
||||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,120,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,120,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__DEBUG__NET_MODE,
|
STR__DEBUG__SQUEAKYBOOTS_MODE,
|
||||||
&newmode,3);
|
&newmode,PLAYER_MODE_SQUEAKYBOOTS);
|
||||||
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,140,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,140,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
|
STR__DEBUG__NET_MODE,
|
||||||
|
&newmode,PLAYER_MODE_NET);
|
||||||
|
CGUIFactory::createValueButtonFrame(m_guiFrame,
|
||||||
|
(FRAME_WIDTH-TEXT_BOX_WIDTH)/2,160,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT,
|
||||||
STR__DEBUG__CORALBLOWER_MODE,
|
STR__DEBUG__CORALBLOWER_MODE,
|
||||||
&newmode,4);
|
&newmode,PLAYER_MODE_CORALBLOWER);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_active=false;
|
m_active=false;
|
||||||
|
|
|
@ -378,7 +378,7 @@ Pos.vy=((Pos.vy-16)&0xfffffff0)+colHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Pos.vx<16)Pos.vx=16;
|
if(Pos.vx<16)Pos.vx=16;
|
||||||
else if(Pos.vx>m_mapEdge.vx)Pos.vx=m_mapEdge.vx;
|
else if(Pos.vx>m_mapEdge.vx-16)Pos.vx=m_mapEdge.vx-16;
|
||||||
if(Pos.vy<16)Pos.vy=16;
|
if(Pos.vy<16)Pos.vy=16;
|
||||||
else if(Pos.vy>m_mapEdge.vy-16)Pos.vy=m_mapEdge.vy-16;
|
else if(Pos.vy>m_mapEdge.vy-16)Pos.vy=m_mapEdge.vy-16;
|
||||||
|
|
||||||
|
@ -762,6 +762,10 @@ DVECTOR CPlayer::getPlayerPos()
|
||||||
{
|
{
|
||||||
return Pos;
|
return Pos;
|
||||||
}
|
}
|
||||||
|
void CPlayer::setPlayerPos(DVECTOR *_pos)
|
||||||
|
{
|
||||||
|
Pos=*_pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -801,7 +805,7 @@ int CPlayer::isOnSolidGround()
|
||||||
if right half of player is hanging or 0 if no part of the
|
if right half of player is hanging or 0 if no part of the
|
||||||
player is hanging
|
player is hanging
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int csize=20;
|
int csize=15;
|
||||||
int CPlayer::isOnEdge()
|
int CPlayer::isOnEdge()
|
||||||
{
|
{
|
||||||
int ret=0;
|
int ret=0;
|
||||||
|
|
|
@ -76,6 +76,7 @@ typedef enum
|
||||||
PLAYER_MODE_SQUEAKYBOOTS,
|
PLAYER_MODE_SQUEAKYBOOTS,
|
||||||
PLAYER_MODE_NET,
|
PLAYER_MODE_NET,
|
||||||
PLAYER_MODE_CORALBLOWER,
|
PLAYER_MODE_CORALBLOWER,
|
||||||
|
PLAYER_MODE_FLY,
|
||||||
|
|
||||||
NUM_PLAYERMODES,
|
NUM_PLAYERMODES,
|
||||||
}PLAYER_MODE;
|
}PLAYER_MODE;
|
||||||
|
@ -179,6 +180,7 @@ protected:
|
||||||
DVECTOR getMoveVelocity();
|
DVECTOR getMoveVelocity();
|
||||||
void setMoveVelocity(DVECTOR *_moveVel);
|
void setMoveVelocity(DVECTOR *_moveVel);
|
||||||
DVECTOR getPlayerPos();
|
DVECTOR getPlayerPos();
|
||||||
|
void setPlayerPos(DVECTOR *_pos);
|
||||||
PLAYERINPUT getPadInputHeld();
|
PLAYERINPUT getPadInputHeld();
|
||||||
PLAYERINPUT getPadInputDown();
|
PLAYERINPUT getPadInputDown();
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,10 @@
|
||||||
#include "player\psdead.h"
|
#include "player\psdead.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER__PSFLY_H__
|
||||||
|
#include "player\psfly.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -89,6 +93,7 @@ CPlayerStateDuck stateDuck;
|
||||||
CPlayerStateSoakUp stateSoackUp;
|
CPlayerStateSoakUp stateSoackUp;
|
||||||
CPlayerStateGetUp stateGetup;
|
CPlayerStateGetUp stateGetup;
|
||||||
CPlayerStateDead stateDead;
|
CPlayerStateDead stateDead;
|
||||||
|
CPlayerStateFly stateFly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -264,6 +269,39 @@ CPlayer::PlayerMode CPlayer::s_modes[NUM_PLAYERMODES]=
|
||||||
&stateDead, // STATE_DEAD
|
&stateDead, // STATE_DEAD
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Fly mode ( A useful debugging mode.. )
|
||||||
|
//
|
||||||
|
{
|
||||||
|
{ {
|
||||||
|
DEFAULT_PLAYER_JUMP_VELOCITY, // PM__JUMP_VELOCITY
|
||||||
|
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_SLOWDOWN, // PM__RUN_SLOWDOWN
|
||||||
|
} },
|
||||||
|
{
|
||||||
|
&stateFly, // STATE_IDLE
|
||||||
|
&stateFly, // STATE_IDLETEETER
|
||||||
|
&stateFly, // STATE_JUMP
|
||||||
|
&stateFly, // STATE_RUN
|
||||||
|
&stateFly, // STATE_FALL
|
||||||
|
&stateFly, // STATE_FALLFAR
|
||||||
|
&stateFly, // STATE_BUTTBOUNCE
|
||||||
|
&stateFly, // STATE_BUTTFALL
|
||||||
|
&stateFly, // STATE_BUTTLAND
|
||||||
|
&stateFly, // STATE_ATTACK
|
||||||
|
&stateFly, // STATE_RUNATTACK
|
||||||
|
&stateFly, // STATE_AIRATTACK
|
||||||
|
&stateFly, // STATE_DUCK
|
||||||
|
&stateFly, // STATE_SOAKUP
|
||||||
|
&stateFly, // STATE_GETUP
|
||||||
|
&stateFly, // STATE_DEAD
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CPlayerStateFall::enter(CPlayer *_player)
|
void CPlayerStateFly::enter(CPlayer *_player)
|
||||||
{
|
{
|
||||||
setAnimNo(_player,ANIM_PLAYER_ANIM_IDLEHOOLA);
|
setAnimNo(_player,ANIM_PLAYER_ANIM_IDLEHOOLA);
|
||||||
}
|
}
|
||||||
|
@ -74,30 +74,30 @@ void CPlayerStateFall::enter(CPlayer *_player)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CPlayerStateFall::think(CPlayer *_player)
|
void CPlayerStateFly::think(CPlayer *_player)
|
||||||
{
|
{
|
||||||
int controlHeld;
|
int controlHeld;
|
||||||
DVECTOR pos;
|
DVECTOR pos;
|
||||||
|
|
||||||
controlHeld=getPadInputHeld(_player);
|
controlHeld=getPadInputHeld(_player);
|
||||||
pos=getPlayerPos(_player);
|
pos=getPlayerPos(_player);
|
||||||
if(controlHeld&PI_UP)
|
|
||||||
{
|
|
||||||
pos.vx-=5;
|
|
||||||
}
|
|
||||||
else if(controlHeld&PI_DOWN)
|
|
||||||
{
|
|
||||||
pos.vx+=5;
|
|
||||||
}
|
|
||||||
if(controlHeld&PI_LEFT)
|
if(controlHeld&PI_LEFT)
|
||||||
{
|
{
|
||||||
pos.vy-=5;
|
pos.vx-=8;
|
||||||
}
|
}
|
||||||
else if(controlHeld&PI_RIGHT)
|
else if(controlHeld&PI_RIGHT)
|
||||||
{
|
{
|
||||||
pos.vy+=5;
|
pos.vx+=8;
|
||||||
}
|
}
|
||||||
this->setPlayerPos(_player,pos);
|
if(controlHeld&PI_UP)
|
||||||
|
{
|
||||||
|
pos.vy-=8;
|
||||||
|
}
|
||||||
|
else if(controlHeld&PI_DOWN)
|
||||||
|
{
|
||||||
|
pos.vy+=8;
|
||||||
|
}
|
||||||
|
this->setPlayerPos(_player,&pos);
|
||||||
|
|
||||||
advanceAnimFrameAndCheckForEndOfAnim(_player);
|
advanceAnimFrameAndCheckForEndOfAnim(_player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
Structure defintions
|
Structure defintions
|
||||||
-------------------- */
|
-------------------- */
|
||||||
|
|
||||||
class CPlayerStateFall : public CPlayerState
|
class CPlayerStateFly : public CPlayerState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void enter(class CPlayer *_player);
|
virtual void enter(class CPlayer *_player);
|
||||||
|
|
|
@ -210,6 +210,18 @@ DVECTOR CPlayerState::getPlayerPos(CPlayer *_player)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CPlayerState::setPlayerPos(class CPlayer *_player,DVECTOR *_pos)
|
||||||
|
{
|
||||||
|
return _player->setPlayerPos(_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
|
|
@ -54,6 +54,7 @@ protected:
|
||||||
DVECTOR getMoveVelocity(class CPlayer *_player);
|
DVECTOR getMoveVelocity(class CPlayer *_player);
|
||||||
void setMoveVelocity(class CPlayer *_player,DVECTOR *_moveVel);
|
void setMoveVelocity(class CPlayer *_player,DVECTOR *_moveVel);
|
||||||
DVECTOR getPlayerPos(class CPlayer *_player);
|
DVECTOR getPlayerPos(class CPlayer *_player);
|
||||||
|
void setPlayerPos(class CPlayer *_player,DVECTOR *_pos);
|
||||||
int getPadInputHeld(class CPlayer *_player);
|
int getPadInputHeld(class CPlayer *_player);
|
||||||
int getPadInputDown(class CPlayer *_player);
|
int getPadInputDown(class CPlayer *_player);
|
||||||
|
|
||||||
|
|
|
@ -749,6 +749,14 @@ SOURCE=..\..\..\source\player\psfall.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\player\psfly.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\player\psfly.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\player\psidle.cpp
|
SOURCE=..\..\..\source\player\psidle.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue