Migrate docs from the other repo

This commit is contained in:
Michal Moskal
2016-03-25 16:47:20 -07:00
parent 38d2cf06d2
commit a08eb53f92
895 changed files with 36888 additions and 0 deletions

View File

@ -0,0 +1,43 @@
# Add Points to Score
The game library #docs
The game library supports simple single-player time-based games. The player will ** add points to score**.
## Block Editor
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible and the score will display on the screen.
![](/static/mb/game-library/add-point-to-score-0.png)
## Touch Develop
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
game.addScore(1)
})
game.startCountdown(10000)
```
### 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
```
### Lessons
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)

View File

@ -0,0 +1,43 @@
# Change Score By
The game library #docs
The game library supports simple single-player time-based games. The player will ** add points to score**.
## Block Editor
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible and the score will display on the screen.
![](/static/mb/change-score-by-0.png)
## Touch Develop
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
game.addScore(1)
})
game.startCountdown(10000)
```
### 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
```
### Lessons
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)

View File

@ -0,0 +1,24 @@
# Game Over
The game library #docs
The game library supports simple single-player time-based games. The game can end the game by calling the `game over` function
## Block Editor
You can end the game by calling the `game over ` function. In this example, if BBC micro:bit's answer to the question is GAME OVER, GAME OVER will be displayed to end the game.
![](/static/mb/game-library/game-over-0.png)
## Touch Develop
You can end the game by calling the `game -> game over` function:
```
game.gameOver()
```
### Lessons
[game of chance](/microbit/lessons/game-of-chance)

View File

@ -0,0 +1,59 @@
# Score
The game library #docs
The game library supports simple single-player games. The player has a **score**.
## Block Editor
The code below shows a simple game where the user gets to press the button ``A`` and adds 1 point to score that will be displayed on the BBC micro:bit screen
![](/static/mb/game-library/add-point-to-score-0.png)
## Touch Develop
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
game.addScore(1)
})
game.startCountdown(10000)
```
### 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)
```
### Lessons
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)

View File

@ -0,0 +1,57 @@
# Start Countdown
The game library #docs
The game library supports simple single-player time-based games. The general goal of a game will be to achieve a top score before time runs out of time.
## Block Editor
![](/static/mb/game-library/start-countdown-0.png)
## Touch Develop
The code below shows a simple game where the user gets to press the button ``A`` as much times as possible in 10 seconds.
```
input.onButtonPressed("A", () => {
game.addScore(1)
})
game.startCountdown(10000)
```
### 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)
```
### Lessons
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)