How I Built Pac-Chase

Sal's Journey Recreating the King of Arcade Games

Inspired by Pac-Man (1980)

The Original Memory

"I'll never forget the day Pac-Man arrived at Galaxy Zone in 1980. The delivery truck pulled up, and I knew we had something special. Within hours, there was a line of kids wrapped around the block."

Sal remembers the Pac-Man fever like it was yesterday. The distinctive wakka-wakka sound, the ghost chase music, the way kids would crowd around the cabinet, shouting directions at whoever was playing. It wasn't just a game – it was a phenomenon.

"Every arcade owner knew Pac-Man was the king. If you could master the patterns, you could play for hours on a single quarter. I watched kids become legends on that machine."

The Vision

When Sal decided to recreate Pac-Man for his AI Arcade, he had crystal-clear memories of what made the original magical:

  • The Maze - That iconic blue maze layout, burned into every arcade kid's memory
  • Ghost Personalities - Each ghost had to feel different, with unique AI patterns
  • Power Pellet Drama - The moment when the hunter becomes the hunted
  • Perfect Timing - Grid-based movement that felt smooth but precise
  • Sound Design - Those authentic arcade beeps and boops

"I wanted kids today to feel that same rush I saw in 1980 – that moment when you clear a screen and the ghosts speed up for the next level."

The Challenge: Floating-Point Disaster

The first version of Pac-Chase was a nightmare. The AI had created a sophisticated floating-point movement system that looked impressive in code but played terribly.

The Problems:

  • Pac-Man would get stuck between maze walls
  • Ghosts would vibrate and glitch through corridors
  • Collision detection was unpredictable
  • The game felt sluggish and unresponsive

"I played the first version for exactly thirty seconds before shutting it down. 'This ain't Pac-Man,' I told my AI buddy. 'This is some kind of geometric nightmare.'"

Sal's frustration led to one of his most direct prompts: "pac chase does nothing. redo this game correctly. think"

The Solution: Back to Basics

The breakthrough came when Sal demanded a complete rebuild using the fundamentals he remembered from the original arcade hardware.

Key Technical Decisions:

  • Grid-Based Movement - 31x23 tile grid, just like the original
  • Integer Coordinates - No floating-point bugs, pure grid logic
  • Timing Control - Player moves every 8 frames, ghosts every 10
  • Hand-Crafted Maze - Traditional Pac-Man layout in string format
  • Simple AI Patterns - Chase with 80% targeting, 20% randomness

"Sometimes the old ways are the only ways that work. Those 1980 arcade programmers knew what they were doing – tight constraints, simple math, perfect timing."

Capturing the Feel

The real magic wasn't in the code – it was in the details that made Pac-Man feel alive:

The Mouth Animation

"That chomping mouth had to be perfect. I watched the AI code it frame by frame – open, closed, open, closed. When Pac-Man stops moving, his mouth closes. That's the kind of detail that separates good games from legendary ones."

Ghost Behavior

"Each ghost needed personality. Red is aggressive, pink tries to ambush, cyan is unpredictable. Even with simple AI, you can feel the difference when they're chasing you."

Power Pellet Magic

"The moment you eat a power pellet and the ghosts turn blue – that's pure arcade gold. Suddenly you're the predator, and those same ghosts that were terrorizing you are running for their lives."

The Technical Breakdown

Here's how Pac-Chase actually works under the hood:

Maze Layout System

// Classic Pac-Man maze stored as strings this.mazeLayout = [ "1111111111111111111111111111111", "1222222222222211122222222222221", "1311112111112211112111112111131", // ... 31 columns x 23 rows ]; // 1=wall, 2=dot, 3=power pellet, 0=empty

Grid Movement Logic

// Player moves every 8 frames for controlled speed if (this.gameTimer % 8 === 0) { this.updatePlayer(); } // Simple but effective collision detection canMove(x, y) { return this.maze[y][x] !== 1; // Not a wall }

Sal's Final Thoughts

"The second version of Pac-Chase felt right from the first move. Smooth, responsive, just like I remembered. The AI nailed it by going back to the fundamentals instead of overcomplicating things."

"When I see someone play Pac-Chase and instinctively try to cut corners or lead ghosts into a trap, I know we got it right. The muscle memory from 1980 still works in 2025."

"Sometimes the best technology is the simplest technology. Pac-Man proved that 45 years ago, and it's still true today."