Skip to main content
Engineering LibreTexts

9.8: A More Detailed Game State than Usual

  • Page ID
  • def runGame():
        # set up variables for the start of a new game
        invulnerableMode = False  # if the player is invulnerable
        invulnerableStartTime = 0 # time the player became invulnerable
        gameOverMode = False      # if the player has lost
        gameOverStartTime = 0     # time the player lost
        winMode = False           # if the player has won

    The Squirrel Eat Squirrel game has quite a few variables that track the game state. These variables will be explained in more detail later when they are used in the code.

    • Was this article helpful?