Back to Work
Pac-Man Game
Game Dev

Pac-Man Game

Browser-based Pac-Man recreation in vanilla JavaScript with a custom game loop, grid-based movement, collision detection, real-time scoring, and pathfinding-driven ghost AI.

2024
JavaScriptHTMLCanvas API

Overview

A browser-based recreation of the classic arcade game Pac-Man built with JavaScript. Features grid-based movement, collision detection, real-time score tracking, and ghost AI behavior. Demonstrates game development fundamentals including game loop implementation, coordinate systems, and basic AI pathfinding for ghost characters.

Problem Statement & Approach

Recreate the classic arcade game to learn game-development fundamentals — the game loop, coordinate systems, collision detection, and simple AI.

Approach: Build the board as a grid, drive movement and collisions off grid coordinates, run a continuous game loop for rendering and scoring, and give ghosts basic pathfinding behavior.

Key Features

  • Grid-based movement and collision detection
  • Custom game loop with real-time score tracking
  • Ghost AI with basic pathfinding behavior
  • Rendered with the HTML Canvas API

Improvements

  • Power pellets and a ghost fright mode
  • Multiple levels with increasing difficulty
  • Mobile touch controls
Game DevelopmentJavaScriptCanvasAI