Skip to content

Commit ab40574

Browse files
Rotate slower on hardware
1 parent 690f559 commit ab40574

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

.github/makecode/blocks.png

5.56 KB
Loading

.github/makecode/blocksdiff.png

-193 KB
Loading

main.blocks

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

main.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,21 @@ function jump (sprite: Sprite, gravity: number, tiles2: number) {
130130
sprite.vy = 0 - Math.sqrt(2 * (gravity * (tiles2 * tiles.tileWidth())))
131131
jumps += 1
132132
}
133-
if (in_simulator_or_rpi()) {
134-
timer.background(function () {
135-
timer.throttle("rotate", 100, function () {
133+
timer.background(function () {
134+
timer.throttle("rotate", 100, function () {
135+
if (in_simulator_or_rpi()) {
136136
for (let index = 0; index < 36; index++) {
137137
transformSprites.changeRotation(sprite_player, 10)
138138
pause(10)
139139
}
140-
})
140+
} else {
141+
for (let index = 0; index < 8; index++) {
142+
transformSprites.changeRotation(sprite_player, 45)
143+
pause(45)
144+
}
145+
}
141146
})
142-
}
147+
})
143148
}
144149
function fade (_in: boolean, duration: number, block: boolean) {
145150
if (_in) {
@@ -197,7 +202,7 @@ constants_length = 1600
197202
jumps = 0
198203
won = false
199204
in_game = false
200-
pause(100)
205+
pause(500)
201206
if (controller.B.isPressed()) {
202207
scene.setBackgroundColor(13)
203208
pause(100)

pxt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Dash!",
2+
"name": "Dash! v1.2.2",
33
"version": "1.2.1",
44
"description": "",
55
"dependencies": {

0 commit comments

Comments
 (0)