Version 3 of the Moving Car project โ now fully playable in the browser!
Originally written in Turbo C++ (v1), rewritten in Modern C++ with SFML (v2), and now converted to HTML5 Canvas + JavaScript (v3) and deployed on Vercel.
๐ Live Demo: https://moving-car-using-html-5-version.vercel.app/
Just open the link above โ no installation needed. Runs directly in your browser!
A browser-based animated car game featuring a player-controlled car you can drive left and right, multiple NPC cars moving on their own across two lanes, animated rain falling from the sky with puddle splashes, a night city skyline in the background, engine and rain sound effects, and a score system that increases as you drive.
| Version | Platform | Language / Tech | Graphics |
|---|---|---|---|
| v1 | DOS / Turbo C++ 3.0 | Turbo C++ | BGI graphics.h |
| v2 | Windows / Linux / macOS | Modern C++ (C++17) | SFML |
| v3 | ๐ Browser (Vercel) | HTML5 + JavaScript | Canvas API |
| Key | Action |
|---|---|
โ Left Arrow |
Move car left |
โถ Right Arrow |
Move car right |
โฒ Up Arrow |
Increase game speed |
โผ Down Arrow |
Decrease game speed |
SPACE |
Add a new car (max 8) |
M |
Mute / Unmute sound |
- ๐ Player car with smooth acceleration and deceleration
- ๐ Multiple NPC cars moving independently on two lanes
- ๐ง๏ธ Animated rain with diagonal falling drops and puddle splash effects
- ๐จ Random car color changes every few frames
- ๐ Night city background with twinkling stars and glowing building windows
- ๐ก Headlights and taillights glowing on each car
- ๐ Web Audio engine hum + rain ambience (toggleable)
- ๐๏ธ Animated spinning wheels with rim spokes
- ๐ HUD showing score, car count, and speed
Step 1 โ Push to GitHub
- Create a new GitHub repo (e.g.,
moving-car-web) - Upload
index.htmlto the repo - Commit and push
Step 2 โ Deploy on Vercel
- Go to vercel.com
- Click "New Project"
- Import your GitHub repo
- Click "Deploy"
- Done! Your live URL is ready ๐
moving-car-web/
โโโ index.html # Full game โ HTML5 Canvas + JavaScript
โโโ README.md # This file
No dependencies, no build tools, no frameworks needed.
Pure vanilla HTML + JavaScript โ just one file!
| Technology | Purpose |
|---|---|
| HTML5 Canvas API | Drawing cars, rain, road, background |
| Vanilla JavaScript | Game loop, physics, controls |
| Web Audio API | Engine hum and rain sound effects |
| Google Fonts (Orbitron) | UI typography |
| Vercel | Hosting and deployment |
- How to convert Turbo C++ BGI graphics to modern equivalents
- How to use SFML for desktop C++ graphics (v2)
- How to use HTML5 Canvas for browser-based graphics (v3)
- How to set up GitHub Actions CI/CD for C++ projects
- How to deploy a static web app on Vercel
WinonaLaher2002
GitHub: github.com/WinonaLaher2002
This project is for educational purposes.