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