expose game.setScore in blocks

fix for https://github.com/Microsoft/pxt/issues/881
This commit is contained in:
Peli de Halleux
2016-12-08 08:51:18 -08:00
parent 66d3c6c7e8
commit 14f16f9b2c
3 changed files with 4 additions and 2 deletions

View File

@ -146,8 +146,9 @@ namespace game {
/**
* Sets the current score value
* @param value TODO
* @param value new score value.
*/
//% blockId=game_set_score block="set score %points" blockGap=8
//% weight=10 help=game/set-score
export function setScore(value: number): void {
_score = Math.max(0, value);