←
Slides
/
Live Output
Day 1
Day 2
Day 3
Day 4
Day 2 — Moving Pacman
</> View code
What to test
1
Arrow keys move Pacman
2
Walk into a wall — Pacman should stop
3
Collect pellets — score should count up
4
Press 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