forked from knela96/XMultiply-Arcade-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemy_BossS4.cpp
More file actions
41 lines (31 loc) · 872 Bytes
/
Enemy_BossS4.cpp
File metadata and controls
41 lines (31 loc) · 872 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
32
33
34
35
36
37
38
39
40
41
#include "Application.h"
#include "Enemy_BossS4.h"
#include "ModuleCollision.h"
#include "ModuleParticles.h"
#include "ModuleSceneStage4.h"
#include "SDL/include/SDL_timer.h"
#include "ModuleSceneStage4.h"
Enemy_BossS4::Enemy_BossS4(int x, int y) : Enemy(x, y)
{
fly.PushBack({ 14,35,145,104});
fly.PushBack({ 14,140,145,104 });
fly.PushBack({ 14,253,145,104 });
fly.speed = 0.0f;
animation = &fly;
collider = App->collision->AddCollider({ 50, 50, 145, 150 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);
original_position.x = x;
original_position.y = y;
}
void Enemy_BossS4::Move()
{
if (App->scene_stage4->lifes_Boss > 30) {
animation->setFrame(0);
}
else if (App->scene_stage4->lifes_Boss > 20) {
animation->setFrame(1);
}
else {
animation->setFrame(2);
}
position = original_position + path->GetCurrentPosition(&animation);
}