GameObject.h 610 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "Variablen.h"
  3. enum Richtung
  4. {
  5. OBEN,
  6. RECHTS,
  7. UNTEN,
  8. LINKS,
  9. MITTE
  10. };
  11. Richtung invert( Richtung r );
  12. class GameObject : public Variable
  13. {
  14. protected:
  15. float x, y, w, h;
  16. public:
  17. GameObject( VariableTyp typ, int x, int y, int width, int height );
  18. void setX( float x );
  19. void setY( float y );
  20. void setWidth( float width );
  21. void setHeight( float height );
  22. bool intersectsWith( GameObject *zObj );
  23. float getX() const;
  24. float getY() const;
  25. float getWidth() const;
  26. float getHeight() const;
  27. float abstandZu( GameObject *zObj );
  28. };