-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
executable file
·69 lines (61 loc) · 1.43 KB
/
player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef PLAYER_H
#define PLAYER_H
// Player move type definition
#define PLAYER_MOVE_ADD 0
#define PLAYER_MOVE_DELETE 1
// Player move state definition
#define PLAYER_MOVE_DOWN 2
#define PLAYER_MOVE_RIGHT 3
#define PLAYER_MOVE_UP 4
#define PLAYER_MOVE_LEFT 5
// Player angle
#define PLAYER_ANGLE_DOWN 6
#define PLAYER_ANGLE_RIGHT 7
#define PLAYER_ANGLE_UP 8
#define PLAYER_ANGLE_LEFT 9
typedef struct sPlayerMove
{
bool down;
bool right;
bool up;
bool left;
} PlayerMove;
typedef struct sPlayerTexture
{
unsigned int down;
unsigned int right;
unsigned int up;
unsigned int left;
} PlayerTexture;
class Player
{
private:
float x;
float y;
float width;
float height;
float speed;
float helth;
int angle;
PlayerMove moveState;
PlayerTexture texture;
public:
Player(void);
~Player(void);
void move(void);
void changeMoveState(int type, int size);
unsigned int loadModel(SDL_Surface *image, SDL_Rect imageRect);
void loadTexture(void);
void render(void);
void collision(float width, float height);
void collision(Tile *tile);
/*
float getX(void);
float getY(void);
float getWidth(void);
float getHeight(void);
void setX(float value);
void setY(float value);
*/
};
#endif // PLAYER_H