changed when the game stopped routine is being called, as it was called while the game was in ending state, which wasnt intended

This commit is contained in:
Patrick Tschuchnig 2019-09-11 11:40:53 +02:00
parent 7e67391678
commit b42813cf75

View File

@ -311,7 +311,7 @@ def enter_name():
if event.type == KEYDOWN: if event.type == KEYDOWN:
if event.key == pygame.K_BACKSPACE: if event.key == pygame.K_BACKSPACE:
name = name[:-1] name = name[:-1]
elif event.key == pygame.K_RETURN: elif event.key == pygame.K_RETURN and len(name) > 0:
clear_screen() clear_screen()
return name return name
else: else:
@ -421,7 +421,7 @@ while True:
handle_events() handle_events()
show_debug() show_debug()
if game_running == False: if game_running == False and game_ending == False:
if game_just_started == True: if game_just_started == True:
print("New game starting") print("New game starting")