Skip to content

Commit e76c268

Browse files
Update pxt.json, main.blocks, main.ts, tilemap.jres, _tilemap.ts
1 parent 9bc2a42 commit e76c268

7 files changed

Lines changed: 150 additions & 15 deletions

File tree

.github/makecode/blocks.png

-34.3 KB
Loading

.github/makecode/blocksdiff.png

-233 KB
Loading

_tilemap.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Auto-generated code. Do not edit.
2+
namespace myTiles {
3+
4+
}
5+
// Auto-generated code. Do not edit.

main.blocks

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

main.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ controller.up.onEvent(ControllerButtonEvent.Pressed, function () {
1313
g_y += -1
1414
})
1515
controller.B.onEvent(ControllerButtonEvent.Pressed, function () {
16-
b_keep_as_background = !(b_keep_as_background)
17-
b_paused = true
16+
circles = []
17+
cycle()
1818
})
1919
controller.up.onEvent(ControllerButtonEvent.Repeated, function () {
2020
g_y += -1
@@ -42,6 +42,15 @@ controller.left.onEvent(ControllerButtonEvent.Pressed, function () {
4242
controller.right.onEvent(ControllerButtonEvent.Pressed, function () {
4343
g_x += 1
4444
})
45+
function cycle () {
46+
wait_f_paused()
47+
expand(randint(2, 15), randint(1, 100))
48+
shrink2()
49+
for (let value of circles) {
50+
wait_f_paused()
51+
value.destroy()
52+
}
53+
}
4554
controller.down.onEvent(ControllerButtonEvent.Repeated, function () {
4655
g_y += 1
4756
})
@@ -58,7 +67,6 @@ controller.left.onEvent(ControllerButtonEvent.Repeated, function () {
5867
})
5968
let myCircle: Circle = null
6069
let circles: Sprite[] = []
61-
let b_keep_as_background = false
6270
let b_paused = false
6371
let g_y = 0
6472
let g_x = 0
@@ -187,15 +195,7 @@ scene.setBackgroundImage(img`
187195
g_x = scene.screenWidth() / 2
188196
g_y = scene.screenHeight() / 2
189197
b_paused = false
190-
b_keep_as_background = false
198+
let b_keep_as_background = false
191199
forever(function () {
192-
wait_f_paused()
193-
expand(randint(2, 15), randint(1, 100))
194-
shrink2()
195-
for (let value of circles) {
196-
wait_f_paused()
197-
if (!(b_keep_as_background)) {
198-
value.destroy()
199-
}
200-
}
200+
cycle()
201201
})

pxt.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"files": [
99
"main.blocks",
1010
"main.ts",
11-
"README.md"
11+
"README.md",
12+
"tilemap.jres",
13+
"_tilemap.ts"
1214
],
1315
"testFiles": [
1416
"test.ts"

tilemap.jres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"*": {
3+
"mimeType": "image/x-mkcd-f4",
4+
"dataEncoding": "base64",
5+
"namespace": "myTiles"
6+
}
7+
}

0 commit comments

Comments
 (0)