GameObject.h 511 B

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