This commit is contained in:
parent
dd86f0a9ba
commit
9efb5425e5
3 changed files with 255 additions and 15 deletions
|
@ -9,23 +9,61 @@
|
|||
#include "Game/Thing.h"
|
||||
#include "Gfx/Skel.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class CPlayer : public CThing
|
||||
{
|
||||
public:
|
||||
CPlayer();
|
||||
virtual ~CPlayer();
|
||||
CPlayer();
|
||||
virtual ~CPlayer();
|
||||
|
||||
void init();
|
||||
void shutdown();
|
||||
void init();
|
||||
void shutdown();
|
||||
void think(int _frames);
|
||||
void render();
|
||||
|
||||
void Animate();
|
||||
|
||||
protected:
|
||||
|
||||
CSkel Skel;
|
||||
private:
|
||||
typedef enum
|
||||
{
|
||||
STATE_IDLE,
|
||||
STATE_RUNSTART,
|
||||
STATE_RUN,
|
||||
STATE_RUNSTOP,
|
||||
|
||||
NUM_STATES,
|
||||
}PLAYER_STATE;
|
||||
|
||||
void setState(PLAYER_STATE _state);
|
||||
void finishedAnim();
|
||||
|
||||
int m_frame;
|
||||
int m_animNo;
|
||||
PLAYER_STATE m_state;
|
||||
CSkel m_skel;
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_RUN_VELOCITY=8,
|
||||
RUN_SPEEDUP=4,
|
||||
RUN_REVERSESLOWDOWN=2,
|
||||
RUN_SLOWDOWN=1,
|
||||
};
|
||||
int m_runVel;
|
||||
|
||||
enum
|
||||
{
|
||||
FACING_LEFT=+1,
|
||||
FACING_RIGHT=-1,
|
||||
};
|
||||
int m_facing;
|
||||
|
||||
static int s_stateAnims[NUM_STATES];
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue