pxt-calliope/docs/lessons/game-counter.md

31 lines
807 B
Markdown
Raw Normal View History

2016-03-25 16:47:20 -07:00
# game counter lesson
2016-04-01 16:22:47 -07:00
Learn how to create a counter with with on button pressed.
2016-03-25 16:47:20 -07:00
## Topic
Game Library
## Quick Links
2016-04-13 08:27:45 -07:00
* [activity](/lessons/game-counter/activity)
* [challenges](/lessons/game-counter/challenges)
2016-03-25 16:47:20 -07:00
## 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
2016-04-04 22:33:13 -07:00
```cards
2016-03-29 15:59:00 -07:00
game.addScore(1)
2016-04-04 22:33:13 -07:00
input.onButtonPressed(Button.A, () => {})
2016-03-29 15:59:00 -07:00
basic.showNumber(0)
```
2016-03-25 16:47:20 -07:00
2016-03-29 15:59:00 -07:00
## Objectives
2016-03-25 16:47:20 -07:00
2016-03-29 15:59:00 -07:00
* 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