From f17020554d9475844fcc26b2642b251358613e46 Mon Sep 17 00:00:00 2001 From: Morgan Diment <dimentm@cardiff.ac.uk> Date: Tue, 25 Oct 2022 22:07:49 +0100 Subject: [PATCH] working on trapdoor --- Group_game/game.py | 4 ++++ Group_game/level_2.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Group_game/game.py b/Group_game/game.py index 15cfca4..074a00b 100644 --- a/Group_game/game.py +++ b/Group_game/game.py @@ -130,6 +130,8 @@ def print_menu(exits, room_items, inv_items): time.sleep(0.2) if current_room==trap_door and item_batteries in inventory: print("USE BATTERIES for LOCK to place the batteries in the electrical lock") + if current_room==trap_door and item_lock["batteries"] == True: + print("OPEN TRAP DOOR to open the trap door and exit out of it") print("What do you want to do?") @@ -263,6 +265,8 @@ def execute_command(command): open_diary(current_room["items"]) elif command[1] == "safe": open_safe(current_room["items"]) + elif command[1] == "trap door": + open_trapdoor() else: print("open what?") diff --git a/Group_game/level_2.py b/Group_game/level_2.py index ffca428..cda677b 100644 --- a/Group_game/level_2.py +++ b/Group_game/level_2.py @@ -62,7 +62,7 @@ def close_valve(): def open_trapdoor(): if current_room == trap_door: if item_lock["batteries"]: - if item_keycard in inventory: + if key_card in inventory: trap_door["open"] = True else: print("You need a key card to open the lock") -- GitLab