Build a Call of Duty-style mobile zombie mansion game in Three.js

This prompt helps you get the job done faster: "Build a Call of Duty-style mobile zombie mansion game in Three.js". Copy the ready-to-paste prompt, fill in the bracketed details for your situation, and run it in your AI tool for a high-quality first draft you can refine in minutes.

The prompt

# Role
You are a senior WebGL/Three.js game developer who specializes in mobile-friendly, procedurally generated games with no external assets.

Before you begin, ask me for: (1) the target phone/browser and whether performance or visuals matter more, (2) preferred art tone (gritty realistic or slightly stylized), (3) any weapon, zombie, or mansion ideas I want included. If I don't answer, make reasonable assumptions and state them at the top of your response.

# Goal
Produce a complete, playable, first-person, Call of Duty Zombies-style survival game set in a medium-sized mansion at night during a thunderstorm. The player barricades windows with wood planks, earns points, buys random weapons from a mystery box, and survives 5 waves to win. It must run in a mobile browser with touch controls.

# Hard technical constraints
- Use Three.js only, pinned to one exact stable release (for example 0.160.0) loaded through an import map from a reputable CDN (such as jsDelivr or unpkg). Never use 'latest' or a floating version. Only use APIs that exist and are not deprecated in the pinned version. State the version and URL you chose.
- No external assets at all: no images, models, fonts, audio files, or textures. Generate everything in code: geometry from primitives, textures via canvas (CanvasTexture), sounds via the Web Audio API (oscillators and noise), HUD via HTML/CSS.
- Deliver as a single self-contained index.html (inline CSS and JS) unless I ask otherwise.
- Put all tunable numbers (prices, damage, health, wave sizes, speeds, light counts) in a single CONFIG object at the top so I can tweak them. Do not claim real-world balance values; just choose sensible defaults.
- Must be performance-conscious for mid-range phones: cap pixel ratio (about 1.5 to 2), limit real-time shadows (moonlight only, or none), limit real PointLights (roughly 6 to 10, no shadows on them), and fake the rest of the candles with emissive flame meshes or sprites plus flicker. Reuse geometries and materials, pool zombies and particles, and avoid per-frame allocations.

# Game design requirements
## Setting and atmosphere
- Medium mansion, about 6 to 8 connected rooms on a ground floor (for example foyer with grand staircase, hallway, dining room, library, kitchen, living room, study). An upper balcony is optional if performance allows.
- Realistic interior detailing built procedurally: canvas wood-plank floors, wallpaper with pattern, wainscoting, baseboards, crown molding, door frames, rugs, a chandelier, fireplaces, bookshelves with varied book spines, a dining table and chairs, sofas, paintings (procedurally painted on canvas), curtains, cabinets, clutter, cobweb or dust touches.
- Night with cool moonlight through the windows (directional or spot light), many candles (on tables, shelves, mantels, chandelier) with flickering warm light, and a low hemisphere/ambient light so no area is ever pitch black.
- Thunderstorm: animated rain visible outside windows, periodic lightning that flashes the scene and window glow, synthesized thunder with delay after the flash, wind and rain ambience, and subtle fog.

## Player and touch controls (first person)
- Left-side virtual joystick for movement, right-side drag area for look (with sensitivity setting), on-screen buttons for fire, reload, interact/hold-to-repair/buy, switch weapon, and optional sprint. Provide an optional auto-fire toggle.
- Handle multi-touch properly with touch/pointer identifiers, prevent page scroll, pinch zoom, and text selection (touch-action: none, viewport meta), and handle landscape orientation and resize. Also include keyboard and mouse fallback for desktop testing.
- Collision against walls and furniture (simple AABB or circle checks). HUD: health with damage vignette, points, wave number, zombies remaining, ammo, weapon name, and contextual prompts such as 'Hold to repair' or 'Buy Mystery Box (cost)'.

## Barricades
- At least 6 windows, each with several wooden plank slots. Zombies approach windows, tear planks off one at a time (with sound and flying splinters), then climb through when the planks are gone.
- The player stands near a window and holds interact to rebuild planks one by one, earning points for each. Planks are visibly animated onto the window.

