pxt-calliope/olddocs/lessons/game-counter.md
Tom Ball f4eca66648 move lessons out of web site
will move select lessons back to "educators" section
2016-06-14 11:49:58 -04:00

807 B

game counter lesson

Learn how to create a counter with with on button pressed.

Topic

Game Library

Prior learning/place of lesson in scheme of work

Learn how to create game blocks to keep track of the current score. We will be learning how to create a game using the blocks called add points to score, score as well as simple commands such as on button pressed and show number.

Documentation

game.addScore(1)
input.onButtonPressed(Button.A, () => {})
basic.showNumber(0)

Objectives

  • learn how arithmetic operators operate on numbers and return a number
  • learn how to run code when an input button is pressed
  • learn how to show a score on the LED screen