The one-line answer to how to make Pac-Man in 2026 is: a grid of tiles, a hero that moves along that grid, four ghosts with distinct target-tile functions, and a dot-eating loop that ends when every dot is gone. The one-line caveat is that Pac-Man is a Bandai Namco trademark. The mechanic (a character eating dots in an enclosed maze while dodging chasing ghosts) is fair use; the name, the yellow-wedge character, and the specific arcade maze layout are not. This guide is the honest end-to-end for a browser dot muncher clone with your own art and your own maze — the mechanic done properly, the branding left alone. The Sorceress pipeline: AI Image Gen for the hero and four ghost sprites, WizardGenie to scaffold a Phaser 4 tilemap project with grid-locked movement and four ghost personality AIs, Music Gen for the chase-theme bed, and SFX Gen for the chomp, the death chirp, and the frightened-ghost siren.
What "how to make Pac-Man" actually means in 2026
The query "how to make Pac-Man" hides three different requests. Some searchers want a faithful arcade clone with the exact 28-tile-wide maze, the exact ghost personalities, and the original Toru Iwatani design intent. Some want a dot-muncher inspired-by build with their own maze, their own characters, and their own art style — a game that plays like Pac-Man but ships under a different name. And some want to learn the tile-grid movement pattern and the four-ghost AI because those two techniques transfer to any maze game (Bomberman, Snake, tower defence, roguelike overworlds). The honest default for a first browser project is the second: an inspired-by dot muncher. Faithful clones invite trademark takedowns; from-scratch inspired-by games ship cleanly and teach you the same underlying loop. Section seven costs the whole project out at under 1.75 USD in Sorceress credits, which is worth reading before you commit to the full arcade-accurate version.
A quick history anchor, verified against Wikipedia's Pac-Man page on 2026-08-09: the game was designed by Toru Iwatani at Namco, developed over roughly one year and five months starting in early 1979, and location-tested on 22 May 1980 in Shibuya before a July 1980 national release in Japan. Midway distributed it in North America starting late 1980. The four ghosts have distinct AI — Blinky (red) chases directly, Pinky (pink) tries to get ahead of Pac-Man, Inky (cyan) uses a more complicated strategy, and Clyde (orange) alternates between chasing and fleeing depending on distance. That AI variety is what makes the game feel alive after 45 years, and it is the single most important thing to get right in a clone. This guide walks through the exact tile-target function each ghost uses.
The Pac-Man game loop in one minute (move eat pursue power-up)
Six moving parts, one strict order per frame. First, read player input — up, down, left, right (arrow keys or WASD), and buffer the last press so the hero remembers direction changes made a few frames before an intersection. Second, advance hero movement — if the hero is at a tile centre, pick the next tile based on buffered input (or continue in the current direction if the buffered input leads into a wall); otherwise, lerp the hero's pixel position toward the next tile at a fixed speed. Third, advance each ghost — when a ghost arrives at a tile centre, run its personality function to pick a target tile, then choose the neighbour tile that minimises distance to the target, with the hard constraint that ghosts cannot reverse direction mid-tile. Fourth, check dot pickup — if the hero enters a tile that contains a dot, remove the dot and add 10 to score; if it contains a power pellet, remove it, add 50 to score, and switch all ghosts to frightened state for a timed window. Fifth, check ghost overlap — if the hero and any ghost occupy the same tile, either the hero loses a life (chase mode) or the hero eats the ghost for 200/400/800/1600 points (frightened mode, doubling per ghost eaten this pellet). Sixth, check win state — if every dot and every power pellet is gone, advance to the next level with faster ghosts and a shorter frightened window.
That is the entire game. Six steps, executed once per frame at 60 frames per second, driven by requestAnimationFrame. Everything else — the intermissions, the level-fruit bonuses, the ghost-house release timers, the warp tunnel on the sides, the kill-screen at level 256 — is polish and depth layered on top of this core loop. Keep the loop tight and the six-step order strict, and the dot-muncher feels arcade even on a mid-range phone browser. Fight the temptation to move the hero freely in pixel space; that is the single most common failure mode of first-time Pac-Man clones and it makes the corners feel wrong forever.
Pick your engine for how to make Pac-Man: Phaser 4, vanilla Canvas, or WizardGenie scaffold
Three good browser targets in 2026, each with a different trade-off. Phaser 4 is the honest default for a tilemap-based maze game. Phaser 4.2.1 "Giedi" was released on 9 July 2026 (verified against phaser.io/download/stable on 2026-08-09) and ships built-in tilemaps, arcade physics, animated sprites, and a scene manager — the exact primitives a Pac-Man clone needs. The maze becomes a Phaser Tilemap loaded from a JSON layout, the hero and four ghosts are Sprites with velocity, and Phaser's tile-based collision handles the "can I move into this tile" check without you writing the geometry code. Bundle is roughly 900 KB minified, which is fine for mobile browsers. This is the fastest path to a playable dot muncher and it is the pick 90% of readers should take.
Vanilla HTML5 Canvas 2D plus requestAnimationFrame is the leanest possible path. You write about 400 lines of JavaScript, produce a build under 15 KB minified, and end up with something eligible for a JS13K-style code-golf jam. The trade-off is that every primitive — tile-grid lookups, sprite animation, buffered input, ghost AI, collision, sound — has to be written by hand. Use vanilla Canvas if the exercise itself is the point; use Phaser 4 if you want the game done by Sunday night. Three.js is the wrong pick for this project because Pac-Man is a grid-locked 2D game with no camera perspective — the entire 3D scene graph is overhead you never use.
The third option: skip the engine choice and prompt WizardGenie for a scaffold in whichever framework you name. WizardGenie is the Sorceress game-native coding agent, shipping as both a Windows desktop installer (Early Access supporters and above) and a no-install web build at the same URL. Its coding-model lineup (verified 2026-08-09 in src/app/_home-v2/_data/tools.ts lines 735 to 742) covers Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7 — the current frontier plus the cheap-and-fast tier. For a dot-muncher clone, any frontier model scaffolds the whole project on the first prompt. Run cheap by pairing a frontier planner (Claude Opus 4.7 or GPT-5.5) with a cheap executor (DeepSeek V4 Pro or Kimi K2.5) in a Planner + Executor split — the shape of the pattern that keeps token cost around one-fifth of a solo-frontier session on the same codebase.
Step 1 — build the classic maze grid and dot placement
Skip this step and the entire project will grind at the third H2 review, guaranteed. Grab a sheet of graph paper, or open a whiteboard tool, and draw a rectangular grid roughly 20 to 28 tiles wide by 20 to 31 tiles tall. Do not replicate the arcade Pac-Man maze exactly — that specific layout is copyrighted and is the most-cited element in Bandai Namco takedown notices. Design your own maze with the same three feel-properties: corridors are one tile wide so entities pass single-file; there are no dead ends (every corridor loops back so ghosts can never trap a skilled player without options); and there are exactly four large-open corners for power pellets.
Each tile is one of four types: wall, corridor with dot, corridor with power pellet, or corridor empty (used for the ghost house, warp tunnels, and the hero spawn tile). Fill the corridors with small dots (10 points each). Place four large power pellets in the four corner regions — these are your "energizer" tiles that flip ghosts to frightened state. Add a central ghost-house rectangle where the four ghosts spawn and where eaten ghosts respawn. Optionally, add two warp-tunnel tiles on the left and right edges that teleport the hero and ghosts to the opposite side — a classic Pac-Man touch that adds strategic depth without adding code complexity. Save the maze as a JSON layout of tile-type integers; Phaser loads this directly with this.load.tilemapTiledJSON().
Two implementation shortcuts. First, draw the walls as blue rectangles in code instead of importing tile art — every version of Pac-Man from 1980 onward uses blue lines on black, and this look is a genre convention rather than a trademark. Two dozen lines of Phaser rectangle() calls and you have a full maze. Second, generate a dot-position map from the corridor tiles automatically instead of placing every dot by hand — WizardGenie will write this loop in one prompt. Total maze-build effort with these shortcuts: about 20 minutes on paper plus 5 minutes of prompting.