snake_case -> camelCase in docs
This commit is contained in:
parent
64ebb5c8c3
commit
6a5cfae5ff
@ -41,7 +41,7 @@ Now let's add some more types of instructions for the player to follow. Let's ad
|
|||||||
/**
|
/**
|
||||||
* {highlight}
|
* {highlight}
|
||||||
*/
|
*/
|
||||||
export function newAction_() {
|
export function newAction() {
|
||||||
action = Math.random(4) // ***
|
action = Math.random(4) // ***
|
||||||
if (action == 0) {
|
if (action == 0) {
|
||||||
basic.showString("PUSH A", 150) // ***
|
basic.showString("PUSH A", 150) // ***
|
||||||
|
@ -21,10 +21,10 @@ let count = 0
|
|||||||
## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
|
## 3. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after two button presses on Button A. Explain why that particular area is shaded.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let count_ = 0
|
let count = 0
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
count_ = count_ + 1
|
count = count + 1
|
||||||
basic.showNumber(count_, 100)
|
basic.showNumber(count, 100)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ After two button presses, **count** will be equal to 2.
|
|||||||
## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
|
## 5. If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed after five button presses on Button A. Explain why that particular area is shaded.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let count_ = 0
|
let count = 0
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
count_ = count_ + 1
|
count = count + 1
|
||||||
basic.showNumber(count_, 100)
|
basic.showNumber(count, 100)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ let count = 0
|
|||||||
## 3. Draw which LED is ON after running this code and pressing Button A twice. Explain why you chose to draw that number
|
## 3. Draw which LED is ON after running this code and pressing Button A twice. Explain why you chose to draw that number
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let count_ = 0
|
let count = 0
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
count_ = count_ + 1
|
count = count + 1
|
||||||
basic.showNumber(count_, 100)
|
basic.showNumber(count, 100)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ input.onButtonPressed(Button.A, () => {
|
|||||||
## 4. Draw which LED is ON after running this code and pressing Button A five times. Explain why you chose to draw that number.
|
## 4. Draw which LED is ON after running this code and pressing Button A five times. Explain why you chose to draw that number.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let count_ = 0
|
let count = 0
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
count_ = count_ + 1
|
count = count + 1
|
||||||
basic.showNumber(count_, 100)
|
basic.showNumber(count, 100)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Write the line of code to measure the acceleration and then store in it a variab
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let accX_ = input.acceleration("x")
|
let accX = input.acceleration("x")
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: acceleration does not have be measured in the "x" direction. It can also be in the "y" or "z" direction.
|
Note: acceleration does not have be measured in the "x" direction. It can also be in the "y" or "z" direction.
|
||||||
|
@ -18,15 +18,15 @@ bluetooth.uartRead("");
|
|||||||
### Example: Starting the Bluetooth UART service and then reading data received from another device which is terminated by ":" character and then displaying it
|
### Example: Starting the Bluetooth UART service and then reading data received from another device which is terminated by ":" character and then displaying it
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let uart_data = "";
|
let uartData = "";
|
||||||
let connected = 0;
|
let connected = 0;
|
||||||
basic.showString("UART");
|
basic.showString("UART");
|
||||||
bluetooth.onBluetoothConnected(() => {
|
bluetooth.onBluetoothConnected(() => {
|
||||||
basic.showString("C");
|
basic.showString("C");
|
||||||
connected = 1;
|
connected = 1;
|
||||||
while (connected == 1) {
|
while (connected == 1) {
|
||||||
uart_data = bluetooth.uartRead(":");
|
uartData = bluetooth.uartRead(":");
|
||||||
basic.showString(uart_data);
|
basic.showString(uartData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bluetooth.onBluetoothDisconnected(() => {
|
bluetooth.onBluetoothDisconnected(() => {
|
||||||
|
@ -86,7 +86,7 @@ Sprite - If the sprite is on the edge, the sprite will bounce
|
|||||||
![](/static/mb/game-library/if-on-edge-bounce-0.png)
|
![](/static/mb/game-library/if-on-edge-bounce-0.png)
|
||||||
|
|
||||||
```
|
```
|
||||||
export function ifOnEdge_Bounce(_this: micro_bitSprites.LedSprite)
|
export function ifOnEdgeBounce(_this: micro_bitSprites.LedSprite)
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Change score by](/reference/game/change-score-by)
|
### [Change score by](/reference/game/change-score-by)
|
||||||
|
Loading…
Reference in New Issue
Block a user