Controller.h 726 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 isBoosting() const;
  13. bool isFiring() const;
  14. bool isShielded() const;
  15. const b2Vec2 &getVisor() const;
  16. float getAcceleration() const;
  17. float getTorque() const;
  18. float getZoomScale() const;
  19. protected:
  20. bool m_boost;
  21. bool m_firing;
  22. bool m_shield;
  23. b2Vec2 m_visor;
  24. float m_acceleration;
  25. float m_torque;
  26. float m_zoomScale;
  27. };
  28. #endif //TINYSHOOTER_CONTROLLER_H