pxt-calliope/docs/reference/game/start-countdown.md
2020-02-20 04:01:37 +01:00

629 B

Start Countdown

Start counting down time from the number of milliseconds you say.

game.startCountdown(1000)

Parameters

  • ms is a number that says how many milliseconds to count down (one second is 1000 milliseconds)

Examples

This program is a simple game. Press button A as much as possible. At the end of 10 seconds, the program will show your score.

input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
    game.addScore(1)
})
game.startCountdown(10000)

See Also

score, add score