diff --git a/Group_game/game.py b/Group_game/game.py index 0e166f222945a8b2d0fe5845798204573e37d0d7..ddd7bcc8e8b80076d5e2c2790fbe9c2491d47cd9 100644 --- a/Group_game/game.py +++ b/Group_game/game.py @@ -371,8 +371,8 @@ def main(): # Main game loop while True: current_time = datetime.now() - time_taken = current_time - start_time - time_left = 1200 - time_taken.total_seconds() + time_used = current_time - start_time + time_left = 1200 - time_used.total_seconds() if time_penalty: time_left = time_left - 300 if time_left < 0: @@ -394,8 +394,12 @@ def main(): gas_starttime = datetime.now() location_entrance["entered"] = True if trap_door["open"]: + minutes = time_taken()[0] + seconds = time_taken()[1] + print() + print("WELL DONE! You have completed the escape room.") + print('You took', minutes, 'minutes and', seconds, 'seconds.') print() - print("(game ending)") break print_room(current_room) diff --git a/Group_game/leaderboard.py b/Group_game/leaderboard.py index 8169c0e8b0d8eba9c2eb9c04fb4b558f8379b14e..638b0c3bc7f04c04de2ae50197d393e327d16c90 100644 --- a/Group_game/leaderboard.py +++ b/Group_game/leaderboard.py @@ -37,7 +37,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r time = [round(minutes), round(seconds)] print("Congrats, enter your name on the leaderboard!") - name = input("What's your name? :") + name = input("What's your name? : ") print('Well done! '+name) print(f'You escaped in {time[0]} minutes and {time[1]} seconds') @@ -65,7 +65,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r file.close() print("Input 'Yes' or 'No'") - userinput = input("Would you live to view the leaderboard? :") + userinput = input("Would you live to view the leaderboard? : ") userinput = userinput.lower() if userinput == 'yes': view_leaderboard(filename) diff --git a/Group_game/level_2.py b/Group_game/level_2.py index 982dcf0521a42aebbda1720e87dc482ce8fdb0c6..c28b77d4358d8925b45c09aafbfccf25c42a8632 100644 --- a/Group_game/level_2.py +++ b/Group_game/level_2.py @@ -9,7 +9,6 @@ import time def drink_wine(): - # need to add time deduction counter = 0 x = "" while counter < 3: @@ -46,8 +45,6 @@ def drink_wine(): counter += 1 time.sleep(4) x = 3 - # time_taken = time_taken - 360 - # remove wine from inventory return x