-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPowerupOrange.cpp
34 lines (26 loc) · 938 Bytes
/
PowerupOrange.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
#include "PowerupOrange.h"
#include "Application.h"
#include "ModuleCollisions.h"
#include "ModuleParticles.h"
#include "ModulePlayer.h"
PowerupOrange::PowerupOrange(int x, int y) : Weapon(x, y)
{
animPowerOrange.PushBack({ 497, 0, 15, 15 });
animPowerOrange.PushBack({ 497, 30, 15, 15 });
animPowerOrange.speed = 0.07f;
pathOrange.PushBack({ 0.5f, 0.8f }, 70, &animPowerOrange);
pathOrange.PushBack({ 0.5f, -0.8f }, 70, &animPowerOrange);
collider = App->collisions->AddCollider({ position.x, position.y, 15, 15 }, Collider::Type::POWERUP_ORANGE, (Module*)App->weapons);
}
void PowerupOrange::Update()
{
pathOrange.Update();
position = spawnPos + pathOrange.GetRelativePosition();
currentAnim = pathOrange.GetCurrentAnimation();
// Call to the base class. It must be called at the end
// It will update the collider depending on the position
Weapon::Update();
}
void PowerupOrange::OnCollision(Collider* collider)
{
}