The most popular game from the 1980s is back in action! In this project, the user can create multiple PacMen with the click of a button and each of them will begin to move about the browser window at their own pace. This PacMen game is an example of utilizing JavaScript to create the Pacmen by pushing them into an array and then injecting the PacMen to the web browser via the DOM.
The starter code was provided by MIT xPro.
To create a PacMan, click on the "Add PacMan" button. The button will create a PacMan in various sizes in different areas of the browser. The user can create unlimited PacMen.
To begin the game, click the "Start Game" button and the PacMen will move about the browser at their own pace at random velocities. Every time the user clicks the "Start Game" button, the PacMen will begin to move faster.
Additional PacMen can be created while the game is active by clicking the "Add PacMan" button.
Future improvements will include creating an area to keep the PacMen within a container on the browser window.
Also, using the extra images in the folder to switch PacMan's mouth to open then close while moving and rotating from PacMan's left to right side when bouncing off the edge of the container.
Connect with me on Twitter or LinkedIn.
Some implementations and solutions in this project are derived from the provided lectures and materials of MIT xPro's MERN Stack Bootcamp course.
PacMan is a licensed brand and trademark of BANDAI NAMCO Entertainment.
Copyright (c) 2020 John Williams
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.