Skip to content

Alex-is-Gonzalez/PacMan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

PacMan Array With Edge Detection

Description

In order to code PacMan moving across the page while opening and closing his mouth a 2D array was created. In the pacArray index[0][0] and [0][1] contains the opened and closed mouth images for PacMan moving to the left while index [1][0] and [1][1] contain the images for PacMan going to the right. Function Run was created with a setInterval so PacMac will move automatically on the page. Lastly, function checkPageBounds was created for the purpose of edge dections utilizing if conditional statments to reverse the current direction.

Installation

Download a copy of the PacMan File folder. Drag and drop PacMan.Html onto a blank webpage and load the page. You should see PacMan running back and fourth on the page.

Usage

This project is good example of edge dection, setInterval and alternating images using a 2D array.

Support

MDN Web Docs

Roadmap

The future outcome from this project is to add a ghost on the screen that stays ahead of pacMan.

License Information

MIT XPro

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages