2019-12-02 05:58:26 +01:00
|
|
|
# is Running
|
|
|
|
|
|
|
|
Find out if the game is currently running or not.
|
|
|
|
|
|
|
|
```sig
|
|
|
|
game.isRunning()
|
|
|
|
```
|
|
|
|
|
|
|
|
## Returns
|
|
|
|
|
|
|
|
* a [boolean](/types/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.
|
|
|
|
|
|
|
|
```blocks
|
2022-04-26 19:28:42 +02:00
|
|
|
input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
|
2019-12-02 05:58:26 +01:00
|
|
|
if (game.isRunning()) {
|
|
|
|
game.gameOver()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
## See also
|
|
|
|
|
|
|
|
[is paused](/reference/game/is-paused),
|
|
|
|
[is game over](/reference/game/is-game-over)
|