Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 578 Bytes

game-over.md

File metadata and controls

28 lines (21 loc) · 578 Bytes

Game Over

End the game and show the score.

game.gameOver();

Example

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.

basic.showString("PICK A BUTTON");
input.onButtonPressed(Button.A, () => {
    basic.showString("YOU WIN!");
});
input.onButtonPressed(Button.B, () => {
    game.gameOver();
});

See Also

score, add score, start countdown