Mike0021's picture
Fix driving camera jolts, DPR oscillation, and shadow crawl
1139202 verified
Raw
History Blame Contribute Delete
2.5 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Sunset Racing — a procedural Three.js arcade racer at golden hour. Drift a stylized race car around a forest circuit against four AI rivals. Enhanced edition." />
<title>🌇 Sunset Racing</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏎️</text></svg>" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css" />
<script>
// Early error collector — captures module-load and startup failures before
// any game code runs. Used by the local smoke test (test/smoke.mjs) and
// harmless in production.
window.__ERRORS__ = [];
window.addEventListener('error', (e) => {
window.__ERRORS__.push(String(e.message || e.error || 'unknown error'));
});
window.addEventListener('unhandledrejection', (e) => {
window.__ERRORS__.push('unhandledrejection: ' + String(e.reason));
});
// Load the smoke-test hook only when ?smoke=1 is present (local testing).
const __qs = new URLSearchParams(location.search);
if (__qs.has('smoke') || __qs.has('repro')) {
const s = document.createElement('script');
s.type = 'module';
s.src = __qs.has('repro') ? 'test/repro-hook.js' : 'test/smoke-hook.js';
document.head.appendChild(s);
}
</script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
}
}
</script>
<script type="module" src="js/game.js"></script>
</head>
<body>
<canvas id="game" role="img" aria-label="Sunset Racing — 3D gameplay view. Drive with WASD or arrow keys, SPACE to drift, R to restart."></canvas>
<canvas id="minimap" width="160" height="160" aria-hidden="true"></canvas>
<div id="vignette" aria-hidden="true"></div>
<div id="loading" role="status">SUNSET RACING<span>building the world…</span></div>
<div id="controls">WASD / Arrows · SPACE to drift · R to restart</div>
</body>
</html>