Build a hill climb racing clone it should be functional and exact like copy
- User
Build a hill climb racing clone it should be functional and exact like copy
Assistant
I will start by exploring the existing files in the project to understand the structure.
I will read the package.json file to inspect existing dependencies.
I will install
lucide-reactandcanvas-confettito provide UI icons and celebration effects.I will read
index.htmlandsrc/index.cssto review the current base setup.I will check
src/index.css.I will update
index.htmlwith custom fonts and title to match the Hill Climb Racing arcade aesthetic.I will update
src/index.cssto configure custom styles, text outlines, and touch controls.I will create
src/types/game.tsto define the TypeScript interfaces for vehicles, physics, stages, upgrades, achievements, and game states.I will create
src/utils/audio.tsto implement a Web Audio API procedural sound engine with realistic engine revving, tire squeals, coin chimes, low-fuel alerts, crash sounds, and background music.I will fix the unused property warning in
src/utils/audio.ts.I will create
src/data/vehicles.tsto define all 9 iconic vehicles, their upgrade curves, physics configurations, and unique special upgrade mechanics.I will create
src/data/stages.tsto define the 7 stages with unique biomes, physics parameters (gravity, friction, bumpiness), custom palettes, and scenery props.I will create
src/data/hats.tsandsrc/data/quests.tsto support customization options and quest progression.I will create
src/data/quests.tswith achievements and rewards.I will create
src/physics/terrain.tsto implement smooth procedural spline terrain generation, slope/normal calculations, bridge spans, and pickup item generation.I will create
src/physics/physicsEngine.tsto implement the vehicle physics simulation, suspension spring-dampers, air pitch control, Bill Newton ragdoll/neck snap mechanics, stunt detection, and fuel drain.I will fix the unused variable warnings in
src/physics/physicsEngine.ts.I will clean up the remaining unused variables in
src/physics/physicsEngine.ts.I will fix all remaining type warnings in
src/physics/physicsEngine.ts.I will fix the variables in
src/physics/physicsEngine.ts.I will update
updateDriverHeadparameter insrc/physics/physicsEngine.ts.I will remove the unused
dtparameter fromupdateDriverHeadinsrc/physics/physicsEngine.ts.I will create
src/rendering/renderer.tsto render the camera viewport, parallax backgrounds, scenery props, terrain splines, vehicles, suspension springs, Bill Newton animations, pickups, particles, and floating stunt text.I will remove the unused imports and variables in
src/rendering/renderer.ts.I will remove the unused
ctxinrenderChassisBody.I will check occurrences of
ctxinsrc/rendering/renderer.ts.I will inspect lines 555-595 of
src/rendering/renderer.ts.I will remove
const ctx = this.ctx;fromrenderSuspensionSprings.I will create
src/utils/storage.tsto manage persistence with LocalStorage, defaults, daily reward timer, and progress saving.I will create
src/components/HUD.tsxto render the in-game HUD, including the RPM gauge, speedometer, fuel level, animated gas & brake pedals, distance meter, and pause triggers.I will create
src/components/GarageMenu.tsxto implement the vehicle garage, 4-tier upgrade shop, vehicle stats preview, and race start button.I will clean up the unused type imports in
src/components/GarageMenu.tsx.I will create
src/components/StageSelect.tsxto let players browse and unlock stages, view stage-specific physics modifiers, and see their distance high scores.I will create
src/components/DriverCustomizer.tsxto let players equip and unlock Bill Newton's hats.I will create
src/components/AchievementsModal.tsxto display quest achievements and allow players to claim coin and gem rewards.I will create
src/components/PauseModal.tsxfor in-game pause controls and settings.I will create
src/components/GameOverModal.tsxto display run results, distance milestones, coins gained, and record broken celebrations.I will update
src/App.tsxto integrate the physics simulation, canvas rendering loop, UI states, audio engine, and persistence.I will remove the unused React import from
src/App.tsx.I will check and clean up unused React imports across the components.
I will update the imports across the component files.
I will update
src/components/GarageMenu.tsx.I will update
src/components/StageSelect.tsx.I will remove unused React imports from the remaining components.
I will update
src/components/DriverCustomizer.tsx.I will update
src/components/AchievementsModal.tsx.I will update
src/components/PauseModal.tsx.I will update
src/components/GameOverModal.tsx.I will test build the project to confirm there are no compilation or bundle errors.
I will run
build_projectagain to verify production readiness.I have created a fully functional, authentic Hill Climb Racing clone featuring accurate physics, vehicles, stages, garage upgrades, driver customization, and procedural audio.
🎮 Key Features & Mechanics Built:
-
Authentic Physics Simulation & Vehicle Dynamics:
- Continuous Spline Terrain: Natural rolling hills, steep cliffs, bridges, launch ramps, and craters.
- Dual-Wheel Spring & Damper Suspensions: Dynamic compression, wheel rotation, ground friction, and terrain normal reaction.
- Classic In-Air Pitch Control:
- Pressing GAS tilts the nose up for counter-clockwise rotations (Backflips).
- Pressing BRAKE tilts the nose down for clockwise rotations (Frontflips).
- Bill Newton Driver & Neck Snap Ragdoll: Bill Newton's head reacts dynamically to acceleration and airtime. If the car flips upside-down or the driver's head impacts the terrain, his neck snaps with a ragdoll knock-out animation and triggers
"DRIVER DOWN / NECK FLIP!". - Fuel System: Depletes continuously during runs, refuels to 100% on collecting red Gas Cans, with a pulsating
"LOW FUEL"warning alarm under 20%. - Stunts Tracking: Real-time detection of Air Time, Backflips (+1,000 Coins), Frontflips (+1,000 Coins), and Wheelies (+500 Coins) with animated floating badges.
-
9 Iconic Vehicles:
- Hill Climber (Jeep): The classic red 4x4 open-top vehicle.
- Motocross Bike: Ultra agile with high air rotation torque and easy flips.
- Monster Truck: Massive tires and long suspension travel.
- Tractor: Heavy rear wheel, smokestack exhaust, and steep climbing torque.
- Super Diesel 4x4: Heavy truck with dual smokestacks and turbo boost.
- Rally Car: Low center of gravity with aerodynamic rear downforce spoiler.
- Tank: Armored body, treads grip, and heavy cannon.
- Moon Lander: Lunar research rover with rocket jump thrusters.
- Dune Buggy: Tubular roll cage chassis built for desert crests.
-
4-Tier Garage Tuning Upgrades (Up to Level 15 each):
- Engine: Boosts speed, climbing torque, and RPM.
- Suspension: Dampens heavy crater landings and shock impacts.
- Tires / Tracks: Improves traction and grip on slopes.
- Vehicle Special: Upgrades 4WD balance, air control torque, downforce, or thruster power.
-
7 Stages & Biomes:
- Countryside: Classic green rolling hills and windmills.
- Desert: Sandy dunes, pyramids, and cacti.
- Arctic Snow: Low-friction icy slopes with snowdrifts.
- The Moon: 1/6th gravity for massive orbit jumps and multi-flip chains.
- Highway: Fast asphalt roads with bridge ramps.
- Cave Caverns: Jagged rock ceilings and glowing crystal formations.
- Mars Surface: Low gravity red extraterrestrial dunes.
-
Driver Customization & Quests:
- Bill Newton Wardrobe: Equip and unlock 7 distinct hats (Default Cap, Cowboy Stetson, Racing Helmet, Viking Horns, Top Hat, Crown, Astronaut Helmet).
- Achievements & Quests: Earn extra coins and gems for distance milestones, airtime, flips, and unlocks.
- Daily Free Gift Box: Claim 10,000 coins and 10 gems every day.
-
Web Audio API Procedural Sound Engine:
- RPM-modulated engine sound synthesizer with pitch shifting and harmonic rumble.
- Distinct SFX for Coin pickups (rising pentatonic scales), Gem chimes, Gas refills, Low Fuel warnings, Crash/bone crunches, and background music.
-
Controls:
- Gas:
Right Arrow/D/Spaceor click/touch the green GAS pedal. - Brake / Reverse:
Left Arrow/Aor click/touch the red BRAKE pedal. - Pause / Restart:
Esc/P/Ror in-game HUD buttons.
- Gas:
Files built:
index.html,src/index.css,src/types/game.ts,src/utils/audio.ts,src/data/vehicles.ts,src/data/stages.ts,src/data/hats.ts,src/data/quests.ts,src/physics/terrain.ts,src/physics/physicsEngine.ts,src/rendering/renderer.ts,src/utils/storage.ts,src/components/HUD.tsx,src/components/GarageMenu.tsx,src/components/StageSelect.tsx,src/components/DriverCustomizer.tsx,src/components/AchievementsModal.tsx,src/components/PauseModal.tsx,src/components/GameOverModal.tsx,src/App.tsx-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.