Agora ele olha pra frente deitado
[Projeto-PCG.git] / thing.cpp
blobaf08cb2b50d8cc6aba4d5ec150aede3e6213c62f
1 #include "thing.h"
3 Thing::Thing() {
4 onGround = false;
5 maxspeed.x = 99999;
6 maxspeed.y = 99999;
7 gravityRate = 0.3;
8 dead = false;
11 void Thing::addSpeed(double xspeed, double yspeed) {
12 setSpeed(velocidade.x+xspeed,velocidade.y+yspeed);
15 void Thing::setSpeed(double xspeed, double yspeed) {
16 velocidade.x = std::max(std::min(xspeed,maxspeed.x),-maxspeed.x);
17 velocidade.y = std::max(std::min(yspeed,maxspeed.y),-maxspeed.y);
20 void Thing::setPosition(double x, double y) {
21 posicao.x = x;
22 posicao.y = y;
25 void Thing::move() {
26 posicao.x += velocidade.x;
27 posicao.y += velocidade.y;
30 Linha Thing::getBaseLine() {
31 Linha ret(0,0,0,0);
32 return ret;
35 Polygon Thing::getCollision() {
36 Polygon poly;
37 return poly;
40 void Thing::collide(Thing* b) {
41 return;
44 bool Thing::canCollide(Thing* b) {
45 return true;