Skip to content

WinonaLaher2002/Moving-Car-using-HTML5-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— Moving Car โ€” Web Edition (Version 3)

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/


๐ŸŽฎ Play Now

Just open the link above โ€” no installation needed. Runs directly in your browser!


๐Ÿ“‹ About the Project

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 History

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

๐Ÿ•น๏ธ Controls

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

โœจ Features

  • ๐Ÿš— 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

๐Ÿš€ How to Deploy on Vercel

Step 1 โ€” Push to GitHub

  1. Create a new GitHub repo (e.g., moving-car-web)
  2. Upload index.html to the repo
  3. Commit and push

Step 2 โ€” Deploy on Vercel

  1. Go to vercel.com
  2. Click "New Project"
  3. Import your GitHub repo
  4. Click "Deploy"
  5. Done! Your live URL is ready ๐ŸŽ‰

๐Ÿ—‚๏ธ Project Structure

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!


๐Ÿ”ง Tech Stack

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

๐Ÿ’ก What I Learned

  • 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

๐Ÿ‘ฉโ€๐Ÿ’ป Author

WinonaLaher2002
GitHub: github.com/WinonaLaher2002


๐Ÿ“ License

This project is for educational purposes.

About

๐Ÿš— Moving Car Web Edition โ€” converted from Turbo C++ to Modern C++ to HTML5 Canvas. Play in browser with rain, NPC cars & sound effects. Deployed on Vercel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages