Opening the book…
# Check if we should turn off invulnerability
if invulnerableMode and time.time() - invulnerableStartTime > INVULNTIME:
invulnerableMode = False
When the player gets hit by an enemy squirrel and does not die, we make the player invulnerable for a couple seconds (since the INVULNTIME constant is set to 2). During this time, the player’s squirrel flashes and the won’t take any damage from other squirrels. If the "invulnerability mode" time is over, line 3 [134] will set invulnerableMode to False.
This page titled 9.15: Checking to Disable Invulnerability was last modified on Mon, 18 May 2020 08:25:02 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.
The book could not be loaded just now.