From 78dae183e53259122e5f5189985a8475c1506735 Mon Sep 17 00:00:00 2001 From: Ahmed Yusuf <yusufa7@cardiff.ac.uk> Date: Wed, 26 Oct 2022 15:17:23 +0100 Subject: [PATCH] few changes --- Group_game/game.py | 5 ++++- Group_game/player.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Group_game/game.py b/Group_game/game.py index 0e166f2..f3ae015 100644 --- a/Group_game/game.py +++ b/Group_game/game.py @@ -16,6 +16,7 @@ global current_level gas_starttime = "" time_penalty = False + def list_of_items(items): time.sleep(0.1) new_list = "" @@ -381,7 +382,9 @@ def main(): if location_boileroom["valve_open"]: gastime = current_time - gas_starttime gastime_left = 180 - gastime.total_seconds() - if gastime_left < 0: + if time_penalty: + gastime_left = gastime_left - 300 + if gastime_left <= 0: print("OH NO! The floor was filled with gas and you died") break # Display game status (room description, inventory etc.) diff --git a/Group_game/player.py b/Group_game/player.py index 51d2708..e234b6c 100644 --- a/Group_game/player.py +++ b/Group_game/player.py @@ -1,7 +1,7 @@ from items import * from map import * -inventory = [item_key] +inventory = [] # Start game at the centre current_room = locations["centre"] -- GitLab