-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.h
More file actions
49 lines (34 loc) · 777 Bytes
/
player.h
File metadata and controls
49 lines (34 loc) · 777 Bytes
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
#ifndef PLAYER_H
#define PLAYER_H
#include "entity.h"
#include <math.h>
#include <SFML/Audio/Sound.hpp>
class Player : public Entity{
public:
Player();
~Player();
bool mustRemove() const;
int anim_step;
int anim_dir;
int anim_counter;
void draw();
void frame();
IntRect getRect() const;
Type getType() const{return Type_Player;}
enum Weapon{
Shotgun, Grenade, Carrot,
NbWeapon
};
/// reload completely a random weapon
void reload();
void setImpact(Pos i);
private:
SoundBuffer shotgunSound, dryGunSound;
sf::Sound sound;
Pos impact;
/// nb of munitions per weapon
int amo[NbWeapon] = {0};
int weapon = Shotgun;
void shoot(Pos viewDir);
};
#endif // PLAYER_H