Back to Pac-Man Classic

README

PACMAN - Authentic Arcade Recreation

A complete, authentic recreation of the classic Pacman arcade game using HTML5, CSS3, JavaScript, and p5.js.

🎮 Features

Authentic Gameplay

  • Original Maze Layout: Exact replica of the classic Pacman maze
  • Authentic Ghost AI: Each ghost has unique behavior patterns
- Blinky (Red): Direct chase AI - Pinky (Pink): Ambush - targets 4 tiles ahead of Pacman - Inky (Cyan): Complex positioning based on Pacman and Blinky - Clyde (Orange): Random/scatter behavior when close to Pacman
  • Original Scoring: Dots (10pts), Power Pellets (50pts), Ghosts (200pts), Fruit (100pts+)
  • Power Pellets: 8-second vulnerability period for ghosts
  • Lives System: 3 lives to start
  • Level Progression: Increasing difficulty with each level

Visual Authenticity

  • Classic Graphics: Authentic Pacman and ghost sprites
  • Smooth Animations: Chomping mouth, ghost eyes, wavy ghost bottoms
  • Original Colors: Exact color matching to the arcade version
  • Visual Effects: Power mode flashing, death animations

Controls

  • Desktop: Arrow keys for movement, Space to pause
  • Mobile: Touch D-pad for movement, on-screen buttons
  • Responsive Design: Works on all screen sizes

Audio

  • Sound Effects: Eating dots, power pellets, ghost encounters
  • Web Audio API: Retro 8-bit style sounds
  • Toggle Option: Mute/unmute functionality

🚀 Quick Start

  • Open index.html in your web browser
  • Click "START GAME" to begin
  • Use arrow keys or touch controls to move
  • Eat all dots to complete the level
  • Avoid ghosts unless you've eaten a power pellet!
  • 📁 File Structure

    shell
    pacman/
    ├── index.html          # Main game page
    ├── css/
    │   └── style.css       # Game styling and responsive design
    ├── js/
    │   ├── utils.js        # Constants and utility functions
    │   ├── maze.js         # Original maze layout and collision detection
    │   ├── pacman.js       # Pacman character with authentic movement
    │   ├── ghost.js        # Ghost AI with original behaviors
    │   └── game.js         # Main game controller
    ├── assets/
    │   ├── sounds/         # Audio files (generated via Web Audio API)
    │   └── images/         # Sprites (if needed)
    └── README.md           # This file

    🎯 Game Mechanics

    Movement

    • Pacman moves continuously in the chosen direction
    • Smooth grid-based movement with collision detection
    • Tunnel wrap-around on left and right sides
    • Direction queuing (press next direction before reaching intersection)

    Ghost Behavior Modes

  • SCATTER: Ghosts return to their corner targets
  • CHASE: Each ghost uses unique targeting algorithm
  • FRIGHTENED: Ghosts move randomly and slowly when power pellet is eaten
  • EATEN: Ghosts return to ghost house when eaten
  • Scoring System

    • Regular Dot: 10 points
    • Power Pellet: 50 points
    • Ghost (first): 200 points
    • Ghost (second): 400 points
    • Ghost (third): 800 points
    • Ghost (fourth): 1600 points
    • Fruit: 100 points × level number

    🛠️ Technical Details

    Technologies Used

    • p5.js: Graphics rendering and game loop
    • HTML5 Canvas: Game rendering surface
    • CSS3: Styling and responsive design
    • Vanilla JavaScript: Game logic and AI
    • Web Audio API: Sound effects

    Performance Features

    • 60 FPS gameplay
    • Efficient collision detection
    • Optimized pathfinding algorithms
    • Mobile-optimized touch controls

    🎮 Browser Compatibility

    • Chrome 60+
    • Firefox 55+
    • Safari 11+
    • Edge 79+
    • Mobile Safari (iOS 11+)
    • Chrome Mobile (Android 6+)

    🏆 High Scores

    The game includes a complete scoring system with:

    • Real-time score display
    • Lives tracking
    • Level progression
    • Game over statistics

    🤝 Contributing

    Feel free to submit issues and enhancement requests!

    📄 License

    This is a fan-made recreation for educational purposes. Pacman is a trademark of Bandai Namco Entertainment.

    © 2026 Jonathan Leahy · v1.0.9