I will search for files in the current directory to understand the project layout. Let's list the files.
I will check the package.json file to see what libraries are available, particularly for icon systems or 3D graphics (like Three.js or lucide-react).
I will install three (for the 3D graphics), lucide-react (for UI icons), and @types/three (for TypeScript definitions of Three.js) to build a robust 3D endless runner.
I will inspect index.html and update its title and styling to match our vibrant, arcade-style Pepsiman-inspired endless runner "Soda Rush" or "FizzMan Rush". Let's read index.html first.
I will edit index.html to set the title to "FizzMan: Soda Rush - 3D Endless Runner" and add the 'Orbitron' and 'Outfit' Google Fonts for an arcade, sporty, futuristic look.
I will create an advanced Web Audio synthesizer file src/utils/audio.ts that will generate custom arcade music and sound effects on-the-fly without requiring any heavy audio asset files. This guarantees instant load times, 100% reliable sound playback, and a rich, customizable retro atmosphere! It includes background synth-wave music, jump sweeps, slide swooshes, soda can collecting fizz, crash explosions, and menu blips. Let's create src/utils/audio.ts.
I will create the primary 3D game component src/components/GameCanvas.tsx. This file will contain the entire Three.js rendering pipeline, the procedural street and skyscraper runner layout, the skeletal animated 3D character, procedural obstacle generation (barriers, boxes, and cars), collision detection, screen-shake dynamics, and real-time particle systems (fizz bubbles, sliding sparks, crash rubble). Let's create src/components/GameCanvas.tsx.
I will edit src/components/GameCanvas.tsx to resolve the TypeScript compilation issues (removing unused variables, fixing property typos in Materials, and removing unused imports). This will ensure a clean build. Let's run edit_file.
I will read lines 1230 to 1260 in src/components/GameCanvas.tsx to inspect the exact location of the unused state variable and fix all remaining TypeScript type errors.
I will modify the materials definitions, remove the unused variables, and adjust the material properties (changing roughness to shininess) to resolve the compiler warnings in src/components/GameCanvas.tsx. Let's execute these edits.
I will read lines 240 to 305 of src/components/GameCanvas.tsx to find the exact code blocks containing gridColor and sidewalkMat with roughness so that we can replace them accurately.
I will edit src/components/GameCanvas.tsx to remove the unused gridColor variable and replace roughness: 0.8 with shininess: 2 in the sidewalk material. This solves the property type errors. Let's apply this edit.
I will replace roughness: 0.8 with shininess: 2 on the sidewalk material in src/components/GameCanvas.tsx. Let's run edit_file.
I will read lines 410 to 455 in src/components/GameCanvas.tsx to find the wooden crate boxMat definition and correct its roughness parameter.
I will modify boxMat to replace the invalid roughness parameter with shininess: 5 in src/components/GameCanvas.tsx. Let's perform this edit.
I will read lines 930 to 960 in src/components/GameCanvas.tsx to inspect the exact location of cameraZTarget and spawnDistanceCounter and remove them.
I will edit src/components/GameCanvas.tsx to remove the unused variables cameraZTarget and spawnDistanceCounter. Let's perform this edit.
I will read lines 1230 to 1255 of src/components/GameCanvas.tsx to find the exact code block with the unused state variable and delete it.
I will edit src/components/GameCanvas.tsx to remove the unused state variable inside the camera placement block. Let's run edit_file.
I will read lines 1 to 30 in src/components/GameCanvas.tsx to double check the exact prop structure and integrate character customization skin choices.
I will read lines 130 to 160 of src/components/GameCanvas.tsx to find the material colors and replace them with dynamic colors determined by the selected skin prop.
I will edit the top portion of src/components/GameCanvas.tsx to declare the skin prop on the component interface and destructure it. Let's apply this edit.
I will read lines 120 to 155 in src/components/GameCanvas.tsx to find the exact placement of the materials and configure our skin-specific coloring.
I will edit src/components/GameCanvas.tsx to set up the color mappings for the four customized player skins ("Original Blue", "Cherry Pink", "Lime Green", and "Gold Rush"). Let's execute this edit.
I will read the end of the primary useEffect in src/components/GameCanvas.tsx (lines 1300 to 1340) to add skin to its dependency array, which ensures that switching characters in the UI immediately updates the 3D canvas rendering.
I will edit the main useEffect dependency array in src/components/GameCanvas.tsx to include skin, enabling dynamic rendering when a player changes their character skin. Let's run edit_file.
I will create src/components/GameUI.tsx to handle the entire user interface and HUD overlay. It includes a Start Screen with character customization (each skin has unique gameplay perks), a High Scores leaderboard, an interactive "How to Play" tutorial, a heads-up display (HUD) with live scoring, distance meter, can counter, and manual Hyper Boost button, plus high-fidelity Pause and Game Over states. Let's create src/components/GameUI.tsx.
I will check the original content of src/App.tsx before replacing it with the central game manager that ties the 3D graphics, user interface, and synthesized audio together.
I will read lines 835 to 870 of src/components/GameCanvas.tsx to find the exact location of can collection and implement the custom character perks dynamically.
I will search the canvas file for where the player collects Pepsi cans so we can implement the custom perks.
I will read lines 1160 to 1195 of src/components/GameCanvas.tsx to find the exact details of can collection, including score updates and boost additions, so that we can insert the gameplay perks for each character skin.
I will search for occurrences of canChain inside GameCanvas.tsx to find where the score multiplier is handled, and implement character perks there as well.
I will read lines 1010 to 1035 in src/components/GameCanvas.tsx to find the speed acceleration and multiplier update calculations, so we can implement the special skin perks dynamically.
I will read lines 995 to 1015 in src/components/GameCanvas.tsx to get the context around speed and acceleration update, in order to modify it cleanly.
I will edit src/components/GameCanvas.tsx to implement dynamic speed scaling and multiplier decay modifiers based on the selected character skin:
- Sour Lime (Green): Gaining +15% base speed boost, faster acceleration, and longer multiplier holding.
- Original Blue: Getting higher multiplier multipliers (needs fewer cans to level up). Let's edit this part.
I will edit src/components/GameCanvas.tsx inside the can collection checker to implement special perks for Cherry Pop (Pink - 1.5x boost fill rate) and Gold Rush (Gold - double points on collecting cans). Let's run edit_file.
I will create the main entry file src/App.tsx to serve as the game coordinator. It bridges the state between the Three.js 3D rendering canvas and the interactive HTML Heads-Up Display (HUD) overlay. It controls starting, pausing, high score updates, and triggering the manual Pepsi "Hyper Boost" mode with synthesised audio tracks. Let's create src/App.tsx.
I will trigger a project build using the build_project tool to verify that all our files compile perfectly and the project is production-ready.
I have successfully built a browser-based, high-performance 3D endless runner game inspired by Pepsiman, called FizzMan: Soda Rush.
Here is a summary of the key systems and polish integrated into the game:
🎮 Gameplay & Core Loop (First 10 Seconds)
- Immediate Immersion: The player starts on a flashy start screen. Tap START RUN and the camera immediately sweeps behind the player, who automatically sprints forward down a bright retro-cyberpunk city highway.
- Hyper-Responsive Controls: Supports PC keyboards (W/A/S/D, Arrow Keys, and Space or Shift) as well as fully integrated Mobile Swipe Gestures (swipe left, right, up to jump, and down to slide).
- High Juice & Feedback:
- Dynamic Screen Shake: Generates instant camera jolts on crashes, near-misses, or when smashing obstacles.
- Juicy Particle Systems: Emits bright blue-red-white soda bubbles when collecting cans, friction-based fire sparks during slides, cyber wind trails during hyper-speed runs, and a massive physical debris shatter when crashing.
- Visual Animations: A skeletal procedural 3D model that moves parts in mathematical waves to animate runs, knee-bending slides, and acrobatic jumps in mid-air.
🚗 Procedural 3D Environment & Layout
- Endless Generation: Procedurally spawns obstacles (yellow/black stripe barriers to jump over, elevated warnings to slide under, crates, and parked/slow-moving street cars) and curves of shiny spinning soda cans ahead of the player.
- Synthwave Arcades Aesthetic: Features soaring cyberpunk skyscrapers with neon-light indicators, glowing sidewalk curbs, street lights, and dynamic canvas-based advertisement billboards reading "FIZZ MAN", "SODA RUSH", and "BOOST COLA".
- Automatic recycling: Moves and rebuilds road segments and scenery elements behind the player, ensuring smooth execution without memory leaks.
🎭 Character Customization & Perks
Includes four selectable formula character skins, each bringing an asymmetric tactical advantage:
- Original Blue: The classic formula. Reaches higher point multipliers more easily (requires fewer cans to level up).
- Cherry Pop (Pink): High carbonation formulation. Collectible cans charge up the Hyper-Boost meter 1.5x faster!
- Sour Lime (Green): Instant energy formula. Provides a persistent speed multiplier and retains points chains longer before decay.
- Gold Rush (Gold): Pure liquid luxury. Grants Double Points for every soda can collected!
⚡ Manual Hyper-Boost Mode
- Collecting cans charges the neon-green Soda Booster gauge at the bottom.
- Once it reaches 100%, players can hit SPACE/SHIFT (or tap the flashing on-screen prompt on mobile) to activate HYPER BOOST!
- In this mode, the runner goes completely invulnerable, accelerates to supersonic speeds, leaves blue-cyan speed trails behind, and smashes obstacles to smithereens for major point bonuses!
🔊 Retro Audio Synthesizer (Zero asset loading required)
- Built a custom synthesizer using the Web Audio API (
src/utils/audio.ts) that generates real-time audio on-the-fly.
- Features a driving arcade synthwave background track (with synthesized kick drums, hats, bass lines, and melody leads).
- Responsive sound effects: Chime opens for soda cans, wind friction swooshes for sliding, high-pitched sweeps for jumping, and low-end bass explosions for crashes.
🏆 Polished UI & Local Scoreboard
- Sleek heads-up display showing live scores, distance run, multiplier progress rings, and active boosts.
- Interactive start screen and collapsable control manual.
- Local High Scores: Saves and tracks elite runs locally, allowing high-scorers to record their name.
- Responsive layouts optimized for desktop widescreen monitors down to small vertical mobile screens.
Files built: index.html, src/utils/audio.ts, src/components/GameCanvas.tsx, src/components/GameUI.tsx, src/App.tsx