Pacman Game

Classic Arcade Game Recreation in Java

Java Game Development 2D Graphics Multi-threading
View on GitHub

Project Overview

A faithful recreation of the classic Pacman arcade game built in Java. This project demonstrates core game development concepts including 2D graphics rendering, collision detection, event handling, AI pathfinding for ghost behaviors, and multi-threaded game loop implementation.

Key Features

  • Classic Pacman gameplay mechanics
  • Four unique ghost AI personalities (Blinky, Pinky, Inky, Clyde)
  • 2D graphics with Java Swing
  • Collision detection system
  • Score tracking and high score system
  • Power-up mechanics and ghost vulnerability states
  • Multiple levels with increasing difficulty

Technical Implementation

Game Architecture
  • Game Loop: Fixed timestep game loop using multi-threading
  • Rendering: Double-buffered rendering to prevent screen tearing
  • AI System: State-machine based ghost behaviors with pathfinding
  • Collision Detection: Grid-based collision with pixel-perfect hit detection
Ghost AI Behaviors
  • Blinky (Red): Aggressive chaser targeting Pacman directly
  • Pinky (Pink): Ambusher targeting ahead of Pacman
  • Inky (Cyan): Flanker with complex positioning logic
  • Clyde (Orange): Random behavior switching between chase and scatter

What I Learned

  • Java game development with Swing and AWT
  • Implementing AI pathfinding algorithms
  • Multi-threaded programming for game loops
  • Event-driven architecture and input handling
  • Game state management and transitions