-
Notifications
You must be signed in to change notification settings - Fork 1
/
Enemy_PowerupShip.cpp
55 lines (45 loc) · 1.45 KB
/
Enemy_PowerupShip.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 "Application.h"
#include "Enemy_PowerupShip.h"
#include "ModuleCollision.h"
#include "ModuleParticles.h"
#include "ModuleRender.h"
#include "ModulePowerUp.h"
Enemy_PowerupShip::Enemy_PowerupShip(int x, int y, uint PU) : Enemy(x, y)
{
score = 1000;
fly.PushBack({ 68, 11,28,18 });
fly.PushBack({ 68, 11,28,18 });
fly.speed = 0.05f;
animation = &fly;
path->PushBack({ -1 , 0 }, 2, &fly);
collider = App->collision->AddCollider({ 0, 0, 30, 20 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);
original_position.x = x;
original_position.y = y;
switch (PU)
{
case 1:
p = App->powerup->AddPowerUp(App->powerup->tentacles_powerup, position.x + 2, position.y + 10, COLLIDER_POWERUP);
break;
case 2:
p = App->powerup->AddPowerUp(App->powerup->bomb_powerup, position.x + 2, position.y + 10, COLLIDER_POWERUP);
break;
case 3:
p= App->powerup->AddPowerUp(App->powerup->speed_powerup, position.x + 2, position.y + 10, COLLIDER_POWERUP);
break;
case 4:
p = App->powerup->AddPowerUp(App->powerup->YellowShells, position.x + 2, position.y + 10, COLLIDER_POWERUP);
break;
case 5:
p = App->powerup->AddPowerUp(App->powerup->Missile, position.x + 2, position.y + 10, COLLIDER_POWERUP);
break;
}
}
void Enemy_PowerupShip::Move()
{
//position = original_position + path->GetCurrentPosition(&animation);
position.x = position.x -0.7f;
}
void Enemy_PowerupShip::OnCollision(Collider* collider)
{
if (p != nullptr)p->enabled = true;
}