Levels
Lv 18
Boss Battle
★★★★
Hit the boss 5 times by jumping on it.
0
Score:
0
/ 5
Hint
Code
Run
Reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
hero = makeSprite("hero", 40, 200, { emoji: "🦸" }); boss = makeSprite("boss", 300, 300, { emoji: "👹", w: 60, h: 60, gravity: 0 }); boss.vx = 2; whenKey(" ", () => jump(hero)); onUpdate(() => { if (keyDown("arrowright")) hero.x += 3; if (keyDown("arrowleft")) hero.x -= 3; if (boss.x < 20 || boss.x > 320) boss.vx *= -1; boss.x += boss.vx; if (touching(hero, boss) && hero.vy > 0) { addScore(1); hero.vy = -10; } });
Game
← Prev
Next →