Levels
Lv 4
Coin Collector
★
Collect 3 coins.
0
Score:
0
/ 3
Hint
Code
Run
Reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
hero = makeSprite("hero", 180, 180, { emoji: "🤖", w: 32, h: 32, gravity: 0 }); c1 = makeSprite("c1", 60, 60, { emoji: "🪙", gravity: 0 }); c2 = makeSprite("c2", 300, 80, { emoji: "🪙", gravity: 0 }); c3 = makeSprite("c3", 160, 320, { emoji: "🪙", gravity: 0 }); onUpdate(() => { if (keyDown("arrowright")) move(hero, 3, 0); if (keyDown("arrowleft")) move(hero, -3, 0); if (keyDown("arrowup")) move(hero, 0, -3); if (keyDown("arrowdown")) move(hero, 0, 3); [c1, c2, c3].forEach(c => { if (c.visible && touching(hero, c)) { hide(c); addScore(1); } }); });
Game
← Prev
Next →