Update SUMMARY with current reference APIs. (#507)
This commit is contained in:
parent
bed48e3893
commit
17886f3365
@ -181,6 +181,73 @@
|
||||
* [set transmit power](/reference/radio/set-transmit-power)
|
||||
* [set transmit serial number](/reference/radio/set-transmit-serial-number)
|
||||
* [write received packet to serial](/reference/radio/write-received-packet-to-serial)
|
||||
* [Game](/reference/game)
|
||||
* [create sprite](/reference/game/create-sprite)
|
||||
* [delete](/reference/game/delete)
|
||||
* [move](/reference/game/move)
|
||||
* [turn](/reference/game/turn)
|
||||
* [in on edge bounce](/reference/game/if-on-edge-bounce)
|
||||
* [get](/reference/game/get)
|
||||
* [set](/reference/game/set)
|
||||
* [change](/reference/game/change)
|
||||
* [is touching](/reference/game/is-touching)
|
||||
* [is touching edge](/reference/game/is-touching-edge)
|
||||
* [add score](/reference/game/add-score)
|
||||
* [score](/reference/game/score)
|
||||
* [set score](/reference/game/set-score)
|
||||
* [start countdown](/reference/game/start-countdown)
|
||||
* [game over](/reference/game/game-over)
|
||||
* [pause](/reference/game/pause)
|
||||
* [resume](/reference/game/resume)
|
||||
* [Images](/reference/images)
|
||||
* [create image](/reference/images/create-image)
|
||||
* [create big image](/reference/images/create-big-image)
|
||||
* [show image](/reference/images/show-image)
|
||||
* [scroll image](/reference/images/scroll-image)
|
||||
* [arrow image](/reference/images/arrow-image)
|
||||
* [icon image](/reference/images/icon-image)
|
||||
* [arrow number](/reference/images/arrow-number)
|
||||
* [Pins](/reference/pins)
|
||||
* [digital read pin](/reference/pins/digital-read-pin)
|
||||
* [digital write pin](/reference/pins/digital-write-pin)
|
||||
* [analog read pin](/reference/pins/analog-read-pin)
|
||||
* [analog write pin](/reference/pins/analog-write-pin)
|
||||
* [analog set period](/reference/pins/analog-set-period)
|
||||
* [map](/reference/pins/map)
|
||||
* [on pulsed](/reference/pins/on-pulsed)
|
||||
* [pulse duration](/reference/pins/pulse-duration)
|
||||
* [pulse in](/reference/pins/pulse-in)
|
||||
* [servo write pin](/reference/pins/servo-write-pin)
|
||||
* [servo set pulse](/reference/pins/servo-set-pulse)
|
||||
* [i2c read number](/reference/pins/i2c-read-number)
|
||||
* [i2c write number](/reference/pins/i2c-write-number)
|
||||
* [set pull](/reference/pins/set-pull)
|
||||
* [analog pitch](/reference/pins/analog-pitch)
|
||||
* [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
* [spi write](/reference/pins/spi-write)
|
||||
* [spi Pins](/reference/pins/spi-pins)
|
||||
* [spi format](/reference/pins/spi-format)
|
||||
* [spi frequency](/reference/pins/spi-frequency)
|
||||
* [Serial](/reference/serial)
|
||||
* [write line](/reference/serial/write-line)
|
||||
* [write number](/reference/serial/write-number)
|
||||
* [write value](/reference/serial/write-value)
|
||||
* [write string](/reference/serial/write-string)
|
||||
* [read until](/reference/serial/read-until)
|
||||
* [read line](/reference/serial/read-line)
|
||||
* [read string](/reference/serial/read-string)
|
||||
* [on data received](/reference/serial/on-data-received)
|
||||
* [redirect](/reference/serial/redirect-to)
|
||||
* [write buffer](/reference/serial/write-buffer)
|
||||
* [read buffer](/reference/serial/read-buffer)
|
||||
* [Control](/reference/control)
|
||||
* [in background](/reference/control/in-background)
|
||||
* [reset](/reference/control/reset)
|
||||
* [wait micros](/reference/control/wait-micros)
|
||||
* [on event](/reference/control/on-event)
|
||||
* [raise event](/reference/control/raise-event)
|
||||
* [event timestamp](/reference/control/event-timestamp)
|
||||
* [event value](/reference/control/event-value)
|
||||
* [Bluetooth](/reference/bluetooth)
|
||||
* [About](/reference/bluetooth/about-bluetooth)
|
||||
* [Pairing](/reference/bluetooth/bluetooth-pairing)
|
||||
|
@ -32,8 +32,8 @@ control.inBackground(() => {
|
||||
## Bluetooth
|
||||
|
||||
```namespaces
|
||||
devices.tellCameraTo(MesCameraEvent.TakePhoto);
|
||||
bluetooth.onBluetoothConnected(() => {});
|
||||
devices.tellCameraTo(MesCameraEvent.TakePhoto);
|
||||
```
|
||||
|
||||
```package
|
||||
|
@ -36,9 +36,9 @@ game.resume();
|
||||
|
||||
### See also
|
||||
|
||||
[createSprite](/reference/game/create-sprite), [move](/reference/game/move), [turn](/reference/game/turn),
|
||||
[create sprite](/reference/game/create-sprite), [move](/reference/game/move), [turn](/reference/game/turn),
|
||||
[ifOnEdgeBounce](/reference/game/if-on-edge-bounce), [get](/reference/game/get), [set](/reference/game/set),
|
||||
[change](/reference/game/change), [isTouching](/reference/game/touching) [isTouchingEdge](/reference/game/touching-edge),
|
||||
[addScore](/reference/game/change-score-by), [score](/reference/game/score), [setScore](/reference/game/set-score),
|
||||
[startCountdown](/reference/game/start-countdown), [gameOver](/reference/game/game-over),
|
||||
[change](/reference/game/change), [is touching](/reference/game/is-touching) [is touching edge](/reference/game/is-touching-edge),
|
||||
[add score](/reference/game/add-score), [score](/reference/game/score), [set score](/reference/game/set-score),
|
||||
[start countdown](/reference/game/start-countdown), [game over](/reference/game/game-over),
|
||||
[pause](/reference/game/pause), [resume](/reference/game/resume)
|
||||
|
30
docs/reference/game/add-score.md
Normal file
30
docs/reference/game/add-score.md
Normal file
@ -0,0 +1,30 @@
|
||||
# add Score
|
||||
|
||||
Add more to the current score for the game.
|
||||
|
||||
```sig
|
||||
game.addScore(1)
|
||||
```
|
||||
### Parameters
|
||||
|
||||
* a [number](/types/number) that means how much to add to the score. A negative number means to subtract from the score.
|
||||
|
||||
### Examples
|
||||
|
||||
This program is a simple game.
|
||||
Press button ``A`` as much as possible to increase the score.
|
||||
Press ``B`` to display the score and reset the score.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
basic.showNumber(game.score())
|
||||
game.setScore(0)
|
||||
})
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
game.addScore(1)
|
||||
})
|
||||
```
|
||||
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score), [set score](/reference/game/set-score), [start countdown](/reference/game/start-countdown)
|
@ -1,27 +0,0 @@
|
||||
# Change Score By
|
||||
|
||||
Add the amount you say to the score for the game.
|
||||
|
||||
```sig
|
||||
game.addScore(1)
|
||||
```
|
||||
### Parameters
|
||||
|
||||
* a [number](/types/number) that means how much to add to the score. A negative number means to subtract from the score.
|
||||
|
||||
### Examples
|
||||
|
||||
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.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
game.addScore(1)
|
||||
})
|
||||
game.startCountdown(10000)
|
||||
```
|
||||
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score), [start countdown](/reference/game/start-countdown)
|
@ -33,5 +33,5 @@ ball.change(LedSpriteProperty.X, 2);
|
||||
|
||||
[turn](/reference/game/turn),
|
||||
[brightness](/reference/led/brightness),
|
||||
[get sprite property](/reference/game/get-sprite-property),
|
||||
[set sprite property](/reference/game/set-sprite-property)
|
||||
[get sprite property](/reference/game/get),
|
||||
[set sprite property](/reference/game/set)
|
||||
|
@ -33,5 +33,5 @@ item.move(2);
|
||||
|
||||
[move](/reference/game/move),
|
||||
[turn](/reference/game/turn),
|
||||
[touching](/reference/game/touching)
|
||||
[is-touching](/reference/game/is-touching)
|
||||
|
||||
|
26
docs/reference/game/delete.md
Normal file
26
docs/reference/game/delete.md
Normal file
@ -0,0 +1,26 @@
|
||||
# delete
|
||||
|
||||
Delete a sprite from the game.
|
||||
|
||||
```sig
|
||||
let item: game.LedSprite = null;
|
||||
item.delete();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* the **sprite** you want to delete from the game
|
||||
|
||||
### Example
|
||||
|
||||
This program makes a sprite and shows the number of its brightness on the screen. Then, it deletes the sprite.
|
||||
|
||||
```blocks
|
||||
let ball = game.createSprite(0, 2);
|
||||
basic.showNumber(ball.get(LedSpriteProperty.Brightness));
|
||||
ball.delete();
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[create sprite](/reference/game/create-sprite)
|
@ -25,4 +25,4 @@ input.onButtonPressed(Button.B, () => {
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score),
|
||||
[change score by](/reference/game/change-score-by), [start countdown](/reference/game/start-countdown)
|
||||
[add score](/reference/game/add-score), [start countdown](/reference/game/start-countdown)
|
||||
|
@ -34,6 +34,6 @@ basic.showNumber(ball.get(LedSpriteProperty.Brightness));
|
||||
|
||||
[turn](/reference/game/turn),
|
||||
[brightness](/reference/led/brightness),
|
||||
[change sprite property](/reference/game/change-sprite-property),
|
||||
[set sprite property](/reference/game/set-sprite-property)
|
||||
[change sprite property](/reference/game/change),
|
||||
[set sprite property](/reference/game/set)
|
||||
|
||||
|
@ -30,5 +30,5 @@ input.onButtonPressed(Button.B, () => {
|
||||
### See also
|
||||
|
||||
[create sprite](/reference/game/create-sprite),
|
||||
[touching](/reference/game/touching),
|
||||
[touching edge](/reference/game/touching-edge)
|
||||
[is touching](/reference/game/is-touching),
|
||||
[is touching edge](/reference/game/is-touching-edge)
|
||||
|
@ -36,5 +36,5 @@ if (item.isTouchingEdge()) {
|
||||
### See also
|
||||
|
||||
[create sprite](/reference/game/create-sprite),
|
||||
[touching](/reference/game/touching),
|
||||
[is touching](/reference/game/is-touching),
|
||||
[if on edge, bounce](/reference/game/if-on-edge-bounce)
|
||||
|
@ -37,5 +37,5 @@ if (matter.isTouching(antimatter)) {
|
||||
### See also
|
||||
|
||||
[create sprite](/reference/game/create-sprite),
|
||||
[touching edge](/reference/game/touching-edge),
|
||||
[is touching edge](/reference/game/is-touching-edge),
|
||||
[if on edge, bounce](/reference/game/if-on-edge-bounce)
|
||||
|
@ -27,4 +27,4 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score), [start countdown](/reference/game/start-countdown)
|
||||
[score](/reference/game/score), [add score](/reference/game/add-score), [start countdown](/reference/game/start-countdown)
|
||||
|
@ -33,5 +33,5 @@ ball.set(LedSpriteProperty.X, 4);
|
||||
|
||||
[turn](/reference/game/turn),
|
||||
[brightness](/reference/led/brightness),
|
||||
[change sprite property](/reference/game/change-sprite-property),
|
||||
[get sprite property](/reference/game/get-sprite-property)
|
||||
[change sprite property](/reference/game/change),
|
||||
[get sprite property](/reference/game/get)
|
||||
|
@ -25,5 +25,5 @@ game.startCountdown(10000)
|
||||
|
||||
### See Also
|
||||
|
||||
[score](/reference/game/score), [change score by](/reference/game/change-score-by)
|
||||
[score](/reference/game/score), [add score](/reference/game/add-score)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user