This is an exercise from Week 2 of MITxPro Professional Certificate in Coding course.
Most of the code and the images were provided as the starter code for the assignment. My humble contribution was writing the function that makes PacMan change direction when he reaches either of the horizontal edges.
Additionally I tweaked the code after passing the assignment so that PacMan would no go over the edges for visual appeal.
- Document Object Model
- setInterval() function
- if/else if statement
- nested array
- onclick attribute for an HTML element