Original Goal

To recreate pacman but at least have something different about it. We started with building a random maze generator.


The random maze generator algorithm was inspired by Conway's Game of Life.

What it does

Originally built for Pacman, my random maze generation is now just random maze generation.

How I built it

With Javascript.(Gosh, why doesn't javascript have proper multidimensional arrays)

First I randomly populate the maze. I then iteratively check for 3 block states on the board and update them until the entire board is stable.

  1. A 2x2 block of walls will have 1 random wall replaced by a path.

  2. A 2x2 block of path will have 1 random path replaced by a wall.

  3. A path will be checked against its 4 immediate neighbors. If it has none or only 1 path, it will open up another.

Challenges I ran into

My partner ghosts me and only has one submission where he drew a canvas and a green square!

The maze generation is lacking in the edges of the maze. I was going to update it when the gui was made, but...

Accomplishments that I'm proud of

It turns out creating a Pacman style maze is harder than I thought. A quick google search only turns out one project: https://shaunlebron.github.io/pacman-mazegen/

These are the maze constraints the author noted for Pacman:

 Map is 28x31 tiles. (Mine can be any size by altering the MAZEX or MAZEY values)

 Paths are only 1 tile thick (Same)

 No sharp turns  (I have no idea what this means)

 There are 1 or 2 tunnels (Same)

 No dead-ends.(Same)

 Only I, L, T, +, or rectangular wall shapes are allowed. (I did not make this restriction although most shapes conform)

 Any non-rectangular wall pieces must only be 2 tiles thick. (I have removed all 2x2 walls)

What I learned

Javascript. Also, gotta join a bigger group next hackathon, putting all your code in one basket is bad.

What's next for Hacman (now a maze generator)

Fix the maze edges.

Maybe actually make pacman

We originally wanted to hosted it on a website, but considering the progress on the front end...

Also wanted to submit hacman.online to best domain prize too, but alas.

Built With

Share this project: