GameObject.h 655 B

1234567891011121314151617181920212223242526272829303132333435
  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. Richtung getRichtungFromString( Text str );
  13. class GameObject : public Variable
  14. {
  15. protected:
  16. float x, y, w, h;
  17. public:
  18. GameObject( VariableTyp typ, int x, int y, int width, int height );
  19. void setX( float x );
  20. void setY( float y );
  21. void setWidth( float width );
  22. void setHeight( float height );
  23. bool intersectsWith( GameObject *zObj );
  24. float getX() const;
  25. float getY() const;
  26. float getWidth() const;
  27. float getHeight() const;
  28. float abstandZu( GameObject *zObj );
  29. };