Bullet.h 617 B

12345678910111213141516171819202122232425262728
  1. //
  2. // Created by jovian on 18/07/17.
  3. //
  4. #ifndef TINYSHOOTER_BULLET_H
  5. #define TINYSHOOTER_BULLET_H
  6. #include "Entity.h"
  7. class Bullet : public Entity {
  8. public :
  9. Bullet(const b2Vec2 &pos, b2World* physics, const b2Vec2 &dir, const b2Vec2 &speed, unsigned int camp);
  10. void update() override;
  11. int getDamage() const;
  12. protected:
  13. float m_damageScale; // Damage multiplier on impact
  14. unsigned int m_timeLife; // Number of ticks before dying
  15. unsigned int m_camp; // The camp of the shooter
  16. const float m_aero;
  17. b2Vec2 m_dir; // The direction of the missile
  18. };
  19. #endif //TINYSHOOTER_BULLET_H