## Zombies (lifelike for a procedural game)
- Build articulated models from grouped primitives (head, jaw, torso, upper and lower arms, upper and lower legs) with canvas-generated skin, torn clothes, and blood textures, plus glowing or sunken eyes. Add per-zombie variation in size, color, and clothing.
- Procedural animations: shambling walk cycle, running variant, arms-outstretched lurch, attack swing, hit reaction, death fall, window-climbing, and a crawling variant.
- Variety increasing by wave: Wave 1 walkers only; Wave 2 adds runners; Wave 3 adds heavy brutes with more health; Wave 4 adds crawlers and a ranged or special type; Wave 5 adds a boss-like mini-boss alongside the horde.
- AI: use waypoints or a simple navigation grid so zombies path to their assigned window, attack the barricade, enter, then chase the player around walls without getting stuck. Add separation so zombies do not stack perfectly.

## Waves and win/lose
- Exactly 5 waves, with scaling counts, a short break between waves with a banner, and a win screen after wave 5 is cleared. Game over screen when the player dies, with a restart button. Include a start screen with a short controls explanation and a fullscreen/start button (needed to unlock audio on mobile).

## Economy, weapons, and mystery box
- Points for hits, kills (bonus for headshots), and repairing planks.
- At least one mystery box in the mansion with a glowing, animated look. The player pays a CONFIG price to open it; it cycles through weapon previews, then reveals a random weapon the player can take within a few seconds, or it is lost. Use weighted randomness.
- At least 6 weapons: starting pistol plus for example revolver, SMG, shotgun, assault rifle, LMG, and one special rare weapon. Each has procedurally built first-person viewmodels, muzzle flash, recoil and sway animation, reload animation, ammo counts, fire rate, spread, and damage in CONFIG. Player can carry 2 weapons.

## Audio
- Fully synthesized: gunshots per weapon, reloads, zombie groans, plank and hit sounds, box jingle, thunder, rain, and wave start stinger. Add a mute toggle.

# Process
Think step-by-step before coding. First write a concise plan covering: file/section architecture, scene graph layout, mansion floor plan with coordinates of rooms, windows, the mystery box, and the spawn point, the zombie AI approach, and the lighting budget. Then write the code.

# Output format
1. Assumptions and chosen Three.js version (short list).
2. The plan (concise bullet points, including an ASCII floor plan).
3. The complete index.html in a single code block, with clear section comments. No stubs, TODOs, or pseudo-code. If length limits prevent the full game, deliver a complete working core first (movement, mansion, windows and barricades, zombies, waves, mystery box, win/lose) and tell me exactly what to ask for next to add the rest.
4. Short notes: how to run it, the controls, which CONFIG values to tweak for difficulty and performance, and any known limitations.

# Self-review before answering
Check that: all imports resolve for the pinned version; there are no undefined variables or references to external files; touch controls work simultaneously; there are no per-frame memory leaks; the game is winnable and loseable; and the scene is never totally dark. Fix any issue you find before giving the final answer.
Share: X LinkedIn

How to use it

  1. 1Open your preferred AI assistant (Claude works well for long code outputs) and paste the whole prompt into a new chat. Use a model and mode that allows long responses.
  2. 2When the AI asks its opening questions, answer briefly: your phone or browser, realistic versus stylized look, and any extra weapons or zombie ideas. If you skip them, it will state its assumptions.
  3. 3Copy the full code block it gives you into a plain text file named index.html. If the response is cut off, reply 'continue the code exactly where you stopped' and join the parts.
  4. 4Test it: open the file in a browser first, then on your phone. For phone testing, upload the file to a free host such as Netlify (drag and drop) and open the link in landscape mode.
  5. 5Iterate with specific feedback like 'zombies get stuck in the kitchen', 'make candles brighter', 'reduce lag' or 'add a sixth weapon', and ask the AI to return the full updated file or only the changed sections.

Recommended tools

Related prompts

Frequently asked

What does the "Build a Call of Duty-style mobile zombie mansion game in Three.js" prompt do?

This prompt helps you get the job done faster: "Build a Call of Duty-style mobile zombie mansion game in Three.js". Copy the ready-to-paste prompt, fill in the bracketed details for your situation, and run it in your AI tool for a high-quality first draft you can refine in minutes.

Which AI tool is this prompt for?

It works in any AI assistant. Paste it into ChatGPT, Claude, Gemini, or your tool of choice and adjust the formatting if needed.

How do I use this prompt?

Copy the prompt, replace any bracketed placeholders with your own details, and paste it into your AI assistant. Then follow the setup steps on this page to refine the output.

Want a prompt tailored to your exact task?

Remix this in the builder →