-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
71 lines (48 loc) · 1.17 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
70
71
#ifndef PLAYER_H
#define PLAYER_H
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "SDL/SDL_ttf.h"
#include "FPS.h"
#include "Define.h"
#include <iostream>
using namespace std;
/** Class Player: Manages the player state, attributes and its behaviour. */
class Player {
public:
Player();
char name[10];
bool active;
int n;
int score;
bool alive;
SDL_Surface* Point;
SDL_Color textColor;
private:
float x;
float y;
float init_x;
float init_y;
float speed;
bool tron;
bool noWalls;
int prev_x;
int prev_y;
float angle;
float init_angle;
public:
void ResetPlayer();
void ResetScore();
SDL_Surface* OnLoad(char* File);
bool OnDraw(SDL_Surface* Surf_Dest);
void OnMove();
bool CheckWalls(SDL_Rect WL, SDL_Rect WU, SDL_Rect WR, SDL_Rect WD);
bool operator ==(SDL_Rect B);
void collisions();
void killPlayer();
void setSpeed(float sp);
void setTron();
void setWorm();
void setNoWalls();
};
#endif // PLAYER_H