A pacmen factory where pacmen bounce off the walls
For this exercise I used vanilla JS to create a pacmen factory function. This function creates all the needed code to place a new pacmen on the screen and position the images. Using a little random math, their position and velocity were slightly randomized. Once the user hits the “Start Game” button, the pacmen move across the screen, bouncing off the walls of the browser at different speeds and angles.
View Repository View Live Project