Yesterday marked a significant milestone in AI development with the release of GPT-5, and naturally, I couldn't resist putting it to the test against Anthropic's Claude Opus 4.1. While I've been using Claude as my go-to AI companion, I'm committed to keeping this comparison as unbiased as possible.
Disclaimer of liability: This is by no means a scientific experiment. Both companies and their models are incredibly strong, and this challenge does not represent the optimal way to use these AI systems. But it was undoubtedly entertaining!
The Challenge: One-Shot Pacman Development
The goal was simple but ambitious: to create a fully functional Pacman game from a single prompt, with no customizations, modifications or follow-up instructions.
Phase 1: Prompt Engineering
Instead of using identical prompts (which would miss half the fun), I decided to test both models' prompt engineering capabilities. I gave each AI the same initial request:
"I want to build a pacman game, create a prompt to build it in plain html css and js so we can run it on web."
Both models rose to the occasion, generating comprehensive prompts for game development.
OpenAI's Generated Prompt:

# Prompt - Build a classic Pac-Man clone in plain HTML/CSS/JS
**Goal:** Build a playable Pac-Man clone that runs in a modern browser using only plain HTML, CSS and JavaScript (no frameworks or external libraries). Deliver a single runnable package (either a single `index.html` with embedded CSS/JS or a small project with `index.html`, `styles.css`, `game.js`) that can be opened locally and played.
---
## Required features (must-have)
1. **Canvas-based rendering**
* Use an HTML `` element for the game view (no DOM grid for tiles).
* The canvas should scale responsively but maintain game logic on a fixed grid (e.g., 28×31 tile grid or similar).
2 **Map & tiles**
* A tile map for walls, pellets, power pellets, empty space, and spawn points.
* Draw walls as simple shapes (rounded rectangles/lines) - no external images required.
* Provide an easy-to-edit map array in `game.js`.
3 **Pac-Man**
* Smooth movement on the grid (not teleporty). Pac-Man should accelerate to a constant speed and slide between tiles.
* Keyboard controls: arrow keys (↑ ↓ ← →). Support WASD optionally.
* Mouth animation (open/close) that faces movement direction.
4. **Pellets and power pellets**
* Small pellets that increase score when collected and disappear.
* Power pellets (larger) that put ghosts into frightened mode for a limited time.
5. **Ghosts**
* Four ghosts with distinct starting positions and colors.
* Ghost behavior approximating classic states: **scatter**, **chase**, and **frightened**.
* Implement at least one simple pathfinding approach (BFS or A\* on tile-grid) so ghosts can navigate around walls toward a target tile.
* When frightened, ghosts move randomly and are edible. When eaten, they return to a "home" box and then resume.
6 **Collision & lives**
* Collision detection between Pac-Man and ghosts.
* Lives counter (3 lives by default); losing all lives ends the game with a game over screen.
7. **Scoring and HUD**
* Score display, current level, and remaining lives shown outside or above the canvas.
* Points for pellets, power pellets, and eating ghosts (increasing multiplier).
8. **Win/lose and level progression**
* Clear level when all pellets are eaten. Advance to next level with same map or increased difficulty (ghost speed increase or shorter frightened time).
* Game Over and Level Complete screens with options: Restart Level / Restart Game.
9. **Sound (optional, but encouraged)**
* Add simple sounds using WebAudio or `
Claude's generated prompt:

# Prompt: Build a Web-Based Pacman Game
Create a fully functional Pacman game using HTML5, CSS3, and vanilla JavaScript that runs in a web browser. The game should capture the classic Pacman experience with smooth gameplay and responsive controls.
## Core Requirements
### Game Board
- Create a 19x21 grid-based maze layout similar to the classic Pacman design
- Include walls that Pacman and ghosts cannot pass through
- Place small dots (pellets) throughout the maze for Pacman to collect
- Add 4 power pellets in the corners that give Pacman temporary ghost-eating ability
- Display the current score and high score at the top of the game
- Show remaining lives (start with 3 lives)
### Pacman Character
- Render Pacman as a yellow circle with an animated mouth that opens/closes while moving
- Implement smooth movement through the maze (not jumpy/teleporting)
- Control Pacman using arrow keys or WASD keys
- Pacman should move continuously in the last pressed direction until hitting a wall
- Allow queuing the next direction (if player presses a key while Pacman is moving, execute the turn when possible)
- Implement wraparound tunnels on the sides of the maze
### Ghost Behavior
- Create 4 ghosts with different colors: Blinky (red), Pinky (pink), Inky (cyan), Clyde (orange)
- Implement basic AI for ghost movement:
- Blinky: Chases Pacman directly
- Pinky: Tries to position ahead of Pacman
- Inky: Uses a combination of Blinky's position and Pacman's direction
- Clyde: Chases when far, scatters when close
- Ghosts should start in a "ghost house" in the center and be released gradually
- When Pacman eats a power pellet, ghosts turn blue and flee from Pacman
- Eaten ghosts return to the ghost house as eyes before regenerating
### Game Mechanics
- Eating pellets: 10 points each
- Eating power pellets: 50 points each
- Eating ghosts: 200, 400, 800, 1600 points in sequence per power pellet
- Bonus fruit appears twice per level (100-5000 points depending on level)
- Game speeds up slightly with each level
- Extra life awarded at 10,000 points
### Visual Design
- Use a dark/black background for the maze
- Blue walls for the maze structure
- White pellets, larger white power pellets
- Smooth animations for all character movements
- Ghost eyes should look in their direction of movement
- Add a flashing effect when power pellet is about to wear off
### Sound Effects (Optional Enhancement)
- Background music during gameplay
- Waka-waka sound when eating pellets
- Different sound when eating power pellets
- Sound when eating ghosts
- Death sound when Pacman loses a life
- Victory sound when completing a level
### Game States
- Start screen with "Press SPACE to Start" message
- Pause functionality (press P or ESC)
- Game over screen showing final score
- Level complete screen before advancing to next level
- Ready message before each life starts
### Technical Implementation Details
**HTML Structure:**
- Single canvas element for game rendering
- Div containers for score, lives, and game messages
- Simple, semantic HTML5 structure
**CSS Styling:**
- Center the game on the page
- Retro arcade font for text (use Google Fonts: "Press Start 2P")
- Responsive design that scales appropriately
- Dark theme to match arcade aesthetic
**JavaScript Architecture:**
- Use object-oriented approach with classes for Pacman, Ghost, Game, etc.
- Implement game loop using requestAnimationFrame for smooth 60 FPS
- Separate concerns: rendering, game logic, input handling, collision detection
- Use 2D canvas context for all drawing operations
- Implement efficient collision detection using grid-based positioning
### Performance Optimization
- Use sprite sheets or canvas drawing for graphics
- Implement dirty rectangle rendering (only redraw changed areas)
- Optimize pathfinding algorithms for ghosts
- Minimize DOM manipulation during gameplay
### Code Organization
```
- index.html (minimal HTML structure)
- style.css (all styling)
- game.js (main game logic and loop)
- pacman.js (Pacman class and behavior)
- ghost.js (Ghost classes and AI)
- maze.js (Maze generation and collision detection)
- utils.js (Helper functions and constants)
```
### Additional Features to Consider
- Local storage for high score persistence
- Touch controls for mobile devices
- Difficulty settings (Easy, Normal, Hard)
- Classic mode vs Modern mode (with updated graphics)
- Two-player mode where second player controls ghosts
## Deliverable
Create a single HTML file with embedded CSS and JavaScript that can be opened directly in any modern web browser. The game should be immediately playable without any build process or server requirements. Ensure smooth performance on Chrome, Firefox, Safari, and Edge browsers.
The final game should feel responsive, challenging, and true to the original Pacman experience while leveraging modern web technologies for smooth gameplay.
Phase 2: Game Development
I opened fresh chat sessions for each model and unleashed their respective prompts. Remarkably, both AI systems delivered working, playable Pacman games on their first attempt.
Results Comparison
Metrics | ChatGPT-5 | Claude Opus 4.1 |
---|---|---|
Prompt length | 155 lines | 112 lines |
Generated code | 550 lines | 863 lines |
Game functionality | Works | Works |
Success at the first attempt | Yes | Yes |
Key Differences
Code Verbosity: Claude generated significantly more code (863 vs 550 lines), suggesting a more detailed implementation approach, while GPT-5 opted for a more concise solution.
Prompt Engineering: GPT-5 created a longer, more detailed prompt (155 lines vs 112), indicating different approaches to instruction comprehensiveness.
Try It Yourself
To maintain complete transparency and allow you to judge for yourself, I've made both chat sessions public:
Click through and play both versions to see which implementation resonates more with you!
Conclusion
Both models demonstrated impressive capabilities in single-shot game development. The choice between them might come down to personal preference: GPT-5's concise efficiency versus Claude's detailed thoroughness. What's certain is that we're witnessing an exciting era where AI can transform simple requests into fully functional applications.
What are your thoughts? Which implementation did you prefer? Let me know in the comments!