Bullet.hpp 769 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <SFML/Graphics.hpp>
  3. using namespace sf;
  4. class Map;
  5. class Player;
  6. class Bullet: public RectangleShape
  7. {
  8. public:
  9. Bullet(Vector2f position, float angle, int strength);
  10. void registerMap(Map* map);
  11. void registerSelf(Player* player);
  12. void update(float delta);
  13. bool isDead() const;
  14. bool isExplosive() const;
  15. void setColor(Color color);
  16. void madeByPlayer();
  17. protected:
  18. bool _explosive;
  19. float _speed;
  20. private:
  21. Map* _map;
  22. Player* _self;
  23. bool _dead;
  24. int _strength;
  25. bool _madeByPlayer;
  26. };
  27. class RectBullet: public Bullet
  28. {
  29. public:
  30. RectBullet(Vector2f position, float angle, int strength);
  31. };
  32. class NukeBullet: public Bullet
  33. {
  34. public:
  35. NukeBullet(Vector2f position, float angle, int strength);
  36. private:
  37. Texture _badlyAllocatedTexture;
  38. };