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.
- 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.
-
Clone the repo:
git clone https://github.com/Josephat-S/Car-driving-game-using-JavaScript-vanilla.git cd Car-driving-game-using-JavaScript-vanilla
-
Open the game:
- Open
index.html
in your favorite browser.
- Open
-
Controls:
- Arrow Keys: Steer left/right, accelerate, and brake.
- Spacebar (optional): Pause or restart the game if implemented.
-
Objective:
- Avoid oncoming obstacles for as long as possible and achieve the highest score!
- JavaScript (Vanilla/Plain)
- HTML5
- CSS3
├───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
Pull requests are welcome! If you have suggestions for improvements or new features, please open an issue or submit a PR.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
This project is open source and available under the MIT License.
- Inspired by classic car games and browser-based arcade projects.
- Thanks to all contributors and users!
Enjoy driving and coding! 🚦