-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpowerup.cpp
More file actions
31 lines (28 loc) · 929 Bytes
/
powerup.cpp
File metadata and controls
31 lines (28 loc) · 929 Bytes
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
#include "powerup.h"
#include "collision.h"
namespace game {
PowerUp::PowerUp(const glm::vec3& position, GLuint texture, GLint num_elements,PUpType type) :
GameObject(position, texture, num_elements, true, 0.5) {
scale_ = POWERUP_SCALE;
type_ = type;
name_ = powerup;
}
void PowerUp::Update(double delta_time) {
GameObject::Update(delta_time);
}
bool PowerUp::ValidCollision(GameObject* other_game_object, double deltatime) {
switch (other_game_object->GetName()) {
case player:
return Collision::CircleCircleCollision(other_game_object, position_, radius_);
break;
}
}
bool PowerUp::HandleCollision(GameObject* other_game_object, double deltatime) {
switch (other_game_object->GetName()) {
case player:
dead_ = true;
return true;
}
return false;
}
}