Controller.h 671 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Created by jovian on 18/07/17.
  3. //
  4. #ifndef TINYSHOOTER_CONTROLLER_H
  5. #define TINYSHOOTER_CONTROLLER_H
  6. // todo Use HardContacts with scopes like Visuals in Renderer
  7. #include <box2d/box2d.h>
  8. class Controller {
  9. public:
  10. Controller();
  11. virtual void refresh() = 0; // Read input and modify behaviour
  12. bool isJumping() const;
  13. bool isFiring() const;
  14. bool isShielded() const;
  15. const b2Vec2 &getVisor() const;
  16. const b2Vec2 &getMove() const;
  17. float getZoomScale() const;
  18. protected:
  19. bool m_jump;
  20. bool m_firing;
  21. bool m_shield;
  22. b2Vec2 m_visor;
  23. b2Vec2 m_move;
  24. float m_zoomScale;
  25. };
  26. #endif //TINYSHOOTER_CONTROLLER_H