Levels
Lv 24
Ghost Escape 1
★
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
19
20
hero = makeSprite("hero", 200, 200, { emoji: "🧒", gravity: 0 }); ghost = makeSprite("ghost", 20, 20, { emoji: "👻", gravity: 0 }); ticks = 0; speed = 1.15; onUpdate(() => { if (keyDown("arrowright")) move(hero, 4, 0); if (keyDown("arrowleft")) move(hero, -4, 0); if (keyDown("arrowup")) move(hero, 0, -4); if (keyDown("arrowdown")) move(hero, 0, 4); if (ghost.x < hero.x) ghost.x += speed; if (ghost.x > hero.x) ghost.x -= speed; if (ghost.y < hero.y) ghost.y += speed; if (ghost.y > hero.y) ghost.y -= speed; ticks += 1; if (ticks % 30 === 0) addScore(1); if (touching(hero, ghost)) endGame(); }); // Goal: survive 3 ticks!
Game
← Prev
Next →