Rewrote in simple language. Replaced screenshot. Added xrefs.

This commit is contained in:
Ron Hale-Evans 2016-06-15 15:58:35 -07:00
parent ace1ddb00b
commit d86f820a57

View File

@ -1,20 +1,24 @@
# Game Over # Game Over
The game library End the game and show the score.
The game library supports simple single-player time-based games. The game can end the game by calling the `game over` function ### Example
## Block Editor This program asks you to pick a button.
If you press button `A`, the program says `YOU WIN!`.
If you press button `B`, it shows an animation and ends the game.
You can end the game by calling the `game over ` function. In this example, if BBC micro:bit's answer to the question is GAME OVER, GAME OVER will be displayed to end the game. ```blocks
basic.showString("PICK A BUTTON");
![](/static/mb/game-library/game-over-0.png) input.onButtonPressed(Button.A, () => {
basic.showString("YOU WIN!");
## KindScript });
input.onButtonPressed(Button.B, () => {
You can end the game by calling the `game -> game over` function: game.gameOver();
});
```
game.gameOver()
``` ```
### See Also
[score](/reference/game/score),
[change score by](/reference/game/change-score-by), [start countdown](/reference/game/start-countdown)