Fixing parameters

This commit is contained in:
Ron Hale-Evans 2016-07-18 14:23:05 -07:00
parent 4941ce1694
commit 2c09b7794f
5 changed files with 72 additions and 4 deletions

View File

@ -2,6 +2,10 @@
End the game and show the score. End the game and show the score.
```sig
game.gameOver();
```
### Example ### Example
This program asks you to pick a button. This program asks you to pick a button.

View File

@ -0,0 +1,54 @@
### 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
```
### 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)
```
* set the current score to a particular value.
```
export function setScore(value: number)
```
* get the current score value
```
export function score() : number
```
### Countdown
If your game has a time limit, you can start a countdown in which case `game->current time` returns the remaining time.
* start a countdown with the maximum duration of the game in milliseconds.
```
export function startCountdown(ms: number)
```

View File

@ -2,9 +2,14 @@
Move the sprite the number of LEDs you say. Move the sprite the number of LEDs you say.
```sig
let item: game.LedSprite = null;
item.move(1);
```
### Parameters ### Parameters
* ``move by`` is a [number](/reference/types/number) that means how many LEDs the sprite should move * a [number](/reference/types/number) that means how many LEDs the sprite should move
### Example ### Example

View File

@ -8,7 +8,7 @@ game.startCountdown(1000)
### Parameters ### Parameters
* a [number](/reference/types/number) that means how many milliseconds to count down (one second is 1000 milliseconds) * ``ms`` is a [number](/reference/types/number) that says how many milliseconds to count down (one second is 1000 milliseconds)
### Examples ### Examples

View File

@ -2,10 +2,15 @@
Turn the sprite as much as you say in the direction you say. Turn the sprite as much as you say in the direction you say.
```sig
let item: game.LedSprite = null;
item.turn(Direction.Right, 45);
```
### Parameters ### Parameters
* ``turn`` is a choice whether the sprite should turn **left** or **right** * a choice whether the sprite should turn **left** or **right**
* ``by`` is a [number](/reference/types/number) that means how much the sprite should turn. * a [number](/reference/types/number) that means how much the sprite should turn.
This number is in **degrees**, so a straight left or right turn is 90 degrees. This number is in **degrees**, so a straight left or right turn is 90 degrees.
### Example ### Example