V4 updates (#210)

* update pxt.json files

* Fix button event enums

fixes https://github.com/microsoft/pxt-calliope/issues/206

* Fix Safari CSS Rule for iOS app

fixes https://github.com/microsoft/pxt-calliope/issues/205

* aprove preffered repos

should fix https://github.com/microsoft/pxt-calliope/issues/167
This commit is contained in:
Juri Wolf
2023-01-11 18:51:27 +01:00
committed by GitHub
parent 1aaedf1fa0
commit 77ed2ccfb1
62 changed files with 223 additions and 162 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.onButtonEvent(Button.B, ButtonEvent.Down, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Down), () => {
basic.showNumber(game.score())
game.setScore(0)
})
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
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.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
game.addScore(1)
})
game.startCountdown(10000)

View File

@ -27,7 +27,7 @@ let img = images.createImage(`
. . . . .
`)
img.showImage(0)
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
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.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
basic.showString("YOU WIN!");
});
input.onButtonEvent(Button.B, ButtonEvent.Down, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Down), () => {
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.onButtonEvent(Button.B, ButtonEvent.Down, () => {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Down), () => {
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.onButtonEvent(Button.B, ButtonEvent.Down, function () {
input.onButtonEvent(Button.B, input.buttonEventValue(ButtonEvent.Down), function () {
if (game.isPaused()) {
game.resume()
}

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.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
game.addScore(1);
basic.pause(500);
basic.showNumber(game.score());