2016-03-25 16:47:20 -07:00
|
|
|
# Change Score By
|
|
|
|
|
|
|
|
The game library supports simple single-player time-based games. The player will ** add points to score**.
|
|
|
|
|
2016-06-01 21:19:16 -07:00
|
|
|
```blocks
|
2016-03-29 21:17:57 -07:00
|
|
|
input.onButtonPressed(Button.A, () => {
|
2016-03-25 16:47:20 -07:00
|
|
|
game.addScore(1)
|
|
|
|
})
|
|
|
|
game.startCountdown(10000)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Score
|
|
|
|
|
|
|
|
When a player achieves a goal, you can increase the game score
|
|
|
|
|
|
|
|
* add score points to the current score
|
|
|
|
|
|
|
|
```
|
|
|
|
export function addScore(points: number)
|
|
|
|
```
|
|
|
|
|
|
|
|
* get the current score value
|
|
|
|
|
|
|
|
```
|
|
|
|
export function score() : number
|
|
|
|
```
|
|
|
|
|
|
|
|
### Lessons
|
|
|
|
|
2016-04-13 08:27:45 -07:00
|
|
|
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
2016-03-25 16:47:20 -07:00
|
|
|
|