Skip to content

Commit ec18561

Browse files
Only rotate image if in simulator
1 parent 2e903d1 commit ec18561

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

.github/makecode/blocks.png

11.1 KB
Loading

.github/makecode/blocksdiff.png

-181 KB
Loading

main.blocks

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

main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ function jump (sprite: Sprite, gravity: number, tiles2: number) {
117117
if (jumps < constants_max_jumps) {
118118
sprite.vy = 0 - Math.sqrt(2 * (gravity * (tiles2 * tiles.tileWidth())))
119119
jumps += 1
120+
}
121+
if (in_simulator()) {
120122
timer.background(function () {
121123
timer.throttle("rotate", 100, function () {
122124
for (let index = 0; index < 36; index++) {
@@ -127,6 +129,9 @@ function jump (sprite: Sprite, gravity: number, tiles2: number) {
127129
})
128130
}
129131
}
132+
function in_simulator () {
133+
return control.deviceDalVersion() == "sim"
134+
}
130135
function fade (_in: boolean, duration: number, block: boolean) {
131136
if (_in) {
132137
color.startFade(color.originalPalette, color.Black, duration)

0 commit comments

Comments
 (0)