Consertado "efeito metralhadora" que aparece num F7-spam
[Projeto-PCG.git] / player.cpp
blob81c4c976ff0d8e1b7df0fbf9ea9feb2e4c4c1a5b
1 #include "player.h"
2 #include "shot.h"
4 Player::Player(Game* agame, Ponto pos, Ponto speed): Shooter(agame, pos, speed) {
5 hp = 1000;
8 void Player::desenha() {
9 game->desenhaMira(aim);
10 Shooter::desenha();
13 void Player::collide(Thing *b) {
14 Shot* shot = dynamic_cast<Shot*>(b);
15 if (shot && shot->firedBy != this) {
16 shot->dead = true;
17 if (this->getPosition().x < shot->firedBy->getPosition().x)
18 addToAngle -= 0.5;
19 else
20 addToAngle += 0.5;
21 addToAngle = std::max(std::min(addToAngle, PI/2),-PI/2);