-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tank.h
59 lines (39 loc) · 1 KB
/
Tank.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
#pragma once
namespace Tmpl8
{
enum allignments
{
BLUE,
RED
};
class Tank
{
public:
Tank(float pos_x, float pos_y, allignments allignment, Sprite* tank_sprite, Sprite* smoke_sprite, float tar_x, float tar_y, float collision_radius, int health, float max_speed);
~Tank();
void Tick();
vec2 Get_Position() const { return position; };
float Get_collision_radius() const { return collision_radius; };
bool Rocket_Reloaded() const { return reloaded; };
void Reload_Rocket();
void Deactivate();
bool hit(int hit_value);
void Draw(Surface* screen);
int CompareHealth(const Tank& other) const;
void Push(vec2 direction, float magnitude);
vec2 position;
vec2 speed;
vec2 target;
int health;
float collision_radius;
vec2 force;
float max_speed;
float reload_time;
bool reloaded;
bool active;
allignments allignment;
int current_frame;
Sprite* tank_sprite;
Sprite* smoke_sprite;
};
} // namespace Tmpl8