←
Slides
/
Live Output
Day 1
Day 2
Day 3
Day 4
Day 3 — Ghosts
</> View code
What to test
1
Ghosts should roam on their own
2
Eat a power pellet — ghosts turn blue
3
Touch a blue ghost — it respawns
4
Touch a normal ghost — Game Over
5
Press R to restart
New concepts
Array of objects: ghosts[]
for...of loop
Random direction AI with wall avoidance
Timer with frameCount: scaredTimer countdown
Game state flag: gameOver