Removed duplicate code.

This commit is contained in:
Storm Dragon 2019-11-30 19:26:13 -05:00
parent 911b37085e
commit 4607302e05
2 changed files with 1 additions and 18 deletions

View File

@ -72,23 +72,6 @@ def initialize_gui(gameTitle):
time.sleep(soundData['game-intro'].get_length()) time.sleep(soundData['game-intro'].get_length())
return soundData return soundData
def display_message(info):
info.append("Press escape or enter to continue.")
info.reverse()
info.append("Use the up and down arrow keys to navigate this message.")
info.reverse()
i = 0
speak(str(info[0:len(info)]))
while True:
event = pygame.event.wait()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
if event.key == pygame.K_DOWN and i < len(info) - 1: i = i + 1
if event.key == pygame.K_UP and i > 0: i = i - 1
speak(info[i])
event = pygame.event.clear()
time.sleep(0.001)
def instructions(): def instructions():
# Read in the instructions file # Read in the instructions file
try: try:

View File

@ -53,7 +53,7 @@ def game(mode):
message.append("Your time was " + str(int(endTime / 60)) + " minute and " + str(round(endTime % 60, 2)) + " seconds.") message.append("Your time was " + str(int(endTime / 60)) + " minute and " + str(round(endTime % 60, 2)) + " seconds.")
else: else:
message.append("Your time was " + str(int(endTime / 60)) + " minutes and " + str(round(endTime % 60, 2)) + " seconds.") message.append("Your time was " + str(int(endTime / 60)) + " minutes and " + str(round(endTime % 60, 2)) + " seconds.")
display_message(message) display_text(message)
sounds['win'].play() sounds['win'].play()
time.sleep(sounds['win'].get_length()) time.sleep(sounds['win'].get_length())
return "menu" return "menu"