From 9dcb86f9f993405aff2b8ac6930d2b89fca0920a Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sun, 15 Jan 2023 19:06:02 -0500 Subject: [PATCH] Fix global var bug --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 5c3b81a..69a3136 100644 --- a/main.py +++ b/main.py @@ -123,7 +123,7 @@ def interact_with_student(): # Main game loop def play_game(): - global player_hunger, player_health, player_inventory + global player_name, player_hunger, player_health, player_inventory # Introduction sprint("Welcome to Next Dining: The Video Game!") sprint("What is your name?") @@ -151,12 +151,12 @@ def play_game(): display_status() else: sprint("Invalid action. Please try again.") - + # Hunger and health decrement player_hunger += 5 if chef_angry: player_health -= 10 - + # Check for game over if player_health <= 0: sprint("Your health has reached zero. Game over.")