A realistic 3D car simulation built with React, Three.js, and Cannon.js physics engine.
- Realistic vehicle physics and handling
- Dynamic lighting system with headlights
- Engine vibration effects
- Turbo boost mode
- Interactive speedometer
- Sound effects for engine start, acceleration, and braking
- Responsive controls
- HDR skybox environment
- Textured ground surface
- E: Toggle engine on/off
- W/โ: Accelerate
- S/โ: Reverse
- A/โ: Turn left
- D/โ: Turn right
- Space: Brake
- Shift: Activate turbo mode (6 seconds duration)
- React.js
- Three.js
- Cannon.js
- GLTF Loader
- RGBE Loader
- Clone the repository:
git clone https://github.com/Unnati-Gupta24/Car-game.git- Navigate to the project directory:
cd car-simulation- Install dependencies:
npm install- Start the development server:
npm run devcar-simulation/
โโโ public/
โ โโโ car-body/
โ โโโ textures/
โ โโโ sky/
โโโ src/
โ โโโ lib/
โ โโโ App.jsx
โ โโโ Speedometer.jsx
โ โโโ App.css
โโโ package.json
- three
- cannon-es
- react
- @react-three/fiber
- @react-three/drei
The simulation can be customized by:
- Modifying physics parameters in the vehicle setup
- Adjusting lighting intensity
- Changing car model and textures
- Tweaking control sensitivity
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is MIT licensed.