'Pacmen-factory' is a fun project to make number of Pac-Man images move continuously on the screen.
What I Learned
- Using setTimeout() for continuous movement of Pac-Man
- Detecting screen edges
- Stopping setTimeout()
PacMan
- It Generates one or more Pac-Man images.When the game was started each Pac-man starts to move continuously from random positions in random velocity. When it detect the screen edges it chages its direction and starts to move again.At any point in time one can stop the Pac-Man movement by clicking Stop button.
- Download this project in your working directory through,
git clone https://github.com/vanisbala/pacmen-factory - Open pacman-factory project in VScode, go to index.html, right click and select 'open in default browser'.
- The project output will open in your browser.
- Click on Add pacman button to add one or more pacman images
- Click on start game button to make them move
- Click on stop button to stop the movement of Pac-Man images
- Getting inputs from the user about how many pacman(with size and velocity) to generate and how long to sustain.
- Making a wall and if any of the pac-man hits the wall while moving then it disappears.
Thanks to MITxPRO for giving me the opportunity to work on this project.