From 2c09b7794f7366a52f2b316794cd6c31abf73399 Mon Sep 17 00:00:00 2001 From: Ron Hale-Evans Date: Mon, 18 Jul 2016 14:23:05 -0700 Subject: [PATCH] Fixing parameters --- docs/reference/game/game-over.md | 4 ++ docs/reference/game/misc.txt | 54 ++++++++++++++++++++++++++ docs/reference/game/move.md | 7 +++- docs/reference/game/start-countdown.md | 2 +- docs/reference/game/turn.md | 9 ++++- 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 docs/reference/game/misc.txt diff --git a/docs/reference/game/game-over.md b/docs/reference/game/game-over.md index 2664c09a..e39aba7f 100644 --- a/docs/reference/game/game-over.md +++ b/docs/reference/game/game-over.md @@ -2,6 +2,10 @@ End the game and show the score. +```sig +game.gameOver(); +``` + ### Example This program asks you to pick a button. diff --git a/docs/reference/game/misc.txt b/docs/reference/game/misc.txt new file mode 100644 index 00000000..e32154ef --- /dev/null +++ b/docs/reference/game/misc.txt @@ -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) +``` + + diff --git a/docs/reference/game/move.md b/docs/reference/game/move.md index 96ef5536..299070c0 100644 --- a/docs/reference/game/move.md +++ b/docs/reference/game/move.md @@ -2,9 +2,14 @@ Move the sprite the number of LEDs you say. +```sig +let item: game.LedSprite = null; +item.move(1); +``` + ### 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 diff --git a/docs/reference/game/start-countdown.md b/docs/reference/game/start-countdown.md index 0764ff5d..7d768194 100644 --- a/docs/reference/game/start-countdown.md +++ b/docs/reference/game/start-countdown.md @@ -8,7 +8,7 @@ game.startCountdown(1000) ### 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 diff --git a/docs/reference/game/turn.md b/docs/reference/game/turn.md index 4a7d1fec..4d602431 100644 --- a/docs/reference/game/turn.md +++ b/docs/reference/game/turn.md @@ -2,10 +2,15 @@ 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 -* ``turn`` is 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 choice whether the sprite should turn **left** or **right** +* 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. ### Example