-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBasicEnemy.cpp
More file actions
38 lines (29 loc) · 847 Bytes
/
BasicEnemy.cpp
File metadata and controls
38 lines (29 loc) · 847 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
#include "Application.h"
#include "BasicEnemy.h"
#include "ModuleCollision.h"
#include "ModuleEnemies.h"
BasicEnemy::BasicEnemy(int x, int y, powerUpTypes type, SDL_Texture* thisTexture) : Enemy(x, y)
{
//links the correct spritesheet texture ----
enemyTex = thisTexture;
// -----------------------------------------
fly.PushBack({ 0,16,32,15 });
fly.PushBack({ 0,0,32,16 });
fly.PushBack({ 0,31,32,16 });
fly.PushBack({ 0,47,32,15 });
fly.PushBack({ 0,31,32,16 });
fly.PushBack({ 0,0,32,16 });
fly.speed = 0.2f;
animation = &fly; //links animation
original_y = y;
fposition.x = x;
powerUpType = type;
life = 1;
enemyScore = 100;
collider = App->collision->AddCollider({ 0, 0, 32, 16 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);
}
void BasicEnemy::Move()
{
fposition.x -= 1.35;
position.x = fposition.x;
}