Skip to content

Unnati-Gupta24/Car-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

3D Car Simulation

A realistic 3D car simulation built with React, Three.js, and Cannon.js physics engine.

๐Ÿš— Features

  • 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

๐ŸŽฎ Controls

  • E: Toggle engine on/off
  • W/โ†‘: Accelerate
  • S/โ†“: Reverse
  • A/โ†: Turn left
  • D/โ†’: Turn right
  • Space: Brake
  • Shift: Activate turbo mode (6 seconds duration)

๐Ÿ› ๏ธ Technologies Used

  • React.js
  • Three.js
  • Cannon.js
  • GLTF Loader
  • RGBE Loader

โš™๏ธ Installation

  1. Clone the repository:
git clone https://github.com/Unnati-Gupta24/Car-game.git
  1. Navigate to the project directory:
cd car-simulation
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

๐Ÿ—‚๏ธ Project Structure

car-simulation/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ car-body/
โ”‚   โ”œโ”€โ”€ textures/
โ”‚   โ””โ”€โ”€ sky/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”œโ”€โ”€ Speedometer.jsx
โ”‚   โ””โ”€โ”€ App.css
โ””โ”€โ”€ package.json

๐Ÿ”ง Dependencies

  • three
  • cannon-es
  • react
  • @react-three/fiber
  • @react-three/drei

๐ŸŽจ Customization

The simulation can be customized by:

  • Modifying physics parameters in the vehicle setup
  • Adjusting lighting intensity
  • Changing car model and textures
  • Tweaking control sensitivity

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

๐Ÿ“ License

This project is MIT licensed.

About

A realistic 3D car simulation built with React, Threejs and Cannonjs physics engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published