-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnemigoAzul.cpp
46 lines (33 loc) · 1.27 KB
/
EnemigoAzul.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
#include "EnemigoAzul.h"
EnemigoAzul::EnemigoAzul(SDL_Renderer* renderer, list<Personaje*> *personajes)
{
vector<SDL_Texture*>*texturas = new vector<SDL_Texture*>();
vector<SDL_Texture*>*texturas_left = new vector<SDL_Texture*>();
texturas->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing/1.png"));
texturas->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing/2.png"));
texturas->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing/3.png"));
texturas->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing/4.png"));
texturas_left->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing_left/1.png"));
texturas_left->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing_left/2.png"));
texturas_left->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing_left/3.png"));
texturas_left->push_back(IMG_LoadTexture(renderer,"EnemigoAzul/standing_left/4.png"));
mapa_texturas["left"]=texturas_left;
mapa_texturas["right"]=texturas;
vector_actual_str = "right";
rect.x = 100;
rect.y = 250;
init(renderer,personajes);
}
EnemigoAzul::~EnemigoAzul()
{
//dtor
}
void EnemigoAzul::act()
{
rect.x++;
if(frame%100==0)
atacando = true;
else
atacando = false;
attackCheck();
}