diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 22:28:27 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 22:28:27 -0500 |
commit | 5931470800c43260f600303d1231dbaf586f26fc (patch) | |
tree | aaaa30ee6bae81c1badc8b70d2fbdce33a058d5a /src/camera_system.cpp | |
parent | 315ca2fb388f790791c9ce372cf44e00d51e0e7f (diff) | |
download | tanetane-5931470800c43260f600303d1231dbaf586f26fc.tar.gz tanetane-5931470800c43260f600303d1231dbaf586f26fc.tar.bz2 tanetane-5931470800c43260f600303d1231dbaf586f26fc.zip |
Map changing!
Also removed some dependencies on the Renderer. More changes need to be made. Fading to black before the change would be good. And making sure the characters are facing the right direction. Maybe that code shouldn't live in Game, either. Later we also want to combine the tilesets for these two maps (and any others that are on Tanetane).
Diffstat (limited to 'src/camera_system.cpp')
-rw-r--r-- | src/camera_system.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/camera_system.cpp b/src/camera_system.cpp index 4709d01..991d096 100644 --- a/src/camera_system.cpp +++ b/src/camera_system.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | #include "map.h" | 4 | #include "map.h" |
5 | 5 | ||
6 | void CameraSystem::tick(double dt) { | 6 | void CameraSystem::tick(double dt) { |
7 | if (!locked_) { | 7 | if (!locked_ && followingSprite_ != -1) { |
8 | const Sprite& follow = game_.getSprite(followingSprite_); | 8 | const Sprite& follow = game_.getSprite(followingSprite_); |
9 | const Map& map = game_.getMap(); | 9 | const Map& map = game_.getMap(); |
10 | vec2i mapBounds = map.getMapSize() * map.getTileSize(); | 10 | vec2i mapBounds = map.getMapSize() * map.getTileSize(); |
@@ -25,3 +25,7 @@ void CameraSystem::tick(double dt) { | |||
25 | } | 25 | } |
26 | } | 26 | } |
27 | } | 27 | } |
28 | |||
29 | void CameraSystem::clearSpriteCache() { | ||
30 | followingSprite_ = -1; | ||
31 | } | ||