2016-03-25 16:47:20 -07:00
|
|
|
# Change Score By
|
|
|
|
|
2016-06-15 14:14:15 -07:00
|
|
|
Add the amount you say to the score for the game.
|
|
|
|
|
|
|
|
```sig
|
|
|
|
game.addScore(1)
|
|
|
|
```
|
2019-12-02 05:58:26 +01:00
|
|
|
## Parameters
|
2016-06-15 17:56:41 -07:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
* a [number](/types/number) that means how much to add to the score. A negative number means to subtract from the score.
|
2016-06-15 14:14:15 -07:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Examples
|
2016-06-15 14:14:15 -07:00
|
|
|
|
|
|
|
This program is a simple game.
|
|
|
|
Press button ``A`` as much as possible.
|
|
|
|
At the end of 10 seconds, the program will show your score.
|
2016-03-25 16:47:20 -07:00
|
|
|
|
2016-04-15 16:15:08 -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)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See Also
|
2016-03-25 16:47:20 -07:00
|
|
|
|
2016-06-15 14:14:15 -07:00
|
|
|
[score](/reference/game/score), [start countdown](/reference/game/start-countdown)
|