-
Notifications
You must be signed in to change notification settings - Fork 1
/
powerupLightning.cpp
76 lines (66 loc) · 1.06 KB
/
powerupLightning.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
#include "powerupLightning.h"
#include "powerup.h"
#include <iostream>
#include <QRect>
#include <QImage>
powerupLightning::powerupLightning(): Powerup()
{
x = rand() % 450;
y = rand() % 550;
image.load("Lightning.png");
rect = image.rect();
resetState();
}
powerupLightning::~powerupLightning()
{
//std::cout << ("powerupLightning deleted\n");
}
void powerupLightning::appear()
{
x = rand() % 450;
y = rand() % 550;
rect.moveTo(x,y);
}
void powerupLightning::setActive(bool a) //is or is not active
{
active = a;
}
bool powerupLightning::isActive()
{
return active;
}
/*void powerupLightning::useAbility()
{
rect.moveTo(x,y);
}*/
void powerupLightning::resetState()
{
rect.moveTo(x,y);
active = false;
appeared = false;
count = 0;
}
void powerupLightning::setX(int X)
{
x = X;
}
void powerupLightning::setY(int Y)
{
y = Y;
}
void powerupLightning::setAppeared(bool a)
{
appeared = a;
}
bool powerupLightning::hasAppeared()
{
return appeared;
}
QRect powerupLightning::getRect()
{
return rect;
}
QImage & powerupLightning::getImage()
{
return image;
}