Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • c22027697/group-project
1 result
Show changes
Commits on Source (2)
...@@ -372,8 +372,8 @@ def main(): ...@@ -372,8 +372,8 @@ def main():
# Main game loop # Main game loop
while True: while True:
current_time = datetime.now() current_time = datetime.now()
time_taken = current_time - start_time time_used = current_time - start_time
time_left = 1200 - time_taken.total_seconds() time_left = 1200 - time_used.total_seconds()
if time_penalty: if time_penalty:
time_left = time_left - 300 time_left = time_left - 300
if time_left < 0: if time_left < 0:
...@@ -397,8 +397,12 @@ def main(): ...@@ -397,8 +397,12 @@ def main():
gas_starttime = datetime.now() gas_starttime = datetime.now()
location_entrance["entered"] = True location_entrance["entered"] = True
if trap_door["open"]: 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()
print("(game ending)")
break break
print_room(current_room) print_room(current_room)
......
...@@ -37,7 +37,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r ...@@ -37,7 +37,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
time = [round(minutes), round(seconds)] time = [round(minutes), round(seconds)]
print("Congrats, enter your name on the leaderboard!") 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('Well done! '+name)
print(f'You escaped in {time[0]} minutes and {time[1]} seconds') 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 ...@@ -65,7 +65,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
file.close() file.close()
print("Input 'Yes' or 'No'") 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() userinput = userinput.lower()
if userinput == 'yes': if userinput == 'yes':
view_leaderboard(filename) view_leaderboard(filename)
......
...@@ -9,7 +9,6 @@ import time ...@@ -9,7 +9,6 @@ import time
def drink_wine(): def drink_wine():
# need to add time deduction
counter = 0 counter = 0
x = "" x = ""
while counter < 3: while counter < 3:
...@@ -56,8 +55,6 @@ def drink_wine(): ...@@ -56,8 +55,6 @@ def drink_wine():
counter += 1 counter += 1
time.sleep(4) time.sleep(4)
x = 3 x = 3
# time_taken = time_taken - 360
# remove wine from inventory
return x return x
......