Flamethrower decente ateh
[Projeto-PCG.git] / thing.cpp
blob2d0b941697e7f4ffab7b4fecda3873860c2ea396
1 #include "thing.h"
3 Thing::Thing() {
4 onGround = false;
5 maxspeed.x = 99999;
6 maxspeed.y = 99999;
7 gravityRate = 0.3;
10 void Thing::addSpeed(double xspeed, double yspeed) {
11 setSpeed(velocidade.x+xspeed,velocidade.y+yspeed);
14 void Thing::setSpeed(double xspeed, double yspeed) {
15 velocidade.x = std::max(std::min(xspeed,maxspeed.x),-maxspeed.x);
16 velocidade.y = std::max(std::min(yspeed,maxspeed.y),-maxspeed.y);
19 void Thing::setPosition(double x, double y) {
20 posicao.x = x;
21 posicao.y = y;
24 void Thing::move() {
25 posicao.x += velocidade.x;
26 posicao.y += velocidade.y;
29 Linha Thing::getBaseLine() {
30 Linha ret(0,0,0,0);
31 return ret;