From d86f820a57defd48ab8dba1d530962f0c07952ea Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Wed, 15 Jun 2016 15:58:35 -0700 Subject: [PATCH] Rewrote in simple language. Replaced screenshot. Added xrefs. --- docs/reference/game/game-over.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/reference/game/game-over.md b/docs/reference/game/game-over.md index 17425b22..2664c09a 100644 --- a/docs/reference/game/game-over.md +++ b/docs/reference/game/game-over.md @@ -1,20 +1,24 @@ # 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. - -![](/static/mb/game-library/game-over-0.png) - -## KindScript - -You can end the game by calling the `game -> game over` function: - -``` -game.gameOver() +```blocks +basic.showString("PICK A BUTTON"); +input.onButtonPressed(Button.A, () => { + basic.showString("YOU WIN!"); +}); +input.onButtonPressed(Button.B, () => { + game.gameOver(); +}); ``` +### See Also + +[score](/reference/game/score), +[change score by](/reference/game/change-score-by), [start countdown](/reference/game/start-countdown)