Skip to content

ibrahimokdadov/raceGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L Driver

A 3D driving simulation game built with Three.js. Drive through a procedurally-generated mid-size American city, follow traffic laws, and keep your license.

L Driver

Play

Open index.html in any modern browser. No server or build step needed.

Key Action
Space Start (Licensed mode)
F Start (Free Roam mode)
/ W Accelerate
/ S Brake / Reverse
/ A Steer left
/ D Steer right
R Restart after game over

Game Modes

Licensed Drive

Start with 12 license points. Violations deduct points — reach 0 and your license is revoked.

Violation Points
Ran red light −3
Blew stop sign −2
Speeding (minor) −1
Reckless speed −2
Hit pedestrian −3
Collision −4

Clean driving for 120 seconds recovers 1 point.

Free Roam

No license deductions, no game over. Violation warnings still appear so you can learn the rules without consequences.

City

An organic 1200×1200 unit city with 8 districts, each with its own speed limit and character:

District Speed Limit
University 25 km/h
Hospital 30 km/h
Park 30 km/h
Suburbs 40 km/h
Downtown 40 km/h
Midtown 50 km/h
Industrial 50 km/h
Airport 50 km/h
Highway 100 km/h

Road Network

  • Main avenues — 6-lane with double yellow centre line, crosswalks, traffic lights
  • Secondary streets — 4-lane with yellow dashes
  • Side streets — 2-lane with white dashes
  • Perimeter highway — high-speed outer ring

Traffic

  • AI cars follow waypoint routes and stop at red lights
  • Pedestrians cross at main intersections on green
  • Vienna Convention signs: STOP octagon, YIELD triangle, speed limit circles, street name boards

Architecture

index.html          — canvas, HUD, overlays
style.css           — HUD layout, overlays, animations
js/
  three.min.js      — Three.js r160 (bundled locally)
  constants.js      — world dimensions, road network, districts, physics
  world.js          — ground, buildings, landmarks, highway
  roads.js          — road surfaces, curbs, sidewalks, lane markings
  intersections.js  — traffic light registry + update loop
  signs.js          — canvas-texture signs placed at every intersection
  player.js         — car model, input, physics, collision
  ai.js             — AI cars, pedestrians
  rules.js          — violation detection, license points, game over
  hud.js            — speed, points bar, minimap, zone label, popups
  game.js           — scene lifecycle, camera, boot

Version History

v2.0 — 2026-03-10

Complete rewrite from a single script.js to a full 11-module architecture.

  • Organic city with 8 districts replacing the single straight road
  • 3-tier road hierarchy with curbs, sidewalks, and lane markings
  • Algorithmically-placed signs at every real intersection (no hardcoded positions)
  • License points system replacing money/fine system
  • Free Roam mode
  • AI cars with lane discipline and red-light stopping
  • Pedestrians at main intersections
  • Minimap with district fills
  • Traffic lights with emissive bulbs

v0.02 — 2025-08-10

Traffic light improvements, overhead housing, stop lines, fine system.

v0.01 — 2025-08-09

Initial version: straight road, obstacles, coins, score/speed/money UI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors