Skip to content

Commit 74d9d34

Browse files
committed
Update main.blocks, main.ts, images.g.jres, images.g.ts, main.py
1 parent 75549ef commit 74d9d34

7 files changed

Lines changed: 347 additions & 75 deletions

File tree

.github/makecode/blocks.png

6.82 KB
Loading

.github/makecode/blocksdiff.png

-578 Bytes
Loading

images.g.jres

Lines changed: 29 additions & 2 deletions
Large diffs are not rendered by default.

images.g.ts

Lines changed: 269 additions & 32 deletions
Large diffs are not rendered by default.

main.blocks

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

main.py

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,49 @@ def on_up_pressed():
1010

1111
def on_on_overlap(sprite, coll1):
1212
coll1.destroy()
13-
info.change_life_by(-1)
1413
statusbar.value += -30
1514
sprites.on_overlap(SpriteKind.player, SpriteKind.projectile, on_on_overlap)
1615

16+
def on_a_pressed():
17+
game.set_dialog_frame(img("""
18+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
19+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
20+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
21+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
22+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
23+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
24+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
25+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
26+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
27+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
28+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
29+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
30+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
31+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
32+
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
33+
"""))
34+
game.set_dialog_text_color(5)
35+
game.set_dialog_cursor(img("""
36+
..............................
37+
..............................
38+
..............................
39+
777777777777777777777777......
40+
7......................7......
41+
7.111.111.1111.111.111.7......
42+
7.1...1.1.1..1.1...1...7......
43+
7.111.111.1..1.1...111.7......
44+
7...1.1...1111.1...1...7......
45+
7.111.1...1..1.111.111.7......
46+
7......................7......
47+
777777777777777777777777......
48+
..............................
49+
..............................
50+
..............................
51+
"""))
52+
game.show_long_text("Welcome To The world of retro.\\n Try to win as fast as possible.\\n press space to START GAME",
53+
DialogLayout.CENTER)
54+
controller.A.on_event(ControllerButtonEvent.PRESSED, on_a_pressed)
55+
1756
def on_overlap_tile(sprite, location):
1857
game.over(True)
1958
scene.on_overlap_tile(SpriteKind.player, sprites.builtin.brick, on_overlap_tile)
@@ -31,43 +70,6 @@ def on_hit_wall(sprite, location):
3170
jumpcount = 0
3271
statusbar: StatusBarSprite = None
3372
jack: Sprite = None
34-
game.set_dialog_frame(img("""
35-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
36-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
37-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
38-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
39-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
40-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
41-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
42-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
43-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
44-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
45-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
46-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
47-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
48-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
49-
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
50-
"""))
51-
game.set_dialog_text_color(5)
52-
game.set_dialog_cursor(img("""
53-
..............................
54-
..............................
55-
..............................
56-
777777777777777777777777......
57-
7......................7......
58-
7.111.111.1111.111.111.7......
59-
7.1...1.1.1..1.1...1...7......
60-
7.111.111.1..1.1...111.7......
61-
7...1.1...1111.1...1...7......
62-
7.111.1...1..1.111.111.7......
63-
7......................7......
64-
777777777777777777777777......
65-
..............................
66-
..............................
67-
..............................
68-
"""))
69-
game.show_long_text("Welcome To The world of retro.\\n Try to win as fast as possible.\\n press space to START GAME",
70-
DialogLayout.CENTER)
7173
scene.set_background_color(9)
7274
tiles.set_tilemap(tilemap("""
7375
level4
@@ -98,6 +100,10 @@ def on_on_update():
98100
"""))
99101
game.on_update(on_on_update)
100102

103+
def on_on_update2():
104+
pass
105+
game.on_update(on_on_update2)
106+
101107
def on_update_interval():
102108
global coll1
103109
if game.runtime() > 3000:

main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ controller.up.onEvent(ControllerButtonEvent.Pressed, function () {
99
})
1010
sprites.onOverlap(SpriteKind.Player, SpriteKind.Projectile, function (sprite, coll1) {
1111
coll1.destroy()
12-
info.changeLifeBy(-1)
1312
statusbar.value += -30
1413
})
1514
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
@@ -84,6 +83,9 @@ game.onUpdate(function () {
8483
} else if (jack.vx < 0) {
8584
jack.setImage(assets.image`image7`)
8685
}
86+
})
87+
game.onUpdate(function () {
88+
8789
})
8890
game.onUpdateInterval(2000, function () {
8991
if (game.runtime() > 3000) {

0 commit comments

Comments
 (0)