Camera.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef INCLUDE_CAMERA_H
  2. #define INCLUDE_CAMERA_H
  3. #include "Rect.h"
  4. namespace WalrusRPG
  5. {
  6. class Camera
  7. {
  8. protected:
  9. // So, how will track camera's position? Top left or center?
  10. signed x; // You'll probably want to switch over signed coordonates.
  11. signed y;
  12. unsigned render_area_width; // What if you only want to display the map on a part
  13. // of the screen?
  14. unsigned render_area_height;
  15. // Do you want to use classes for coordinates and allow them to have vector-based
  16. // mathematics? With operator overriding that could be doable to have
  17. // Vector2 a(3, 2); Vector2 b(1, 2); Vector3 c = a+b;
  18. // Vector2 destination;
  19. // Vector2 velocity;
  20. // Vector2 acceleration;
  21. public:
  22. Camera(signed x, signed y);
  23. ~Camera();
  24. // This doesn't need any render as it's the utility which helps rendering. Unless
  25. // you want to show debnug things.
  26. // void render(float dt) const;
  27. void update(unsigned dt);
  28. void set_x(signed x);
  29. signed get_x() const;
  30. void set_y(signed y);
  31. signed get_y() const;
  32. // Can you see me, senpai ? >.<
  33. bool is_visible(const WalrusRPG::Utils::Rect &object) const;
  34. };
  35. }
  36. #endif