From 8e101f8bfd995321ac08a16fea9a171b549a0ae4 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Sat, 17 Dec 2022 11:04:20 -0500 Subject: 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 --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') 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) { -- cgit v1.2.3-54-g00ecf