Skip to content

Commit

Permalink
v1.1 comments + doc + general integer game state codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Jul 5, 2021
1 parent 6e4a9b7 commit 15c83e4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ def main(stdscr):
menu()
elif game_state == PLAY:
new_score, new_game_state, new_debug_msg = play(c, snake, apples, game_score)
if new_score:
game_score = new_score
if new_game_state:
game_state = new_game_state
if new_debug_msg:
game_debug_msg = new_debug_msg
game_score = new_score if new_score else game_score
game_state = new_game_state if new_game_state else game_state
game_debug_msg = new_debug_msg if new_debug_msg else game_debug_msg

# blit all the objects on the screen.
blit(stdscr, borders, snake, apples, game_score, game_state, game_debug_msg, fps)
Expand Down

0 comments on commit 15c83e4

Please sign in to comment.