Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Projects/Car Dodger Game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Car Dodger Game

A synthwave-themed highway dodge game built with HTML5 Canvas and vanilla JavaScript.

## Features

- Parallax highway scrolling with lane markings for realistic forward momentum.
- Keyboard (Arrow keys / WASD) and touch (tap left/right) controls with velocity-dampened movement.
- Procedural traffic spawning with random colors, sizes, and speeds.
- AABB collision detection with screen shake and Game Over overlay.
- Progressive difficulty: speed and spawn rate ramp up every 10 seconds.
- Persistent best score via `localStorage`.
- Responsive canvas with mobile-friendly touch controls.

## Run it

Open `index.html` in any modern browser.
49 changes: 49 additions & 0 deletions Projects/Car Dodger Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Car Dodger</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="app">
<header class="hud">
<div class="hud-item">
<span class="hud-lbl">Time</span>
<span class="hud-val" id="timeVal">0s</span>
</div>
<div class="hud-item">
<span class="hud-lbl">Score</span>
<span class="hud-val" id="scoreVal">0</span>
</div>
<div class="hud-item">
<span class="hud-lbl">Speed</span>
<span class="hud-val" id="speedVal">1×</span>
</div>
<div class="hud-item">
<span class="hud-lbl">Best</span>
<span class="hud-val accent" id="bestVal">0</span>
</div>
</header>

<div class="canvas-wrap">
<canvas id="gameCanvas" width="360" height="600"></canvas>
</div>

<div class="overlay" id="overlay">
<div class="modal" id="modal">
<h2 class="modal-title">Game Over</h2>
<div class="mo-stats">
<div class="mo-row"><span>Survived</span><span id="moTime">0s</span></div>
<div class="mo-row"><span>Score</span><span id="moScore">0</span></div>
<div class="mo-row"><span>Best</span><span id="moBest">0</span></div>
</div>
<button class="modal-btn" id="resetBtn">Play Again</button>
</div>
</div>
</div>

<script src="script.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions Projects/Car Dodger Game/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Car Dodger Game",
"description": "A synthwave highway dodge game with parallax scrolling, procedural traffic spawning, AABB collision detection, progressive difficulty, and localStorage best-score persistence.",
"author": { "name": "Girish Madarkar", "github": "Girish0902" },
"tags": ["game", "canvas", "dodge", "synthwave", "vanilla-js", "localstorage"],
"entry": "index.html",
"thumbnail": "thumbnail.svg"
}
Loading
Loading