This exercise is a great example of JavaScript and HTML coming together. The Factory for PackMen exercise, is an interactive game that makes use of many callback functions: In the "game" many PackMen are moving and bouncing off-of the walls, each at different speeds. The user, can add as many PacMen as they wish by clicking the button functions in the upper right corner Add PacMan and Start Game . The button function Add PacMan calls makePac() which returns and object that is pushed into the pacMen array via pacMen.push. Each PacMan, keeps track of its position and velocity as it moves across the screen (within the shadow DOM) using the function setToRandom ; the checkCollisions function allows it to update its position within the DOM via `setTimeout’ every 20 milliseconds.
SheaTang/PacMen-Exercise
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|

