-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntidade.cpp
More file actions
58 lines (47 loc) · 947 Bytes
/
Copy pathEntidade.cpp
File metadata and controls
58 lines (47 loc) · 947 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
54
55
56
57
58
#include "Entidade.h"
using namespace entidades;
Entidade::Entidade(Vector2f p, Vector2f t,int ID) : Ente(t) {
posicao = p;
id = ID;
}
Entidade::~Entidade() {
}
float Entidade::getX() const {
return posicao.x;
}
float Entidade::getY() const {
return posicao.y;
}
int Entidade::getId() const {
return id;
}
float Entidade::getVelocidadeX() {
return velocidade.x;
}
float Entidade::getVelocidadeY() {
return velocidade.y;
}
void Entidade::setX(int valor) {
posicao.x = valor;
}
void Entidade::setY(int valor) {
posicao.y = valor;
}
void Entidade::setPosicao(Vector2f p) {
posicao = p;
}
void Entidade::setVelocidadeX(float v) {
velocidade.x = v;
}
void Entidade::setVelocidadeY(float v) {
velocidade.y = v;
}
void Entidade::setVelocidade(Vector2f v) {
velocidade = v;
}
void Entidade::gravidade() {
velocidade.y += 0.001f;
}
bool Entidade::getVivo() {
return true;
}