Skip to content

SheaTang/PacMen-Exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PacMen-Exercise:

Description:

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.

image

How to Run:

  • Download the file from this GitHub Repository e.g. Clone this Repository,
  • Open the index file in the console or your preferred code editor e.g. VS Code,
  • Run the project.

    Road Map of Future Improvements:

  • In the future I would add interactive functionality; via a full game,
  • As I continue to add skills to my developer toolbox I will return to this project and update it.

    image

  • About

    The Factory for PackMen exercise, is a game that makes use of many callback functions: Where 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` cal…

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors