pxt-calliope/docs/reference/game/is-running.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

504 B

is Running

Find out if the game is currently running or not.

game.isRunning()

Returns

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

Example

If the game is currently running, end the game if button B is pressed.

input.onButtonPressed(Button.B, function () {
	if (game.isRunning()) {
        game.gameOver()
    }
})

See also

is paused, is game over