-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpowerup.cpp
55 lines (40 loc) · 837 Bytes
/
powerup.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
#include "powerup.h"
PowerUp::PowerUp()
{
}
PowerUp::PowerUp(int x, int y, Animation * anim)
{
QRectF hitbox(x, y, constants::TILE_WIDTH/2, constants::TILE_HEIGHT/2);
QRectF posImage(x, y, constants::TILE_WIDTH/2, constants::TILE_HEIGHT/2);
setImagePos(posImage);
setHitbox(hitbox);
addAnimation(anim);
}
void PowerUp::update(Level * const level)
{
if(getIntangible() > 0) {
setIntangible((getIntangible()-1));
}
}
void PowerUp::collide(LivingEntity *e, Level * const l)
{
e->collide(this, l);
}
void PowerUp::collide(Player *p, Level * const l)
{
}
void PowerUp::collide(LuckyBlock * lb, Level * const l)
{
}
void PowerUp::endTurn()
{
}
void PowerUp::move(Level * const level, QRect limit)
{
}
void PowerUp::deathTimer()
{
if(getHealth() < 0){
setIsDead(true);
}
}