-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlien_Gold.cpp
84 lines (70 loc) · 1.12 KB
/
Alien_Gold.cpp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "Alien_Gold.h"
int Alien_Gold::num_aliens(0);
int Alien_Gold::points_(100);
Image Alien_Gold::image_("images/galaxian/GalaxianFlagship.gif");
/*
void Alien_Gold::build()
{
std::cout << "im here" << std::endl;
rect_.y = 100;
rect_.x = W / 2 - (rect_.w / 2);
}
*/
void Alien_Gold::draw()
{
if (alive_)
surface_.put_image(image_, rect_);
}
void Alien_Gold::move(int direction)
{
rect_.x += direction;
}
void Alien_Gold::alive(bool alive)
{
alive_ = alive;
}
bool Alien_Gold::alive() const
{
return alive_;
}
void Alien_Gold::x(int x)
{
//std::cout << "setting gold x: " << x << std::endl;
rect_.x = x;
}
int Alien_Gold::x() const
{
return rect_.x;
}
void Alien_Gold::y(int y)
{
rect_.y = y;
}
int Alien_Gold::y() const
{
return rect_.y;
}
void Alien_Gold::h(int h)
{
rect_.h = h;
}
int Alien_Gold::h() const
{
return rect_.h;
}
void Alien_Gold::w(int w)
{
rect_.w = w;
}
int Alien_Gold::w() const
{
return rect_.w;
}
int Alien_Gold::gun_x() const
{
return ((rect_.x + (rect_.x + rect_.w)) / 2);
}
int Alien_Gold::gun_y() const
{
return rect_.y;
}