Skip to content

Josephat-S/Car-driving-game-using-JavaScript-vanilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Driving Game using JavaScript (Vanilla)

A simple yet engaging car driving game built with pure JavaScript, HTML, and CSS—no frameworks or libraries required! This game showcases the fundamentals of game development in the browser, including real-time animation, collision detection, and responsive controls.

🚗 Features

  • Smooth Car Controls: Use keyboard keys to steer, accelerate, and brake your car.
  • Obstacle Avoidance: Dodge dynamically generated obstacles as you drive.
  • Score Tracking: Rack up your high score the longer you survive.
  • Responsive UI: Works seamlessly on desktop browsers.
  • Custom Graphics: All visuals created with vanilla HTML/CSS/JS—no images or external assets.

🎮 How to Play

  1. Clone the repo:

    git clone https://github.com/Josephat-S/Car-driving-game-using-JavaScript-vanilla.git
    cd Car-driving-game-using-JavaScript-vanilla
  2. Open the game:

    • Open index.html in your favorite browser.
  3. Controls:

    • Arrow Keys: Steer left/right, accelerate, and brake.
    • Spacebar (optional): Pause or restart the game if implemented.
  4. Objective:

    • Avoid oncoming obstacles for as long as possible and achieve the highest score!

🛠️ Built With

  • JavaScript (Vanilla/Plain)
  • HTML5
  • CSS3

📁 Project Structure

├───index.html
├───README.md
│
├───CSS
│       styles.css
│
├───JS
│   │   aiVehicles.js
│   │   car3d.js
│   │   environment.js
│   │   game.js
│   │   obstacles.js
│   │   radio.js
│   │   road.js
│   │   roadSigns.js
│   │   scenery.js
│   │   sound.js
│   │
│   └───lib
│           zzfx.js
│           zzfxm.js
│
└───Screenshots
        Screenshot 1.png
        Screenshot 2.png
        Screenshot 3.png

✨ Demo

## 🚀 Contributing

Pull requests are welcome! If you have suggestions for improvements or new features, please open an issue or submit a PR.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

📄 License

This project is open source and available under the MIT License.

🙌 Acknowledgments

  • Inspired by classic car games and browser-based arcade projects.
  • Thanks to all contributors and users!

Enjoy driving and coding! 🚦

About

A lightweight browser-based 3D car driving game built with HTML, CSS, and JavaScript — no external assets, just pure code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published