We're going to build a game to see how many times we can click the 'A' button before time's up!
Add a ||info.startCountdown(10)||
block to the onStart block to begin the countdown as soon as the game loads.
info.startCountdown(10)
})
Now add a block to sense when the 'A' button is pushed.
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
})
Finally, add a ||info.changeScoreBy(1)||
block to the event block to change the score by 1 each time the 'A' button is pushed.
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
info.changeScoreBy(1)
})
That's it! Now you're ready to run the program on the emulator to the left.