Inimigos e players afetados pelos tiros
[Projeto-PCG.git] / player.cpp
blob8cffb5a733668c4bd4ad41aec4036447e9181f3c
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 #include <iostream>
15 void Player::collide(Thing *b) {
16 Shot* shot = dynamic_cast<Shot*>(b);
17 if (shot) {
18 shot->dead = true;
19 if (this->getPosition().x < shot->firedBy->getPosition().x)
20 addToAngle -= 0.5;
21 else
22 addToAngle += 0.5;
23 std::cout<<"I have been shot"<<std::endl;