Levels
Lv 36
Speed Trial 2
★
Score 3 in this challenge.
0
Score:
0
/ 3
Hint
Code
Run
Reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
hero = makeSprite("hero", 20, 180, { emoji: "🏃", w: 40, h: 40, gravity: 0 }); flag = makeSprite("flag", 340, 180, { emoji: "🏁", gravity: 0 }); count = 0; onUpdate(() => { if (keyDown("arrowright")) move(hero, 5, 0); if (keyDown("arrowleft")) move(hero, -5, 0); if (keyDown("arrowup")) move(hero, 0, -5); if (keyDown("arrowdown")) move(hero, 0, 5); if (touching(hero, flag)) { addScore(1); setPosition(flag, random(30, 350), random(30, 350)); count += 1; if (count >= 3) endGame(); } }); // Goal: touch the flag 3 times!
Game
← Prev
Next →