Slides/Live Output
Day 1Day 2Day 3Day 4
Day 3Ghosts
</> View code
What to test
  • 1Ghosts should roam on their own
  • 2Eat a power pellet — ghosts turn blue
  • 3Touch a blue ghost — it respawns
  • 4Touch a normal ghost — Game Over
  • 5Press 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