fix input.input. typing

This commit is contained in:
Amerlander
2020-03-19 16:26:40 +01:00
parent 0803a13033
commit f30ff02987
57 changed files with 101 additions and 101 deletions

View File

@ -16,11 +16,11 @@ Press button ``A`` as much as possible to increase the score.
Press ``B`` to display the score and reset the score.
```blocks
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
basic.showNumber(game.score())
game.setScore(0)
})
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
game.addScore(1)
})
```

View File

@ -16,7 +16,7 @@ Press button ``A`` as much as possible.
At the end of 10 seconds, the program will show your score.
```blocks
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -27,7 +27,7 @@ let img = images.createImage(`
. . . . .
`)
img.showImage(0)
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
img.clear()
img.showImage(0)
})

View File

@ -14,10 +14,10 @@ If you press button `B`, it shows an animation and ends the game.
```blocks
basic.showString("PICK A BUTTON");
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
basic.showString("YOU WIN!");
});
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
game.gameOver();
});
```

View File

@ -20,7 +20,7 @@ degrees -- exactly the opposite direction.
```blocks
let ball = game.createSprite(4, 2);
basic.showNumber(ball.get(LedSpriteProperty.Direction));
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
ball.ifOnEdgeBounce();
basic.showNumber(ball.get(LedSpriteProperty.Direction));
});

View File

@ -15,7 +15,7 @@ game.isPaused()
Resume the game if it's paused and button **B** is pressed.
```blocks
input.input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
if (game.isPaused()) {
game.resume()
}

View File

@ -15,7 +15,7 @@ game.isRunning()
If the game is currently running, end the game if button **B** is pressed.
```blocks
input.input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
if (game.isRunning()) {
game.gameOver()
}

View File

@ -13,7 +13,7 @@ This program adds one point to your score every time you press button
second) and shows your score.
```blocks
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
game.addScore(1);
basic.pause(500);
basic.showNumber(game.score());

View File

@ -16,11 +16,11 @@ Press button ``A`` as much as possible to increase the score.
Press ``B`` to display the score and reset the score.
```blocks
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
basic.showNumber(game.score())
game.setScore(0)
})
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
game.addScore(1)
})
```

View File

@ -17,7 +17,7 @@ Press button ``A`` as much as possible.
At the end of 10 seconds, the program will show your score.
```blocks
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
game.addScore(1)
})
game.startCountdown(10000)