4 #include "shotmanager.h"
11 Shot::Shot(double x
, double y
, double angle
, double speed
, double gravity
, Weapon
* w
) {
16 game
->gravityManager
->subscribe(this);
17 game
->collisionManager
->subscribe(this);
18 gravityRate
= gravity
;
20 setSpeed(-cos(angle
)*speed
,sin(angle
)*speed
);
24 game
->shotManager
->deleteShot(this);
25 game
->collisionManager
->remove(this);
26 if (gravityRate
!= 0.0)
27 game
->gravityManager
->deleteThing(this);
30 void Shot::desenha() {
32 glTranslatef(getX(),getY(),0);
37 Polygon
Shot::getCollision() {
38 Polygon collisionSprite
= sprite
;
39 return collisionSprite
;
42 void Shot::collide(Thing
* b
){
44 /*Player* p = dynamic_cast<Player*>(b);
46 Enemy* e = dynamic_cast<Enemy*>(b);
47 std::cout<<b<<std::endl;