Skip to content

WACWCA/pacman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pacman

gameplay1.mp4

The game

Features:
  • Tunnels
  • Ghosts make turns that seek out player
  • Ghosts run from player when in vulnerable state
  • Speed increases as game progresses
  • 3-lives system/li>
  • Unlimited leves
  • New mazes every game
  • Scoring System

Maze generation

The algorithm for generating the mazes was inspired by that described on Shaun Lebron's Github, which additionally defined constraints of traditional pac man mazes

  • Map is 28x31 tiles
  • Paths are only 1 tile thick
  • No sharp turns - intersections are separated by atleast 2 tiles
  • 1-2 tunnels
  • No dead-ends
  • Only I, L, T, or + wall shapes are allowed, including the occasional rectangular wall
  • Any non-rectangular wall pieces must only be 2 tiles thick

Original Pacman maze

The algorithm

The algorithm designed for this project relies on a tetris style building technique. A shape would be selected at random from a list of allowable states, and fit into a random position. Certain requirements for the board such as the pen for the ghosts to spawn in were taken into account for that step as well. This was repeated until the no more pieces could fit onto the board, at which point it was mirrored horizontally. This produced the structure pictured on the right. That picture also displays the marked small horizontal and vertical manipulations that occured to get the board to fit the 28x31 dimensions. The image on the left depicts the maze drawn from the original structure. Tunnels were easily added after the construction of the maze after considering which rows they could occur on.

Sample mazes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages