Geschoss.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "GameObject.h"
  3. #include "Spieler.h"
  4. #define PFEIL_DAMAGE 100
  5. #define KUGEL_DAMAGE 100
  6. class Geschoss : public GameObject
  7. {
  8. private:
  9. float speed;
  10. Richtung richtung;
  11. Spieler *besitzer;
  12. GeschossTyp typ;
  13. int tunnelBenutzt;
  14. int umgelenkt;
  15. int geschosseGetroffen;
  16. int schalter;
  17. int id;
  18. public:
  19. Geschoss( int id, float speed, GeschossTyp typ, Richtung r, int x, int y, Spieler *besitzer );
  20. ~Geschoss();
  21. void invertDirection();
  22. void addUmlenkung();
  23. void addGeschossTreffer();
  24. void addTunnel();
  25. void addSchalter();
  26. void setSpeed( float speed );
  27. void setBesitzer( Spieler *besitzer );
  28. void setTyp( GeschossTyp typ );
  29. void setRichtung( Richtung r );
  30. void tick( double zeit );
  31. GeschossTyp getTyp() const;
  32. Spieler *zBesitzer() const;
  33. Spieler *getBesitzer() const;
  34. Richtung getRichtung() const;
  35. };
  36. // size: 150x150
  37. class FeuerballTreffer : public GameObject
  38. {
  39. private:
  40. int id;
  41. Spieler *besitzer;
  42. int count;
  43. float timeLeft;
  44. public:
  45. FeuerballTreffer( int id, int x, int y, Spieler *besitzer, int maxZeit );
  46. ~FeuerballTreffer();
  47. void tick( double zeit );
  48. bool isOver() const;
  49. bool makeDamage() const;
  50. Spieler *zVerursacher() const;
  51. };