Pacman Game Recreation
Game Development, AI Behavior, Visual Design
ROLES
Game Developer
TIMELINE
April 2024 (30 Hours)
TOOLS
Processing 4
Released in Japan in 1980, Pacman was an instant arcade game hit.
The goal of the game was to collect all of the pellets on the map without getting caught by one of the 4 ghosts.
As part of a "Retro Video Game Hub", I set out to recreate this iconic arcade classic entirely in Processing 4, reimagining its core gameplay mechanics, visuals, and AI from the ground up.
dim star
Gameplay
dim star
This recreation of Pac-Man includes the following features:
dim star
Custom Sound Design
dim star
Four Distinct Playable Maps
dim star
Interactive Dashboard with Live High Score Tracking
dim star
Smooth and Responsive Pacman Control System
dim star
AI-Driven Ghost Movement with Dynamic Border Detection
What are the sounds of Pacman?
In this recreation of Pacman, there are 5 unique audio tracks depending on how the user experiences the game:
dim star
Menu Background Music: When the player is in the "main menu", a light and catchy tune sets the tone for the game
dim star
In-Game Background Music: While playing, a remix of the classic Pacman theme plays in the background to keep the energy high.
dim star
Pacman WIN/LOSE Music: Based on the outcome, the game will play either a cheerful victory jingle or a somber defeat melody
dim star
Game Button Interaction: Whenever a player interacts with a button on-screen, a satisfying click sound provides audio feedback
light blue star icondim starlight blue star icon
To create different levels for the game, each map was loaded from a custom-formatted .txt file. These files contained all the necessary information: the layout of the map, the coordinates for where the map should appear on screen, Pac-Man’s starting position, and the starting positions for each of the four ghosts.
The map layout itself was represented as a grid of 0's and 1's. Each "0" corresponded to an open space, while each "1" represented a wall. This simple binary system made it easy to visualize and generate different layouts programmatically.
Thanks to this system, any number of unique maps could be created by simply editing or adding new .txt files, as long as they followed the formatting rules. This approach gave the game a modular and scalable design that allowed for endless level possibilities with minimal overhead.
light blue star icondim starlight blue star icon
dim star
Pacman & "The Ghosts"
dim star
To control Pacman, the player could either use their arrow keys (↑ ↓ ← →) or their "WASD" keys.
To ensure a smooth experience for the player, I added a simple "queue" system for Pacman's movement. When a player presses a direction key, that command gets saved. If Pacman can go that way, he does. If he can't, the game keeps the move saved and tries again on the next step. Only one move is saved at a time.
Each ghost consists of its body, which swaps between two states (open and closed) to mimic movement, and its eyes. The eye position and rotation depends on the direction the ghost is going.
Magic? Or just clever programming...
Both Pacman and "The Ghosts" have a border "auto-detect" system. They are able to detect whether there would be a collision with the wall if they moved in a certain direction.
How this works is that before every move, a series of tests is run to determine whether there would be a collision or not. In Pacman, the anti-collision system checks if Pacman can keep moving or must stop, and also works with the control "queue" system to keep gameplay smooth.
In "The Ghosts", this anti-collision system is expressed in their decision-making. A series of randomized tests are done to determine every ghost's next move. Randomized tests include determining whether a ghost should change direction, and if so, which direction.
Beep. Boop. You're a Winner!
The most challenging part of this project was creating the border "auto-detect" system. I knew from the beginning that I wanted Pacman and "The Ghosts" to be able to automatically detect when they were about to collide with a wall and act accordingly.

Though this was the most challenging part of the project, it was also my proudest achievement and favorite feature of this Pacman game recreation.

However, on this project made me realize that making games was not only about the technical things like my border "auto-detect" system, but it was also about user-friendliness. I learned how much time and effort went into making a game that not only worked well, but felt good to play for the player.