Skip to content

Commit 8bfa95f

Browse files
Say some text
1 parent 22e1870 commit 8bfa95f

4 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/makecode/blocks.png

90 KB
Loading

.github/makecode/blocksdiff.png

134 KB
Loading

main.blocks

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

main.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,36 @@ scene.onHitWall(SpriteKind.Player, function (sprite, location) {
1111
jumps = 0
1212
}
1313
})
14+
function display_text () {
15+
timer.background(function () {
16+
while (!(in_game)) {
17+
for (let text of [
18+
"Welcome to Dash!",
19+
"By Unsigned_Arduino.",
20+
"Use the joystick/d-pad/WASD/arrow keys to select a level.",
21+
"Press A to confirm level selection.",
22+
"Use A/up arrow/d-pad up/up arrow key/W to jump!",
23+
"Try to get to the end!",
24+
"Enjoy!",
25+
""
26+
]) {
27+
sprite_player.say(text, 4000)
28+
pause(5000)
29+
timer.background(function () {
30+
for (let index = 0; index < 20; index++) {
31+
if (in_game) {
32+
sprite_player.say("")
33+
}
34+
pause(250)
35+
}
36+
})
37+
if (in_game) {
38+
break;
39+
}
40+
}
41+
}
42+
})
43+
}
1444
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
1545
if (in_game) {
1646
jump(sprite_player, constants_gravity, constants_tiles_high_jump)
@@ -175,6 +205,9 @@ jumps = 0
175205
won = false
176206
in_game = false
177207
make_player()
208+
timer.after(2000, function () {
209+
display_text()
210+
})
178211
let selected_level = select_level()
179212
pause(1000)
180213
if (selected_level == 1) {

0 commit comments

Comments
 (0)