-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathduck.h
47 lines (38 loc) · 862 Bytes
/
duck.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
#ifndef DUCK_H
#define DUCK_H
#include <cstdio>
#include <cstdlib>
#include "radian.h"
#include "polarcoord.h"
#include "player.h"
#include "math.h"
#include "SDL2/SDL.h"
#define ATTACK_DIST 6
typedef enum duckStatus_t {
alive,
killedByPlayer,
attackedPlayer,
dead,
} duckStatus;
class Duck {
public:
Polarcoord position;
int frame;
double speed;
int lastTick;
int moveCounter;
int frameCounter;
Duck(Radian, double);
Duck(Polarcoord);
bool isVisible(Player);
duckStatus status;
int getFrame();
void nextFrame();
void update();
void shot();
bool scoreAdded;
static bool compare_distance(const Duck& first, const Duck& second) {
return first.position.r < second.position.r;
}
};
#endif