pxt-calliope/docs/reference/game/is-game-over.md
Galen Nickel 55e5125449
Add game state boolean ref docs (#1694)
* Add game state boolean doc refs

* Add check for _img validity

* JS guru tricks
2018-12-02 20:11:17 -08:00

443 B

is Game Over

Find out if the game is over or not.

game.isGameOver()

Returns

  • a boolean value that is true if the game is over or false if not.

Example

Be kind and give the player some points for trying.

if (game.isGameOver() && game.score() < 10) {
    game.addScore(10 - game.score())
}

See also

is running, is paused