-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInimigo.cpp
More file actions
53 lines (41 loc) · 853 Bytes
/
Copy pathInimigo.cpp
File metadata and controls
53 lines (41 loc) · 853 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
42
43
44
45
46
47
48
49
50
51
52
53
#include "Inimigo.h"
#include "Jogo.h"
using namespace entidades;
using namespace personagens;
Inimigo::Inimigo(int vida,Vector2f t, Vector2f p, int id, int valor) : Personagem(vida, t, p, id) {
body->setPosition(p);
noChao = false;
dano = valor;
}
Inimigo::~Inimigo()
{
}
void personagens::Inimigo::move()
{
body->move(velocidade);
posicao.x += velocidade.x;
posicao.y += velocidade.y;
if(!noChao) {
gravidade();
}
id = 2;
noChao = false;
}
int Inimigo::getDano() {
return dano;
}
int Inimigo::getImune() {
return imune;
}
void Inimigo::setImune() {
imune = 100;
}
void Inimigo::removeVidas(int dano) {
numVidas -= dano;
body->setFillColor(Color(232, 124, 171));
if (numVidas <= 0) {
vivo = false;
body->setFillColor(Color::Transparent);
Jogo::addPontos(10);
}
}