What is AH-64D Apache Combat?
AH-64D Apache Combat is an arcade military flight sim demo where you pilot an Apache gunship over an endless, procedurally generated world of oceans, deserts, grasslands, forests, and snow-capped mountains. It is an example for anyone building a three.js flight-and-combat sim with enemies, weapons, and a tactical HUD.
Key features of AH-64D Apache Combat
A smoothed third-person chase camera with free-look, an arcade flight model with throttle, banking, and afterburner, an auto-aiming chain gun and lock-on homing missiles that are both gated by terrain line-of-sight, four enemy types with their own AI, terrain collisions that damage the aircraft, and a retro-green avionics HUD with a radar/compass, target boxes, and warnings.
How AH-64D Apache Combat was built
AH-64D Apache Combat was built and deployed straight from a single chat prompt with AppDeploy, which bundles the modular three.js source (renderer, terrain, helicopter, combat engine, and HUD) and serves it as a static single-page app on its CDN - no backend, database, or build configuration to set up. The game runs entirely client-side: an endless world of chunked terrain from layered noise (domain-warped fBm continents, ridged-multifractal mountains, and a separate moisture field for biomes), GPU-instanced foliage, a reflective water plane, and billboard clouds, with object pooling on every transient effect to hold a 60 fps target.
Prompt used to build AH-64D Apache Combat
@AppDeploy an AH-64D Apache attack-helicopter flight-and-combat sim over an endless procedural world.... It runs in the browser with three.js and should feel like an arcade military flight sim with a retro-green avionics HUD. Implement everything in working code. TECH & STRUCTURE - three.js (WebGLRenderer, antialias on, pixelRatio capped ~2). - Split into modules: main (loop + input + camera), world/terrain, helicopter model, combat engine, HUD, clouds, noise. Use object pooling for all transient FX (bullets, tracers, sparks, explosions) — zero per-frame allocation in hot loops. - A title/briefing overlay with an ENGAGE button starts the sim; ESC/Menu pauses (combat, AI, and timers all freeze while paused) and shows RESUME. CONTROLS - Mouse = free-look orbit camera ("3D lookout"); pointer-lock on click, drag fallback. - Arrow ▲/▼ = climb/descend, ◄/► = bank & turn (banking yaws the heli). - W/S = throttle, Shift = boost/afterburner, Space = gun (hold to auto-fire), F = missile. - On-screen touch buttons mirror these for mobile. CAMERA - 3rd-person chase cam, smoothed (lerp). The helicopter sits in the LOWER THIRD of the frame so the center gun reticle reads clear above it. Mouse orbits the view; recenters when idle. Subtle shake under throttle/boost. FLIGHT MODEL (arcade, not a rigid-body sim) - State: position, heading, roll, pitch, vertSpeed, throttle, speed. Smooth/eased transitions. - Forward velocity scales with throttle (+ boost multiplier). Bank → turn. Climb/descend via vertSpeed. Cosmetic pitch/roll tilt on the model. - Hard floor: cannot descend below ground + small clearance; a max altitude ceiling. - Striking ground / mountains / treetops DAMAGES the player (~2 gun-hits worth per impact, rate-limited so grinding terrain drains health rather than instakilling). Dense forest canopy is treated as solid (collidable) at treetop height. ENDLESS PROCEDURAL WORLD - Infinite chunked terrain, generated from pure functions of world (x,z) and recycled as the player moves (build nearest-first within a per-frame budget; dispose distant chunks). - Height field = layered noise: domain-warped fBm for continents/oceans, ridged multifractal for mountain ranges (gated by a low-freq mask, tall enough for snow peaks), billow for desert dunes in dry areas, plus a detail octave. An independent low-frequency MOISTURE field decides biome wetness separately from elevation. - Terrain mesh: SMOOTH-shaded. Compute per-vertex normals from the height-field GRADIENT (sample neighbors), sampling across chunk borders so adjacent chunks share identical edge normals → no lighting seams. Per-vertex biome colors. - Biomes by elevation + moisture, smoothly blended: underwater (blue, deep→shallow) → sandy shore → grassland/desert (dry=sand, wet=grass) → forest → rock → snow. Blend the water→shore transition over a wide height band so coastlines aren't blocky/grid-quantized. WATER - A flat, reflecting water plane at sea level, recentered on the player and sized to roughly the visible terrain footprint (so it shows real water in basins but never extends past the terrain into a floating slab at the horizon). Use a light-based specular material (e.g. MeshPhong with a sun glint) — NOT a metalness/PBR material (with no env map it renders black at grazing angles). Subtle color shimmer. Ground vehicles must NOT enter water (see AI). FOLIAGE - Procedural trees (e.g. a tree-generation lib, GPU-instanced), CLUSTERED into forests and tree-lines via a forest-density noise field (natural patches with clearings — never uniform scatter), only on suitable moist, mid-elevation ground. Full leafy canopies, varied species (different shapes/seeds/leaf tints). Sparse scattered bushes for ground cover. SKY / FOG / HORIZON / LIGHTING / CLOUDS - Sky: a gradient dome (deep blue zenith → pale haze near the horizon). Add a tiny per-pixel dither to the gradient to kill 8-bit banding. The horizon-haze color must equal the fog color so distant terrain melts seamlessly into the sky (no hard line). Keep the haze band hugging the horizon, not washing high into the sky. - Distance fog: gentle and FAR (terrain keeps color/detail well out), reaching full opacity just before the terrain’s draw edge so the visible horizon is a soft circular haze, not a hard square boundary. - Lighting: a warm directional sun (+ sun sprite), hemisphere light, low ambient. - Clouds: soft camera-facing billboard puffs, a few genera at different altitudes, gently drifting, with per-session variation. Recenter the cloud field on the player. PLAYER HELICOPTER - A procedural low-poly AH-64D Apache built from primitives: fuselage, tandem cockpit canopy, stub wings with weapon pylons, a spinning main rotor with a translucent blur disc, tail rotor, flat-shaded olive/military finish. A soft contact shadow on the ground that scales with altitude. ENEMIES & AI - Four kinds: drones (fast, weak, swarmy), enemy helicopters (main air threat, varied REALISTIC colors — olive/gray/desert), tanks (slow, tough, hard-hitting, rotating turret), fast jeeps (light ground harassers). Each is a procedural low-poly model. - Air units: hold a preferred altitude above terrain, slew heading toward the player, approach to a standoff range then orbit/strafe; rotors spin. - Ground units: clamp to terrain height and drive toward the player, but CANNOT enter water — only advance onto land; if blocked by water, steer to seek a land route (don’t freeze). Tanks rotate their turret to track the player. - They shoot back with dodgeable tracer bullets (per-type fire rate/damage), and they also require line-of-sight (can’t fire through terrain). SPAWNING (endless, capped) - Ambient spawns in a ring around the player, capped at a small number (~8) concurrent, staggered over time. Air threats spawn behind/to the sides (no on-screen pop-in); slow GROUND units spawn AHEAD in the player’s flight path (otherwise they’re never encountered). Despawn enemies that get too far. No ground units on water. WEAPONS (boresight + lock-on; both need line-of-sight) - A terrain LINE-OF-SIGHT check (raycast/march the height field) gates ALL fire — player gun, missile lock, and enemy fire. You cannot shoot, lock, or be shot THROUGH a hill/mountain. - GUN (Space, ~9 rounds/s, unlimited): a slaved auto-aiming chain gun. It acquires the best enemy within a wide forward cone (including well BELOW the nose, so you can hit ground targets you fly over) within a CLOSE range, and hits it hitscan. Fast, crisp tracer rounds (bright thin streaks oriented to travel direction; foreshorten to a dot when fired toward/away from the camera — never a tilted full-length tail). Muzzle flash + impact spark. - MISSILES (F): lock-on HOMING missiles. 4 charges; each fired charge regenerates ~60 s later (per-slot). Auto-lock the best enemy in a forward cone within a LONG range; homing uses LEAD prediction to intercept moving targets; tight turn rate; generous proximity fuse. ONE missile instantly kills ANY enemy. The missile is a visible metal rocket body with a round exhaust GLOW pinned just behind it (the body leads, glow trails — never a flame in front). - Health/damage: player ~100 HP; dies to a number of gun hits (or terrain impacts) or a single enemy missile-equivalent; each enemy type has its own gun-hit tolerance; all enemies die to one player missile. On death the helicopter EXPLODES (airframe hidden, multi-burst fireball + sparks, “SHOT DOWN” banner) then RESPAWNS in place at altitude with combat reset. HUD (retro military avionics — this is core to the feel) - Corner digital readouts: ALT, SPD, HDG, V/S, throttle/PWR bar. - A tactical RADAR (a corner canvas): top-down, player-centered, rotated so the nose points up. Plots terrain/biomes as FAINT dots (so they don’t compete), hostiles as BRIGHT glowing blips (red = enemy, amber = your locked target), a sweep line, an own-ship triangle, and a ROTATING COMPASS RING (N/E/S/W at the rim, N highlighted) that turns with heading — the cardinal at the top is your current heading. (No separate heading tape; the radar IS the compass.) - A slim center aiming reticle (gun pipper) at the boresight (a clean crosshair, not a busy one). - Combat overlay (DOM, world→screen projected): target boxes on visible enemies, an amber lock-on box on the locked target, 4 missile-charge pips, a player health bar, a red damage-flash vignette when hit, and a short kill feed. - Warnings: “TERRAIN — PULL UP”, “LOW ALTITUDE”, “AFTERBURNER”. VISUAL AESTHETIC - Dark retro military/avionics: phosphor-green (~#5effb0) for flight/system UI, AMBER for weapons/locks, RED for hostiles. A distinctive stencil/display title font + a monospace readout font. Subtle vignette. Clean, atmospheric, low-poly-but-smooth look. FEEL / ACCEPTANCE - It should feel like: take off, fly freely over an endless varied landscape (cross water, desert, grassland, forests, snow mountains) with a soft hazy horizon; enemies appear and fight you; you gun ground targets at close range and missile air/ground threats from standoff with lock-on; you can’t shoot through mountains; flying into terrain or being shot down blows you up and respawns you. 60 fps target. Keep all magnitudes tunable via named constants.
Live AH-64D Apache Combat demo
Open the live AH-64D Apache Combat appSee more Games apps
Backgammon AI
A Backgammon Sidekick mobile app with AI recommendations.
"AppDeploy a Backgammon Sidekick mobile app. I keep it open on my phone while playing backgammon to mirror the board and get AI help. The start screen asks who goes first and shows the board blurred in the background. On..."
Platformer Quest
Phaser 3 platformer game with runtime-generated art, arcade physics, enemy patrols, coin collection, sound effects, and responsive controls optimized for smooth browser play.
"Build a 2D platformer game using Phaser 3. Technical Setup: - Use Phaser.Physics.ARCADE with gravity.y: 1000 - Game resolution: 1280×720, scale mode FIT with CENTER_BOTH - Enable pixelArt: true, roundPixels: true,..."