Skip to main content

Welcome to Procedural Pac-Man 3D

This project explores procedural content generation (PCG) techniques applied to a classic arcade game reimagined in 3D. Built entirely with Three.js without relying on game engines like Unity or Unreal, this implementation demonstrates how PCG can breathe new life into familiar gameplay.

Play the Game

Try the live demo and experience procedurally generated mazes

Quick Start

Get the game running locally in minutes

View Source

Explore the complete source code on GitHub

API Reference

Deep dive into the game’s architecture and classes

What Makes This Special?

This isn’t just another Pac-Man clone. The project combines classic gameplay with modern procedural generation techniques:

Procedural Maze Generation

Every level features a unique maze layout generated using a Tetris-piece-based algorithm. Unlike the original game’s static level design, each playthrough offers fresh challenges with randomly generated corridors, walls, and power-up placements.

Dynamic Voronoi Textures

Wall textures are procedurally generated using Voronoi tessellation with custom GLSL shaders, creating unique visual patterns for each maze that enhance the 3D environment without relying on pre-made texture assets.

Intelligent Ghost AI

Ghost behavior uses the A* pathfinding algorithm with state machines to create challenging opponents. The AI difficulty dynamically adjusts based on the current level, making the game progressively harder as you advance.

Pure Three.js Implementation

Built from the ground up using Three.js for 3D graphics rendering, without depending on game engines. This approach provides deeper control over rendering, physics, and game logic while demonstrating low-level game development techniques.

Key Features

Procedural Mazes

Tetris-piece algorithm generates unique maze layouts every game

Voronoi Textures

GLSL shaders create procedural wall textures

A* Pathfinding

Smart ghost AI uses optimal pathfinding algorithms

3D Rendering

Full 3D graphics with Three.js, no game engine required

Multi-Camera System

Switch between free, top-down, and side camera views

Progressive Difficulty

Dynamic parameters adjust AI behavior as levels increase

Project Background

This project was developed as a Bachelor’s thesis (TFG) at the University of Granada to explore:
  • Procedural Content Generation techniques and their application to classic games
  • Low-level game development without relying on commercial game engines
  • Graphics programming using WebGL through Three.js
  • AI pathfinding algorithms for game character behavior
The complete thesis document (in Spanish) provides detailed explanations of the PCG algorithms, implementation decisions, and game architecture.

Next Steps

Quick Start Guide

Run the game locally and explore the code

Architecture Overview

Understand how the game is structured

Maze Generation

Learn how procedural mazes are created

Core Classes

Browse the complete API reference

Build docs developers (and LLMs) love