9.8: A More Detailed Game State than Usual

Making Games with Python and Pygame · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 3.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    9.8: A More Detailed Game State than Usual
    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.


    This page titled 9.8: A More Detailed Game State than Usual was last modified on Mon, 18 May 2020 08:25:01 GMT and is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Al Sweigart via source content that was edited to the style and standards of the LibreTexts platform.