This designs maps at random and stops when it thinks it has found one that will play well. The default map is 27x19 - you can generate other sizes if you want. Game variations could include gravity, teleport pads, etc. Could add stop lights and make it a driving game. (Treating the map as a city roadway)
Idea by Shawn Williams ( http://pacman.shaunew.com/play/mapgen/ ) , possibly inspired by Todd Lehman (LUGNet). ( http://www.lugnet.com/admin/plan/map/pacman.html ) I've merged this with my maze game https://scratch.mit.edu/projects/56421322/ - see https://scratch.mit.edu/projects/117474890/ Remaining TO DO's: 2) add tunnels. 6) use a private PRNG with a seed, and save the seeds that produced good maps into a cloud array. Then games can use that pool. and can run the generator for a few seconds or in the background, to add new layouts to the pool - that way players don't have to wait for a map to be generated between levels. (Also, I had originally parameterised the size properly but during development, the size code got a bit messed up, so to generate other sizes of maze, it will need some repair/tweaking. Especially if you use even numbered sizes. Stick with 27x19 for now...)