This project is a Digital Driving School Simulator specifically designed to digitise the Model Town Board (MTB) curriculum used in Kenya and East Africa. It transforms a traditional tabletop theoretical tool into an interactive, 3D testing environment that evaluates a student's ability to navigate complex road networks safely and legally
# Kenya MTB Simulator v2 — NTSA Certified
> **A browser-based 3D driving simulator** that replicates the Kenya National Transport and Safety Authority (NTSA) Model Town Board (MTB) driving assessment — a pass/fail test required before a Kenya driving licence is issued.
---
## Table of Contents
1. Overview
2. Technical Architecture
3. Road Topology & World Map
4. Training Scenarios
5. Implemented Features
- Violations Engine (22 Rules)
- AI Traffic System
- Pedestrian Simulation
- Parking System
- Traffic Light System (4-Phase)
- Distance-Based Cost System
- Lane Detection & Exit Mapping
- Player Physics
- Camera System
- HUD & UI Systems
- AI Instructor
- Scoring & Assessment
6. Controls (Keyboard)
7. Penalty Reference Table
8. NTSA MTB Rules Encoded
9. Remaining / Planned Features
---
## Overview
The Kenya MTB Simulator runs entirely in a **single self-contained HTML file** (`index.html`, ~130 KB) with no build step, no backend, and no external runtime dependencies other than Three.js loaded from CDN. Opening the file in any modern browser is sufficient to run the full assessment.
| Property | Value |
|-----------------|----------------------------------|
| Runtime | Browser (HTML5 + JavaScript ES6) |
| Renderer | Three.js r128 (WebGL) |
| Styling | Vanilla CSS (embedded) |
| Started Score | 100 points |
| Pass Threshold | ≥ 60 points, destination reached |
| Grade Scale | A ≥ 90 · B ≥ 75 · C ≥ 60 · D ≥ 50 · F — Google Fonts, CSS design system with CSS variables
├── — 3-column grid layout (left panel | canvas | right panel)
│ ├── #topbar — score strip, badge, real-time HUD
│ ├── #lp — scenario list, lane exit map, route info
│ ├── #cw — Two elements (WebGL + 2D overlay/minimap)
│ ├── #rp — Speedometer canvas, gear display, TL phase, AI instructor
│ └── #bp — On-screen WASD controls, …