Levels
Lv 3
Four Directions
★
Move the hero in all 4 directions and reach the star.
0
Score:
0
/ 1
Hint
Code
Run
Reset
1
2
3
4
5
6
7
8
9
10
11
hero = makeSprite("hero", 40, 40, { emoji: "🤖", w: 32, h: 32, gravity: 0 }); star = makeSprite("star", 330, 330, { emoji: "⭐", w: 32, h: 32, 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); if (touching(hero, star)) { addScore(1); endGame(); } });
Game
← Prev
Next →