-
Notifications
You must be signed in to change notification settings - Fork 0
/
Laser.h
60 lines (48 loc) · 949 Bytes
/
Laser.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
#ifndef LASER_H
#define LASER_H
#include "Includes.h"
#include "Player.h"
class Laser
{
public:
Laser(Surface & surface, int x = 0, int y = 0, int h = 10, int w = 1,
bool alive = false, bool player = false, int r = 250, int g = 150, int b = 0)
:surface_(surface), x_(x), y_(y), h_(h), w_(h), r_(r), g_(g), b_(b),
alive_(alive), player_(player)
{}
void draw();
void move();
void build(int x, int y);
void alive(bool alive)
{
alive_ = alive;
}
bool alive() const
{
return alive_;
}
void player(bool player)
{
player_ = player;
}
bool player() const
{
return player_;
}
int x() const
{
return x_;
}
int y() const
{
return y_;
}
private:
Surface & surface_;
int x_, y_, h_, w_;
int r_, g_, b_;
bool alive_;
bool player_;
static Sound sound;
};
#endif