about summary refs log tree commit diff stats
path: root/data/maps/the_jubilant
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-09-08 16:14:41 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-09-08 16:14:41 -0400
commitede20b5e97b39af14b42974f00ebf1737f289ece (patch)
tree8d9097d1eb8f846a771c1e2e5a7d7fbcf40172b9 /data/maps/the_jubilant
parentd592b58af373c2c8e863ff0c744f23c26a26fa64 (diff)
downloadlingo2-archipelago-ede20b5e97b39af14b42974f00ebf1737f289ece.tar.gz
lingo2-archipelago-ede20b5e97b39af14b42974f00ebf1737f289ece.tar.bz2
lingo2-archipelago-ede20b5e97b39af14b42974f00ebf1737f289ece.zip
[Data] Tweak owl logic
Diffstat (limited to 'data/maps/the_jubilant')
0 files changed, 0 insertions, 0 deletions
a645524 ^





2491883 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

























                                                                        






                                                                       

                                

                                            
        


                                                   



                                             
                            
                      





                          


                                                           
#ifndef CAMERA_SYSTEM_H_D52ADAD3
#define CAMERA_SYSTEM_H_D52ADAD3

#include "consts.h"
#include "system.h"
#include "vector.h"

class Game;

class CameraSystem : public System {
public:

  static constexpr SystemKey Key = SystemKey::Camera;

  CameraSystem(Game& game) : game_(game) {}

  const vec2i& getCameraPosition() const { return pos_; }

  const vec2i& getFieldOfView() const { return fov_; }

  void setFollowingSprite(int spriteId) { followingSprite_ = spriteId; }

  void lockCamera() { locked_ = true; }

  void unlockCamera() { locked_ = false; }

  // Pans over to the provided sprite over the provided amount of time.
  // - length is in milliseconds
  // Automatically locks the camera.
  void panToSprite(int targetId, int length);

  bool isPanning() const { return panning_; }

  void tick(double dt) override;

  void destroySprite(int spriteId) override;

private:

  vec2i calculatePosWithCenter(vec2i center) const;

  Game& game_;

  vec2i pos_;
  vec2i fov_ { CANVAS_WIDTH, CANVAS_HEIGHT };
  int followingSprite_ = -1;
  bool locked_ = true;

  bool panning_ = false;
  vec2i panStart_;
  vec2i panEnd_;
  double panLength_ = 0.0;
  double panThus_ = 0.0;
};

#endif /* end of include guard: CAMERA_SYSTEM_H_D52ADAD3 */