You are an expert 3D web game and assets developer. Create a clone game of Temple Run.
- User
You are an expert 3D web game and assets developer. Create a clone game of Temple Run.
Assistant
I will read
package.jsonto inspect the installed dependencies and project structure.I will now install
three,@types/three,@react-three/fiber,@react-three/drei,lucide-react, andcanvas-confettiso we can build a high-performance 3D Temple Run clone with rich 3D graphics, procedural jungle temple environments, shaders, and animations.I will install
three,@types/three,@react-three/fiber,@react-three/drei,lucide-react, andcanvas-confetti.I will list the files in the
srcdirectory to see the project structure.I will read
index.htmlto inspect its contents and title.I will read
src/index.cssto inspect the styles and font configuration.I will update
index.htmlto set the title to "Temple Run 3D: Relic Escape", include adventurous Google Fonts (Cinzel Decorative,Rajdhani, andCinzel), and add appropriate meta tags for mobile/desktop play.I will update
src/index.cssto define font utilities forCinzel Decorative,Cinzel, andRajdhani, along with keyframes for glowing gold effects, pulse animations, and UI overlays.I will create
src/types/game.tscontaining the TypeScript definitions for game state, segments, obstacles, power-ups, characters, themes, shop upgrades, and achievements.I will create
src/utils/soundManager.tsusing the browser's native Web Audio API to procedurally generate tribal jungle drum background music, coin chimes, jump/slide swooshes, demon beast roars, and power-up fanfare sounds.I will create
src/utils/storage.tsto managelocalStoragepersistence for high scores, coins, shop upgrades, characters, themes, and achievements, as well as define the character and theme configurations.I will create
src/utils/generator.tsto procedurally generate endless temple path segments, stone corners, obstacles, coin trails, red gems, and power-up collectibles.I will create
src/components/3d/RunnerCharacter.tsxcontaining the procedural 3D character model with animated limbs, customizable skins, running, jumping, sliding, and stumbling animations.I will create
src/components/3d/DemonBeast.tsxto render the Shadow Demon Beast with glowing red eyes, dark fur, claws, and dynamic chasing animations.I will create
src/components/3d/Collectibles3D.tsxto render rotating gold coins, red gems, and power-ups (magnet,shield,boost) with glowing halos and floating animations.I will update
src/components/3d/Collectibles3D.tsxto remove the unusedlabelvariable and clean up the component.I will create
src/components/3d/TempleSegment3D.tsxto render the ancient stone temple floors, side guardrails, jungle trees, torches with glowing fire flames, turn corners with glowing indicators, and all obstacle types (fallen_tree,low_arch,fire_brazier,broken_gap,stone_block,swinging_blade).I will update
src/components/3d/TempleSegment3D.tsxto remove the unusedObstacleDataimport.I will create
src/components/3d/TempleScene.tsxwhich contains the Three.js canvas, lighting, fog, camera tracking, dynamic endless segment generation, collision detection (coins, gems, power-ups, obstacles, turns, pitfalls), and touch/keyboard controls.I will update
src/components/3d/TempleScene.tsxto remove the unused imports and variable declarations.I will create
src/components/ui/HUD.tsxto display the in-game distance, score, coins, power-up timers, pulsing turn direction alerts, pause button, and touch/mouse action buttons.I will create
src/components/ui/MainMenu.tsxfeaturing an adventurous ancient relic theme, high score display, character & theme selector, and navigation to the shop, achievements, leaderboard, and tutorial guide.I will create
src/components/ui/ShopModal.tsxto let players spend their collected coins on power-up upgrades (coin value, magnet, shield, boost durations), character unlocks, and temple theme unlocks.I will create
src/components/ui/GameOverModal.tsxto display the run summary, score breakdown, high score celebrations with confetti, unlocked achievements, and restart options.I will update
src/components/ui/GameOverModal.tsxto remove the unused import.I will create
src/components/ui/AchievementsModal.tsxto display game achievements, progress bars, unlocked status badges, and coin rewards.I will create
src/components/ui/LeaderboardModal.tsxto display local high scores, distances run, characters used, and run timestamps.I will create
src/components/ui/ControlsGuideModal.tsxcontaining an interactive tutorial for keyboard, touch swipe, and turn control mechanics.I will create
src/App.tsxwhich integrates the 3D game engine, audio sound manager, shop upgrades, achievement tracking, high score leaderboard, HUD, and modal interfaces.I will update
src/App.tsxto remove the unusedReactdefault import.I will now test and build the project using
build_projectto verify that there are no TypeScript or bundling errors.I have created an authentic Temple Run 3D: Relic Escape web game clone using React, Three.js /
@react-three/fiber, Tailwind CSS, and the browser's native Web Audio API.🏛️ Features Included:
- Endless 3D Temple Environment:
- Procedural Temple Segments: Weathered ancient stone pavements, mossy borders, guardrails, and glowing torch pillars every 8 meters with dynamic flame particles.
- Dynamic Lighting & Fog: Choose between Jungle Sunset, Midnight Temple (blue sapphire moonlight), and Inferno Caldera (volcanic lava glow).
- Iconic Temple Run Hazards & Mechanics:
- Fallen Mossy Logs: Jump over (
W / ArrowUp / Space / Swipe Up). - Ancient Stone Arches & Swinging Blades: Slide under (
S / ArrowDown / Swipe Down). - Broken Floor Gaps: Leap across open abysses.
- Fire Braziers & Fallen Stone Pillars: Switch between 3 lanes (
A / D / ← → / Swipe Left / Right). - Stone Turn Junctions: When a golden turn arrow appears, time your turn to round the L-shaped corner.
- Fallen Mossy Logs: Jump over (
- Playable Characters & Shadow Demon Beast:
- The Shadow Demon Beast: Roars and chases right behind the runner with glowing red eyes and a dark shadow fur aura.
- 4 Unlockable Playable Characters:
- Guy Dangerous (The Relic Explorer - Default)
- Scarlett Fox (Cunning Escape Artist — +20% Coin Bonus)
- Karma Shadow (Mystic Jungle Ninja — +25% Score Bonus)
- Pharaoh Golden (Immortal Sun King — +30% Coins & +30% Score)
- Power-Ups & Shop Upgrades:
- Coin Magnet (M): Automatically pulls gold coins and red gems from all lanes.
- Guardian Shield (S): Protects against one collision or stumble.
- Sprint Boost (B): Grants super speed and invincibility, smashing through obstacles.
- Relic Vault & Shop: Spend collected coins to upgrade durations (Lv 1–5), unlock characters, and unlock temple themes.
- Audio Engine (Web Audio API):
- Procedural tribal jungle drum music loop, metallic coin chimes, whooshing jump/slide sound effects, demon beast roars, and power-up fanfare.
- Progression & Leaderboards:
- Local
localStoragepersistence for high scores, max distance records, collected coins, upgrades, and achievement badges.
- Local
Files built:
index.html,src/index.css,src/types/game.ts,src/utils/soundManager.ts,src/utils/storage.ts,src/utils/generator.ts,src/components/3d/RunnerCharacter.tsx,src/components/3d/DemonBeast.tsx,src/components/3d/Collectibles3D.tsx,src/components/3d/TempleSegment3D.tsx,src/components/3d/TempleScene.tsx,src/components/ui/HUD.tsx,src/components/ui/MainMenu.tsx,src/components/ui/ShopModal.tsx,src/components/ui/GameOverModal.tsx,src/components/ui/AchievementsModal.tsx,src/components/ui/LeaderboardModal.tsx,src/components/ui/ControlsGuideModal.tsx,src/App.tsx- Endless 3D Temple Environment:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.