Member-only story

Coding Classic Arcade Game with Claude of Anthropic fame

Can Claude Build PacMan

Mark Lucking
Level Up Coding
10 min readFeb 10, 2025

--

Claude of Anthropic fame first draft

I had just got Claude to write the bare bones needed to create “Space Invaders” and wondered if Claude could do something more challenging. PacMan came to mind. Claude would have to build a maze, have multiple independent moving sprites and give me some means of interacting with it.

I cut to the chase and asked the question.

Claude disappeared for a few moments and came back with a very impressive first draft. It was remarkable because everything worked. I asked Claude to make the maze a little more challenging and add sound effects; he did so without missing a beat. This is his code in React.

import React, { useState, useEffect, useCallback, useRef } from 'react';

const GRID_SIZE = 28;
const CELL_SIZE = 15;

// Sound generator functions using Web Audio API
const createAudioContext = () => {
const audioContext = new (window.AudioContext || window.webkitAudioContext)();

const createWakka = () => {
const oscillator = audioContext.createOscillator();
const gainNode = audioContext.createGain();
oscillator.connect(gainNode)…

--

--

Written by Mark Lucking

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More

No responses yet

What are your thoughts?