Slides/Live Output
Day 1Day 2Day 3Day 4
Day 2Moving Pacman
</> View code
What to test
  • 1Arrow keys move Pacman
  • 2Walk into a wall — Pacman should stop
  • 3Collect pellets — score should count up
  • 4Press R to restart
New concepts
Variables for position: pacRow, pacCol
keyPressed() event function
Wall collision: maze[nextRow][nextCol] !== WALL
arc() for the mouth wedge
Eating: maze[row][col] = PATH