Skip to content

armin-reichert/pacman-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Pac-Man and Ms. Pac-Man (game model+logic, sound events, animation control, no UI!)

A Pac-Man and Ms. Pac-Man game implementation in Java with levels, timing, ghost "AI" etc. following the details given in the (highly appreciated) Pac-Man Dossier by Jamey Pittman. The Ms. Pac-Man levels probably are not 100% accurate because I could not find a similarly detailed description as the Pac-Man dossier. Any hints?

Source code has been moved to repository pacman-javafx

The code in this project is more "to the point" than the one in my other state-machine focussed implementation.

The implementation follows the Model-View-Controller design pattern:

  • The game controller is a finite-state machine with states
    • INTRO, CREDIT, READY, HUNTING, LEVEL_STARTING, LEVEL_COMPLETE, PACMAN_DYING, GHOST_DYING, GAME_OVER and INTERMISSION. (See GameState)
  • User interfaces can be attached to the model/controller layer using a game event listener interface.

The MVC design allows to implement different user interfaces for Pac-Man and Ms. Pac-Man without having to recreate the details of the game logic.

As proof of concept I implemented the following two UI variants:

  • A Swing UI implementation, see repository pacman-ui-swing (OUTDATED! Must be adapted to core changes).
  • A JavaFX UI implementation with play scenes in 2D and 3D, see repository pacman-javafx.

YouTube:

YouTube video

Build

mvn clean install

Intro scene

Pac-Man play scene

Ms. Pac-Man play scene (2D vs. 3D)