Pac-Man (created by Toru Iwatani for Namco in 1980, and famously preserved in HTML5 via the legendary 30th Anniversary Google Doodle) is not a game of random chance. Every single ghost in the maze is governed by a deterministic, mathematically precise targeting algorithm.
Understanding how each ghost calculates its target tile allows you to manipulate their movements, group them for quadruple eat streaks, and navigate high-speed fruit stages.
1. The Four Ghost AI Targeting Algorithms
Every ghost has two alternating modes: Scatter (retreats to its home corner) and Chase (targets Pac-Man based on specific mathematical rules):
┌────────────────────────────────────────────────────────┐
│ Ghost Personalities & Math Formulas │
├────────────────────────────────────────────────────────┤
│ • Blinky (Red - "Shadow"): Directly targets Pac-Man's │
│ exact current coordinate tile (Direct Pursuer). │
│ │
│ • Pinky (Pink - "Speedy"): Targets 4 tiles ahead of │
│ Pac-Man in his current facing vector (Ambush/Pincer).│
│ │
│ • Inky (Cyan - "Bashful"): Targets a complex vector │
│ calculated by doubling the distance between Blinky │
│ and 2 tiles ahead of Pac-Man (Unpredictable Flank). │
│ │
│ • Clyde (Orange - "Pokey"): If >8 tiles from Pac-Man, │
│ targets Pac-Man. If <8 tiles, retreats to bottom- │
│ left corner (Cowardly Cycle). │
└────────────────────────────────────────────────────────┘
2. Cornering Pre-Turns: Gaining Distance
Pac-Man moves faster through turns than the ghosts:
- The Pre-Turn Input: If you press an arrow key before reaching an intersection, Pac-Man hugs the inner corner with sub-pixel precision, gaining approximately 1 tile of lead distance over trailing ghosts with every turn.
3. Power Pellet Ghost Multipliers
When consuming a flashing Power Pellet, ghosts turn dark blue and reverse direction:
- 1st Ghost: 200 Points
- 2nd Ghost: 400 Points
- 3rd Ghost: 800 Points
- 4th Ghost: 1,600 Points Always group at least 3 to 4 ghosts in your wake before touching a Power Pellet to maximize round point yield.
Related Guides & Documentation
- Category Hub: Browse all guides in Famous Video & HTML5 Game Guides
- Related Guide: Getting Over It Web Edition: Complete Sledgehammer Pivot Physics, Catch Mechanics, and Mountain Route — Master the physics of Bennett Foddy
- Related Guide: Geometry Dash Web Edition: Complete Click Buffering, Ship Physics, and Wave Precision Guide — Master click buffering input techniques, ship flight gravity stabilization, wave tapping frequencies, and Demon level timing in Geometry Dash Web.
- Related Guide: Friday Night Funkin — Master audio latency offset calibration, Downscroll vs Upscroll, note hit windows (Sick, Good, Bad, Shit), and keybind mapping in Friday Night Funkin Web.