Camera.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 of the screen?
  13. unsigned render_area_height;
  14. // Do you want to use classes for coordinates and allow them to have vector-based mathematics? With operator overriding that could be doable to have
  15. // Vector2 a(3, 2); Vector2 b(1, 2); Vector3 c = a+b;
  16. // Vector2 destination;
  17. // Vector2 velocity;
  18. // Vector2 acceleration;
  19. public:
  20. Camera(signed x, signed y);
  21. ~Camera();
  22. // This doesn't need any render as it's the utility which helps rendering. Unless you want to show debnug things.
  23. // void render(float dt) const;
  24. void update(unsigned dt);
  25. void set_x(signed x);
  26. signed get_x() const;
  27. void set_y(signed y);
  28. signed get_y() const;
  29. // Can you see me, senpai ? >.<
  30. bool is_visible(const WalrusRPG::Utils::Rect &object) const;
  31. };
  32. }
  33. #endif