diff options
author | Steph Enders <smenders@gmail.com> | 2022-12-17 11:04:20 -0500 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-12-17 11:04:20 -0500 |
commit | 8e101f8bfd995321ac08a16fea9a171b549a0ae4 (patch) | |
tree | 61c25c357c24381e653f2dd104463628fe2875e7 /src/main.cpp | |
parent | f710faa0cc8862a8367dbbf89bf8c3cd44790b5d (diff) |
Support doors with keys
Add initial support for doors and keys via pre-defined mappings:
k || d
------
1 -> a
2 -> b
3 -> c
4 -> d
Any key can open any door of its mapping, but is spent once used.
May require additional testing
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 38208ec..796c3f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -238,9 +238,14 @@ int main(int argc, char **argv) { window.draw(enemy.sprite); } for (auto &treasure : lvl->treasurePositions) { - treasure.sprite.setPosition(to_position(treasure)); window.draw(treasure.sprite); } + for (auto &key : lvl->keyPositions) { + window.draw(key.sprite); + } + for (auto &door : lvl->doorPositions) { + window.draw(door.sprite); + } } if (scene != Scene::LOSS) { |