Update SUMMARY with current reference APIs. (#507)
This commit is contained in:
committed by
Peli de Halleux
parent
bed48e3893
commit
17886f3365
30
docs/reference/game/add-score.md
Normal file
30
docs/reference/game/add-score.md
Normal file
@ -0,0 +1,30 @@
|
||||
# add Score
|
||||
|
||||
Add more to the current score for the game.
|
||||
|
||||
```sig
|
||||
game.addScore(1)
|
||||
```
|
||||
### Parameters
|
||||
|
||||
* a [number](/types/number) that means how much to add to the score. A negative number means to subtract from the score.
|
||||
|
||||
### Examples
|
||||
|
||||
This program is a simple game.
|
||||
Press button ``A`` as much as possible to increase the score.
|
||||
Press ``B`` to display the score and reset the score.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
basic.showNumber(game.score())
|
||||
game.setScore(0)
|
||||
})
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
game.addScore(1)
|
||||
})
|
||||
```
|
||||
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score), [set score](/reference/game/set-score), [start countdown](/reference/game/start-countdown)
|
Reference in New Issue
Block a user