forked from stephane-hulot/thanksgiving-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
45 lines (35 loc) · 988 Bytes
/
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
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <SDL2/SDL.h>
#include "map.h"
#include "button.h"
#include "menu.h"
const float speed = 30;
const float turn_accel = 0.18;
const float turn_max = 0.08;
class Player
{
public:
Player(Map* ma, Menu* me);
void handle_events(float dt);
bool display_flash = false;
int health = 100;
ushort key_count = 0;
bool turkey_destruct, wall_destruct, hurt_sound, key_sound;
float get_x();
float get_y();
float get_angle();
~Player();
//forbids copy constructor to avoid warning in c++11
Player(const Player& p) = delete;
Player& operator=(const Player& p) = delete;
private:
float x, y, angle; //player position and rotation
float turn, walk_x, walk_y; // player input
bool* pressed_keys;
void update_key(SDL_Keycode key, bool state);
void Fire();
Map* map;
Menu* menu;
};
#endif