Static site
Browse files- index.html +32 -11
- static/city.js +40 -13
- static/game.js +77 -16
- static/legion.js +186 -0
- static/main.js +13 -9
- static/npc.js +78 -17
- static/sound.js +33 -5
- static/style.css +43 -0
- static/world.js +1 -1
index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<meta name="theme-color" content="#10131b">
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500;800;900&family=Inter:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@700&display=swap" rel="stylesheet">
|
| 11 |
-
<link rel="stylesheet" href="/static/style.css?v=
|
| 12 |
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%2714%27 fill=%27%23050506%27/%3E%3Ccircle cx=%2732%27 cy=%2732%27 r=%2716%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%275%27/%3E%3C/svg%3E">
|
| 13 |
<script type="importmap">
|
| 14 |
{ "imports": {
|
|
@@ -19,9 +19,27 @@
|
|
| 19 |
</head>
|
| 20 |
<body data-mode="home">
|
| 21 |
<div id="loader" aria-hidden="true">
|
| 22 |
-
<div class="ld-
|
| 23 |
-
<div class="ld-
|
| 24 |
-
<div class="ld-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
</div>
|
| 26 |
|
| 27 |
<canvas id="gl" aria-label="The VOID car in 3D"></canvas>
|
|
@@ -128,6 +146,9 @@
|
|
| 128 |
<div class="g-card g-raceres" id="gRaceRes" hidden></div>
|
| 129 |
<button class="pill solid g-racego" id="gRaceGo" hidden>Start race</button>
|
| 130 |
<button class="g-footbtn" id="gFootBtn" aria-label="Get out or get in">🚶</button>
|
|
|
|
|
|
|
|
|
|
| 131 |
<div class="g-card g-panel" id="gGpsPanel" hidden></div>
|
| 132 |
<div class="g-feed" id="gFeed"></div>
|
| 133 |
<div class="g-lookhint">Click the game to look around with the mouse · Esc opens the menu</div>
|
|
@@ -186,12 +207,12 @@
|
|
| 186 |
<div class="g-card g-welcome" id="gReady">
|
| 187 |
<h2>New Legion</h2>
|
| 188 |
<p class="sub">Drive, fly, smash, race. Everything else is in the ☰ Menu.</p>
|
| 189 |
-
<div class="
|
| 190 |
-
<div><
|
| 191 |
-
<div><
|
| 192 |
-
<div><
|
| 193 |
-
<div><b>🪙</b><span>40 hidden coins, 14 challenges, police, online</span></div>
|
| 194 |
</div>
|
|
|
|
| 195 |
<p class="small touch-only">On a phone: joystick left, pedals right, drag anywhere to look.</p>
|
| 196 |
<button class="pill solid big-go" id="gGo">Start driving</button>
|
| 197 |
<div class="small" id="gBest"></div>
|
|
@@ -220,7 +241,7 @@
|
|
| 220 |
|
| 221 |
<div id="toast" role="status"></div>
|
| 222 |
<noscript><p style="position:fixed;inset:auto 0 0;padding:16px;background:#111;color:#fff;text-align:center">VOID needs JavaScript for the 3D car.</p></noscript>
|
| 223 |
-
<script src="/static/hub.js" data-app="void" data-credit="none" defer></script>
|
| 224 |
-
<script type="module" src="/static/main.js?v=
|
| 225 |
</body>
|
| 226 |
</html>
|
|
|
|
| 8 |
<meta name="theme-color" content="#10131b">
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Unbounded:wght@500;800;900&family=Inter:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@700&display=swap" rel="stylesheet">
|
| 11 |
+
<link rel="stylesheet" href="/static/style.css?v=1795180010">
|
| 12 |
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%2714%27 fill=%27%23050506%27/%3E%3Ccircle cx=%2732%27 cy=%2732%27 r=%2716%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%275%27/%3E%3C/svg%3E">
|
| 13 |
<script type="importmap">
|
| 14 |
{ "imports": {
|
|
|
|
| 19 |
</head>
|
| 20 |
<body data-mode="home">
|
| 21 |
<div id="loader" aria-hidden="true">
|
| 22 |
+
<div class="ld-title">VOID<span>New Legion</span></div>
|
| 23 |
+
<div class="ld-sky"><i class="ld-moon"></i><div class="ld-city far"></div><div class="ld-city near"></div></div>
|
| 24 |
+
<div class="ld-road"><div class="ld-dash"></div><div class="ld-run"><i id="ldbar"></i></div></div>
|
| 25 |
+
<div class="ld-car">
|
| 26 |
+
<svg class="ld-hydra" viewBox="0 0 300 100" xmlns="http://www.w3.org/2000/svg">
|
| 27 |
+
<defs><linearGradient id="ldBody" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#2a2c33"/><stop offset=".55" stop-color="#0b0b0e"/><stop offset="1" stop-color="#050507"/></linearGradient>
|
| 28 |
+
<linearGradient id="ldGlass" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#0d1420"/><stop offset=".6" stop-color="#3a4a66"/><stop offset="1" stop-color="#0d1420"/></linearGradient>
|
| 29 |
+
<linearGradient id="ldBeam" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#fff6dc" stop-opacity=".55"/><stop offset="1" stop-color="#fff6dc" stop-opacity="0"/></linearGradient></defs>
|
| 30 |
+
<polygon class="ld-beam" points="292,54 300,50 420,30 420,86 300,62" fill="url(#ldBeam)"/>
|
| 31 |
+
<path d="M8,66 C12,54 38,47 70,45 L118,37 C140,24 176,19 204,23 L244,31 C266,35 284,42 293,52 L295,62 C295,68 289,70 283,70 L262,70 A22,22 0 0 0 218,70 L102,70 A22,22 0 0 0 58,70 L20,70 C12,70 8,69 8,66 Z" fill="url(#ldBody)" stroke="#3a3d46" stroke-width="1"/>
|
| 32 |
+
<path d="M126,38 C146,27 174,23 198,26 L226,33 C204,36 162,38 126,41 Z" fill="url(#ldGlass)"/>
|
| 33 |
+
<path d="M40,58 L250,52" stroke="#c1121f" stroke-width="2.5" stroke-linecap="round"/>
|
| 34 |
+
<path d="M196,46 L238,43 L232,50 L200,51 Z" fill="#c1121f"/>
|
| 35 |
+
<rect x="9" y="55" width="12" height="4" rx="2" fill="#ff2a3a" class="ld-tail"/>
|
| 36 |
+
<rect x="284" y="49" width="9" height="3.5" rx="1.5" fill="#f4fbff"/>
|
| 37 |
+
<ellipse cx="150" cy="73" rx="118" ry="3" fill="#3df5ff" opacity=".35" class="ld-glow"/>
|
| 38 |
+
<g class="ld-wh"><circle cx="80" cy="70" r="19" fill="#060607"/><circle cx="80" cy="70" r="11" fill="#2b2d33" stroke="#9aa0aa" stroke-width="1.5"/><path d="M80,59 V81 M69,70 H91 M72,62 L88,78 M88,62 L72,78" stroke="#9aa0aa" stroke-width="2"/><circle cx="80" cy="70" r="3" fill="#c1121f"/></g>
|
| 39 |
+
<g class="ld-wh"><circle cx="240" cy="70" r="19" fill="#060607"/><circle cx="240" cy="70" r="11" fill="#2b2d33" stroke="#9aa0aa" stroke-width="1.5"/><path d="M240,59 V81 M229,70 H251 M232,62 L248,78 M248,62 L232,78" stroke="#9aa0aa" stroke-width="2"/><circle cx="240" cy="70" r="3" fill="#c1121f"/></g>
|
| 40 |
+
</svg>
|
| 41 |
+
<div class="ld-pct"><b id="ldpct">0</b>%</div>
|
| 42 |
+
</div>
|
| 43 |
</div>
|
| 44 |
|
| 45 |
<canvas id="gl" aria-label="The VOID car in 3D"></canvas>
|
|
|
|
| 146 |
<div class="g-card g-raceres" id="gRaceRes" hidden></div>
|
| 147 |
<button class="pill solid g-racego" id="gRaceGo" hidden>Start race</button>
|
| 148 |
<button class="g-footbtn" id="gFootBtn" aria-label="Get out or get in">🚶</button>
|
| 149 |
+
<button class="g-resetbtn" id="gResetBtn" aria-label="Reset the car">↺</button>
|
| 150 |
+
<div class="g-pop" id="gPop" aria-live="polite"></div>
|
| 151 |
+
<div class="g-keyhint" id="gKeyHint" hidden></div>
|
| 152 |
<div class="g-card g-panel" id="gGpsPanel" hidden></div>
|
| 153 |
<div class="g-feed" id="gFeed"></div>
|
| 154 |
<div class="g-lookhint">Click the game to look around with the mouse · Esc opens the menu</div>
|
|
|
|
| 207 |
<div class="g-card g-welcome" id="gReady">
|
| 208 |
<h2>New Legion</h2>
|
| 209 |
<p class="sub">Drive, fly, smash, race. Everything else is in the ☰ Menu.</p>
|
| 210 |
+
<div class="keys3 key-only">
|
| 211 |
+
<div><span><kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd></span><em>Drive</em></div>
|
| 212 |
+
<div><span><kbd class="wide">Shift</kbd></span><em>Nitro</em></div>
|
| 213 |
+
<div><span><kbd>F</kbd></span><em>Fly</em></div>
|
|
|
|
| 214 |
</div>
|
| 215 |
+
<p class="small key-only">More keys show up when you need them. Hit the neon ramp ahead and press F in mid-air.</p>
|
| 216 |
<p class="small touch-only">On a phone: joystick left, pedals right, drag anywhere to look.</p>
|
| 217 |
<button class="pill solid big-go" id="gGo">Start driving</button>
|
| 218 |
<div class="small" id="gBest"></div>
|
|
|
|
| 241 |
|
| 242 |
<div id="toast" role="status"></div>
|
| 243 |
<noscript><p style="position:fixed;inset:auto 0 0;padding:16px;background:#111;color:#fff;text-align:center">VOID needs JavaScript for the 3D car.</p></noscript>
|
| 244 |
+
<script src="/static/hub.js" data-app="void" data-credit="none" data-splash="none" defer></script>
|
| 245 |
+
<script type="module" src="/static/main.js?v=1795180010"></script>
|
| 246 |
</body>
|
| 247 |
</html>
|
static/city.js
CHANGED
|
@@ -209,12 +209,13 @@ export async function buildCity(scene, canvasTex, COARSE) {
|
|
| 209 |
const nearR = (x, z, r) => { const out = new Set(); for (let cx = Math.floor((x - r) / CELL); cx <= Math.floor((x + r) / CELL); cx++) for (let cz = Math.floor((z - r) / CELL); cz <= Math.floor((z + r) / CELL); cz++) for (const b of hash.get(cx * 10007 + cz) || []) out.add(b); return [...out]; };
|
| 210 |
|
| 211 |
// instanced props, gathered as lists then placed at the end
|
| 212 |
-
const P = { acs: [], trees: [], lamps: [], hydrants: [], towers: [], subway: [], aviation: [], helipads: [], benches: [], burgers: [], pizzas: [], signs: [], awn: [], stoops: [], bins: [], escapes: [], carts: [], steam: [] };
|
| 213 |
|
| 214 |
// ---- ground: grass everywhere, asphalt under the grid, sidewalks on every block ----
|
| 215 |
// land: Manhattan between the rivers, New Jersey west of the Hudson, Brooklyn east of the East River (the rivers are gaps)
|
| 216 |
const W1 = XA - 60, W2 = XB + 60, HW0 = W1 - 600, EW1 = W2 + 700, WATER_Y = -.45;
|
| 217 |
-
|
|
|
|
| 218 |
grassTex.repeat.set(1, 1);
|
| 219 |
for (const [a, b] of [[-20000, HW0], [W1, W2], [EW1, 20000]]) {
|
| 220 |
const g = new THREE.PlaneGeometry(b - a, 40000).rotateX(-Math.PI / 2), uv = g.attributes.uv; for (let k = 0; k < uv.count; k++) uv.setXY(k, uv.getX(k) * (b - a) / 10, uv.getY(k) * 4000);
|
|
@@ -663,21 +664,23 @@ export async function buildCity(scene, canvasTex, COARSE) {
|
|
| 663 |
for (let k = 0; k < 6; k++) drawScreen(k, 0);
|
| 664 |
let screenK = 0, screenT = 0;
|
| 665 |
if (spires.length) scene.add(new THREE.Mesh(mergeGeometries(spires.map(g => g.toNonIndexed())), mat({ color: 0xb8bcc4, metalness: .9, roughness: .25 })));
|
| 666 |
-
const walkMat = mat({ map: walkTex, roughness: .9 }); walkTex.repeat.set(1, 1);
|
| 667 |
const wg = mergeGeometries(walkG); { const p = wg.attributes.position, uv = wg.attributes.uv; for (let k = 0; k < p.count; k++) uv.setXY(k, p.getX(k) / 4, p.getZ(k) / 4); }
|
| 668 |
scene.add(new THREE.Mesh(wg, walkMat));
|
| 669 |
const pg = mergeGeometries(parkG); { const p = pg.attributes.position, uv = pg.attributes.uv; for (let k = 0; k < p.count; k++) uv.setXY(k, p.getX(k) / 10, p.getZ(k) / 10); }
|
| 670 |
const parkTex = grassTex.clone(); parkTex.repeat.set(1, 1); parkTex.needsUpdate = true;
|
| 671 |
-
scene.add(new THREE.Mesh(pg, mat({ map: parkTex, roughness: .95, color: 0xc8e0a8 })));
|
| 672 |
const signMat = new THREE.MeshBasicMaterial({ map: signAtlas, toneMapped: false, color: new THREE.Color(1.5, 1.5, 1.5) }); emissive.push(signMat);
|
| 673 |
{ const tiles = new Map(); for (const g of signGeo) { const p0 = g.attributes.position, k = tileOf(p0.getX(0), p0.getZ(0)); if (!tiles.has(k)) tiles.set(k, []); tiles.get(k).push(g); } for (const list of tiles.values()) scene.add(new THREE.Mesh(mergeGeometries(list), signMat)); }
|
| 674 |
|
| 675 |
// small props go in 200 m tiles and are only drawn near the camera (trees a little further)
|
| 676 |
const propTiles = [];
|
| 677 |
-
const
|
|
|
|
| 678 |
const groups = new Map(), PT = 400;
|
| 679 |
-
list.forEach((it, i) => { place(it, i); const e = m4.elements, k = Math.floor(e[12] / PT) * 1000 + Math.floor(e[14] / PT); let gr = groups.get(k); if (!gr) groups.set(k, gr = []); gr.push([m4.clone(), colorOf ? colorOf(it, i) : null]); });
|
| 680 |
-
|
|
|
|
| 681 |
propTiles.push({ mesh, x: (Math.floor(k / 1000) + .5) * PT, z: (((k % 1000) + 1000) % 1000 + .5) * PT, far }); }
|
| 682 |
};
|
| 683 |
const inst = (geo, material, list, place) => { const mesh = new THREE.InstancedMesh(geo, material, Math.max(1, list.length)); list.forEach((it, i) => { place(it, i); mesh.setMatrixAt(i, m4); }); mesh.instanceMatrix.needsUpdate = true; if (list.length) scene.add(mesh); return mesh; };
|
|
@@ -696,12 +699,28 @@ export async function buildCity(scene, canvasTex, COARSE) {
|
|
| 696 |
// pools of warm light under every lamp (only at night)
|
| 697 |
const poolTex = canvasTex(128, 128, (g, w) => { const r = g.createRadialGradient(64, 64, 0, 64, 64, 64); r.addColorStop(0, "rgba(255,200,130,.55)"); r.addColorStop(.5, "rgba(255,180,110,.18)"); r.addColorStop(1, "rgba(255,170,100,0)"); g.fillStyle = r; g.fillRect(0, 0, w, w); });
|
| 698 |
const poolMat = new THREE.MeshBasicMaterial({ map: poolTex, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, toneMapped: false, polygonOffset: true, polygonOffsetFactor: -3 });
|
| 699 |
-
instT(new THREE.PlaneGeometry(16, 16).rotateX(-Math.PI / 2), poolMat, P.lamps, ([x, z, ry]) => { at(0, 0, 0, ry); v.set(0, .08, 1.8).applyQuaternion(q0); m4.compose(v.add(new THREE.Vector3(x, 0, z)), q0, sc.set(1, 1, 1)); }, null, 260);
|
| 700 |
const lampHead = new THREE.MeshBasicMaterial({ color: new THREE.Color(0xffcf8a).multiplyScalar(2.4), toneMapped: false }); emissive.push(lampHead); lampHead.userData.glow = 2.4; lampHead.userData.base = new THREE.Color(0xffcf8a);
|
| 701 |
-
instT(mergeGeometries([new THREE.CylinderGeometry(.1, .14, 8, 6).translate(0, 4, 0), new THREE.BoxGeometry(.1, .1, 2).translate(0, 7.9, 1)].map(g => g.toNonIndexed())), darkM, P.lamps, ([x, z, ry]) => at(x, 0, z, ry));
|
| 702 |
-
instT(new THREE.BoxGeometry(.5, .14, .8), lampHead, P.lamps, ([x, z, ry]) => { at(0, 0, 0, ry); v.set(0, 7.85, 1.8).applyQuaternion(q0); m4.compose(v.add(new THREE.Vector3(x, 0, z)), q0, sc.set(1, 1, 1)); });
|
| 703 |
-
instT(new THREE.CylinderGeometry(.22, .26, .8, 8).translate(0, .4, 0), mat({ color: 0xc8202a, roughness: .5 }), P.hydrants, ([x, z]) => at(x, 0, z));
|
| 704 |
-
instT(new THREE.CylinderGeometry(.35, .3, 1, 8).translate(0, .5, 0), mat({ color: 0x2d4a2d, roughness: .7 }), P.bins, ([x, z]) => at(x, 0, z));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 705 |
// NYC water towers: wooden barrel, cone roof, steel legs
|
| 706 |
const towerGeo = mergeGeometries([new THREE.CylinderGeometry(2.4, 2.4, 4.5, 14).translate(0, 4.7, 0), new THREE.ConeGeometry(2.6, 1.6, 14).translate(0, 7.75, 0),
|
| 707 |
...[[1.5, 1.5], [-1.5, 1.5], [1.5, -1.5], [-1.5, -1.5]].map(([a, b]) => new THREE.CylinderGeometry(.12, .12, 2.5, 4).translate(a, 1.25, b))].map(g => g.toNonIndexed()));
|
|
@@ -772,7 +791,7 @@ export async function buildCity(scene, canvasTex, COARSE) {
|
|
| 772 |
instT(new THREE.PlaneGeometry(2.3, 3.1).rotateX(-Math.PI / 2), new THREE.MeshBasicMaterial({ color: 0x050505 }), P.subway, ([x, z]) => at(x + .05, .08, z));
|
| 773 |
const stoopGeo = mergeGeometries([0, 1, 2, 3].map(k => new THREE.BoxGeometry(2, .3, .5).translate(0, .15 + k * .3, -k * .45)).map(g => g.toNonIndexed()));
|
| 774 |
instT(stoopGeo, mat({ color: 0x7a5a44, roughness: .9 }), P.stoops, ([x, z, s]) => at(x, 0, z + (s > 0 ? 0 : 0), s > 0 ? Math.PI : 0));
|
| 775 |
-
instT(new THREE.BoxGeometry(1.8, .5, .6).translate(0, .45, 0), mat({ color: 0x4a3a2a, roughness: .9 }), P.benches, ([x, z, a]) => at(x, 0, z, -a));
|
| 776 |
// giant burgers and pizza slices on some food places, because why not
|
| 777 |
const bun = mat({ color: 0xc88a3a, roughness: .6 }), patty = mat({ color: 0x4a2a18, roughness: .8 }), cheese = mat({ color: 0xffc21a, roughness: .5 }), lettuce = mat({ color: 0x4caf2a, roughness: .7 });
|
| 778 |
// (built as one merged mesh per material: 80 sculptures in 5 draw calls)
|
|
@@ -828,7 +847,15 @@ export async function buildCity(scene, canvasTex, COARSE) {
|
|
| 828 |
setLights(0);
|
| 829 |
|
| 830 |
const helipads = P.helipads; let cullN = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 831 |
return {
|
|
|
|
| 832 |
buildings, footprints, roads, parks: [[[PX0, PZ0], [PX1, PZ0], [PX1, PZ1], [PX0, PZ1]]], water: [[[HW0, -9000], [W1, -9000], [W1, 9000], [HW0, 9000]], [[W2, -9000], [EW1, -9000], [EW1, 9000], [W2, 9000]], Array.from({ length: 24 }, (_, k) => [lake.x + Math.cos(k / 24 * 6.283) * lake.rx, lake.z + Math.sin(k / 24 * 6.283) * lake.rz])],
|
| 833 |
WATER_Y, rivers: { hudson: [HW0, W1], east: [W2, EW1] },
|
| 834 |
beaches: [], walkways: [], bounds: { x0: XA - 220, x1: brooklyn + 300, z0: ZA - 160, z1: ZB + 160 }, credit: "a made-up city in code",
|
|
|
|
| 209 |
const nearR = (x, z, r) => { const out = new Set(); for (let cx = Math.floor((x - r) / CELL); cx <= Math.floor((x + r) / CELL); cx++) for (let cz = Math.floor((z - r) / CELL); cz <= Math.floor((z + r) / CELL); cz++) for (const b of hash.get(cx * 10007 + cz) || []) out.add(b); return [...out]; };
|
| 210 |
|
| 211 |
// instanced props, gathered as lists then placed at the end
|
| 212 |
+
const P = { cones: [], barriers: [], acs: [], trees: [], lamps: [], hydrants: [], towers: [], subway: [], aviation: [], helipads: [], benches: [], burgers: [], pizzas: [], signs: [], awn: [], stoops: [], bins: [], escapes: [], carts: [], steam: [] };
|
| 213 |
|
| 214 |
// ---- ground: grass everywhere, asphalt under the grid, sidewalks on every block ----
|
| 215 |
// land: Manhattan between the rivers, New Jersey west of the Hudson, Brooklyn east of the East River (the rivers are gaps)
|
| 216 |
const W1 = XA - 60, W2 = XB + 60, HW0 = W1 - 600, EW1 = W2 + 700, WATER_Y = -.45;
|
| 217 |
+
// (the ground layers get depth nudges so they never flicker through each other far away: grass back, pavement, parks and markings forward)
|
| 218 |
+
const grassMat = mat({ map: grassTex, roughness: .95, color: 0xb8d0a0, polygonOffset: true, polygonOffsetFactor: 4, polygonOffsetUnits: 4 });
|
| 219 |
grassTex.repeat.set(1, 1);
|
| 220 |
for (const [a, b] of [[-20000, HW0], [W1, W2], [EW1, 20000]]) {
|
| 221 |
const g = new THREE.PlaneGeometry(b - a, 40000).rotateX(-Math.PI / 2), uv = g.attributes.uv; for (let k = 0; k < uv.count; k++) uv.setXY(k, uv.getX(k) * (b - a) / 10, uv.getY(k) * 4000);
|
|
|
|
| 664 |
for (let k = 0; k < 6; k++) drawScreen(k, 0);
|
| 665 |
let screenK = 0, screenT = 0;
|
| 666 |
if (spires.length) scene.add(new THREE.Mesh(mergeGeometries(spires.map(g => g.toNonIndexed())), mat({ color: 0xb8bcc4, metalness: .9, roughness: .25 })));
|
| 667 |
+
const walkMat = mat({ map: walkTex, roughness: .9, polygonOffset: true, polygonOffsetFactor: -1, polygonOffsetUnits: -1 }); walkTex.repeat.set(1, 1);
|
| 668 |
const wg = mergeGeometries(walkG); { const p = wg.attributes.position, uv = wg.attributes.uv; for (let k = 0; k < p.count; k++) uv.setXY(k, p.getX(k) / 4, p.getZ(k) / 4); }
|
| 669 |
scene.add(new THREE.Mesh(wg, walkMat));
|
| 670 |
const pg = mergeGeometries(parkG); { const p = pg.attributes.position, uv = pg.attributes.uv; for (let k = 0; k < p.count; k++) uv.setXY(k, p.getX(k) / 10, p.getZ(k) / 10); }
|
| 671 |
const parkTex = grassTex.clone(); parkTex.repeat.set(1, 1); parkTex.needsUpdate = true;
|
| 672 |
+
scene.add(new THREE.Mesh(pg, mat({ map: parkTex, roughness: .95, color: 0xc8e0a8, polygonOffset: true, polygonOffsetFactor: -2, polygonOffsetUnits: -2 })));
|
| 673 |
const signMat = new THREE.MeshBasicMaterial({ map: signAtlas, toneMapped: false, color: new THREE.Color(1.5, 1.5, 1.5) }); emissive.push(signMat);
|
| 674 |
{ const tiles = new Map(); for (const g of signGeo) { const p0 = g.attributes.position, k = tileOf(p0.getX(0), p0.getZ(0)); if (!tiles.has(k)) tiles.set(k, []); tiles.get(k).push(g); } for (const list of tiles.values()) scene.add(new THREE.Mesh(mergeGeometries(list), signMat)); }
|
| 675 |
|
| 676 |
// small props go in 200 m tiles and are only drawn near the camera (trees a little further)
|
| 677 |
const propTiles = [];
|
| 678 |
+
const smashReg = new Map(); // list -> { kind, items: [ [mesh, index, matrix], ... ] per item } for the props a car can knock over
|
| 679 |
+
const instT = (geo, material, list, place, colorOf, far = 330, kind) => {
|
| 680 |
const groups = new Map(), PT = 400;
|
| 681 |
+
list.forEach((it, i) => { place(it, i); const e = m4.elements, k = Math.floor(e[12] / PT) * 1000 + Math.floor(e[14] / PT); let gr = groups.get(k); if (!gr) groups.set(k, gr = []); gr.push([m4.clone(), colorOf ? colorOf(it, i) : null, i]); });
|
| 682 |
+
let reg = null; if (kind) { reg = smashReg.get(list); if (!reg) smashReg.set(list, reg = { kind, items: [] }); }
|
| 683 |
+
for (const [k, arr] of groups) { const mesh = new THREE.InstancedMesh(geo, material, arr.length); arr.forEach(([m, c, i], j) => { mesh.setMatrixAt(j, m); if (c) mesh.setColorAt(j, c); if (reg) (reg.items[i] = reg.items[i] || []).push([mesh, j, m]); }); mesh.instanceMatrix.needsUpdate = true; mesh.computeBoundingSphere(); scene.add(mesh);
|
| 684 |
propTiles.push({ mesh, x: (Math.floor(k / 1000) + .5) * PT, z: (((k % 1000) + 1000) % 1000 + .5) * PT, far }); }
|
| 685 |
};
|
| 686 |
const inst = (geo, material, list, place) => { const mesh = new THREE.InstancedMesh(geo, material, Math.max(1, list.length)); list.forEach((it, i) => { place(it, i); mesh.setMatrixAt(i, m4); }); mesh.instanceMatrix.needsUpdate = true; if (list.length) scene.add(mesh); return mesh; };
|
|
|
|
| 699 |
// pools of warm light under every lamp (only at night)
|
| 700 |
const poolTex = canvasTex(128, 128, (g, w) => { const r = g.createRadialGradient(64, 64, 0, 64, 64, 64); r.addColorStop(0, "rgba(255,200,130,.55)"); r.addColorStop(.5, "rgba(255,180,110,.18)"); r.addColorStop(1, "rgba(255,170,100,0)"); g.fillStyle = r; g.fillRect(0, 0, w, w); });
|
| 701 |
const poolMat = new THREE.MeshBasicMaterial({ map: poolTex, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, toneMapped: false, polygonOffset: true, polygonOffsetFactor: -3 });
|
| 702 |
+
instT(new THREE.PlaneGeometry(16, 16).rotateX(-Math.PI / 2), poolMat, P.lamps, ([x, z, ry]) => { at(0, 0, 0, ry); v.set(0, .08, 1.8).applyQuaternion(q0); m4.compose(v.add(new THREE.Vector3(x, 0, z)), q0, sc.set(1, 1, 1)); }, null, 260, "lamp");
|
| 703 |
const lampHead = new THREE.MeshBasicMaterial({ color: new THREE.Color(0xffcf8a).multiplyScalar(2.4), toneMapped: false }); emissive.push(lampHead); lampHead.userData.glow = 2.4; lampHead.userData.base = new THREE.Color(0xffcf8a);
|
| 704 |
+
instT(mergeGeometries([new THREE.CylinderGeometry(.1, .14, 8, 6).translate(0, 4, 0), new THREE.BoxGeometry(.1, .1, 2).translate(0, 7.9, 1)].map(g => g.toNonIndexed())), darkM, P.lamps, ([x, z, ry]) => at(x, 0, z, ry), null, 330, "lamp");
|
| 705 |
+
instT(new THREE.BoxGeometry(.5, .14, .8), lampHead, P.lamps, ([x, z, ry]) => { at(0, 0, 0, ry); v.set(0, 7.85, 1.8).applyQuaternion(q0); m4.compose(v.add(new THREE.Vector3(x, 0, z)), q0, sc.set(1, 1, 1)); }, null, 330, "lamp");
|
| 706 |
+
instT(new THREE.CylinderGeometry(.22, .26, .8, 8).translate(0, .4, 0), mat({ color: 0xc8202a, roughness: .5 }), P.hydrants, ([x, z]) => at(x, 0, z), null, 330, "hydrant");
|
| 707 |
+
instT(new THREE.CylinderGeometry(.35, .3, 1, 8).translate(0, .5, 0), mat({ color: 0x2d4a2d, roughness: .7 }), P.bins, ([x, z]) => at(x, 0, z), null, 330, "bin");
|
| 708 |
+
// road works: a line of cones down the kerb lane with a striped barrier at each end (drive straight through them)
|
| 709 |
+
{
|
| 710 |
+
let sc2 = 99; const rc = () => (sc2 = (sc2 * 16807) % 2147483647) / 2147483647;
|
| 711 |
+
for (let k = 0; k < 46; k++) {
|
| 712 |
+
const i = Math.floor(rc() * (NX - 1)), j = Math.floor(rc() * NZ); if (!GRID.hasX(j, i)) continue;
|
| 713 |
+
const x0 = GRID.ax(i) + GRID.avW(i) / 2 + 12, x1 = GRID.ax(i + 1) - GRID.avW(i + 1) / 2 - 12; if (x1 - x0 < 34) continue;
|
| 714 |
+
const z = GRID.sz(j) + (rc() < .5 ? 1 : -1) * (GRID.stW(j) / 2 - 1.3), xs = x0 + rc() * (x1 - x0 - 28);
|
| 715 |
+
for (let c = 0; c < 8; c++) P.cones.push([xs + c * 3, z]);
|
| 716 |
+
P.barriers.push([xs - 2.5, z], [xs + 23.5, z]);
|
| 717 |
+
}
|
| 718 |
+
const coneMat = mat({ color: 0xff5a12, roughness: .6 }), stripeTex = canvasTex(64, 16, (g, w, h) => { for (let x = -16; x < w; x += 16) { g.fillStyle = "#e8e8e8"; g.fillRect(x, 0, 16, h); g.fillStyle = "#d4202a"; g.beginPath(); g.moveTo(x, h); g.lineTo(x + 8, 0); g.lineTo(x + 16, 0); g.lineTo(x + 8, h); g.fill(); } });
|
| 719 |
+
instT(mergeGeometries([new THREE.ConeGeometry(.24, .72, 10).translate(0, .4, 0), new THREE.CylinderGeometry(.17, .19, .1, 10).translate(0, .42, 0)].map(g => g.toNonIndexed())), coneMat, P.cones, ([x, z]) => at(x, 0, z), null, 260, "cone");
|
| 720 |
+
instT(new THREE.BoxGeometry(.4, .04, .4).translate(0, .02, 0), darkM, P.cones, ([x, z]) => at(x, 0, z), null, 200, "cone");
|
| 721 |
+
instT(new THREE.BoxGeometry(.12, .4, 2.4).translate(0, .9, 0), mat({ map: stripeTex, roughness: .5 }), P.barriers, ([x, z]) => at(x, 0, z), null, 260, "barrier");
|
| 722 |
+
instT(mergeGeometries([new THREE.BoxGeometry(.5, .7, .08).translate(0, .35, 1.05), new THREE.BoxGeometry(.5, .7, .08).translate(0, .35, -1.05)].map(g => g.toNonIndexed())), darkM, P.barriers, ([x, z]) => at(x, 0, z), null, 260, "barrier");
|
| 723 |
+
}
|
| 724 |
// NYC water towers: wooden barrel, cone roof, steel legs
|
| 725 |
const towerGeo = mergeGeometries([new THREE.CylinderGeometry(2.4, 2.4, 4.5, 14).translate(0, 4.7, 0), new THREE.ConeGeometry(2.6, 1.6, 14).translate(0, 7.75, 0),
|
| 726 |
...[[1.5, 1.5], [-1.5, 1.5], [1.5, -1.5], [-1.5, -1.5]].map(([a, b]) => new THREE.CylinderGeometry(.12, .12, 2.5, 4).translate(a, 1.25, b))].map(g => g.toNonIndexed()));
|
|
|
|
| 791 |
instT(new THREE.PlaneGeometry(2.3, 3.1).rotateX(-Math.PI / 2), new THREE.MeshBasicMaterial({ color: 0x050505 }), P.subway, ([x, z]) => at(x + .05, .08, z));
|
| 792 |
const stoopGeo = mergeGeometries([0, 1, 2, 3].map(k => new THREE.BoxGeometry(2, .3, .5).translate(0, .15 + k * .3, -k * .45)).map(g => g.toNonIndexed()));
|
| 793 |
instT(stoopGeo, mat({ color: 0x7a5a44, roughness: .9 }), P.stoops, ([x, z, s]) => at(x, 0, z + (s > 0 ? 0 : 0), s > 0 ? Math.PI : 0));
|
| 794 |
+
instT(new THREE.BoxGeometry(1.8, .5, .6).translate(0, .45, 0), mat({ color: 0x4a3a2a, roughness: .9 }), P.benches, ([x, z, a]) => at(x, 0, z, -a), null, 330, "bench");
|
| 795 |
// giant burgers and pizza slices on some food places, because why not
|
| 796 |
const bun = mat({ color: 0xc88a3a, roughness: .6 }), patty = mat({ color: 0x4a2a18, roughness: .8 }), cheese = mat({ color: 0xffc21a, roughness: .5 }), lettuce = mat({ color: 0x4caf2a, roughness: .7 });
|
| 797 |
// (built as one merged mesh per material: 80 sculptures in 5 draw calls)
|
|
|
|
| 847 |
setLights(0);
|
| 848 |
|
| 849 |
const helipads = P.helipads; let cullN = 0;
|
| 850 |
+
const propIdx = new Map(), PC = 12, zeroM = new THREE.Matrix4().makeScale(0, 0, 0);
|
| 851 |
+
for (const [list, reg] of smashReg) reg.items.forEach((parts, i) => { if (!parts) return; const x = list[i][0], z = list[i][1], key = Math.floor(x / PC) * 100000 + Math.floor(z / PC); let a = propIdx.get(key); if (!a) propIdx.set(key, a = []); a.push({ kind: reg.kind, x, z, parts, down: 0 }); });
|
| 852 |
+
const props = {
|
| 853 |
+
near(x, z, r) { const out = []; for (let gx = Math.floor((x - r) / PC); gx <= Math.floor((x + r) / PC); gx++) for (let gz = Math.floor((z - r) / PC); gz <= Math.floor((z + r) / PC); gz++) { const a = propIdx.get(gx * 100000 + gz); if (a) for (const q of a) if (!q.down && Math.hypot(q.x - x, q.z - z) < r) out.push(q); } return out; },
|
| 854 |
+
hide(q) { q.down = 1; for (const [mesh, j] of q.parts) { mesh.setMatrixAt(j, zeroM); mesh.instanceMatrix.needsUpdate = true; } },
|
| 855 |
+
restore(q) { q.down = 0; for (const [mesh, j, m] of q.parts) { mesh.setMatrixAt(j, m); mesh.instanceMatrix.needsUpdate = true; } },
|
| 856 |
+
};
|
| 857 |
return {
|
| 858 |
+
props,
|
| 859 |
buildings, footprints, roads, parks: [[[PX0, PZ0], [PX1, PZ0], [PX1, PZ1], [PX0, PZ1]]], water: [[[HW0, -9000], [W1, -9000], [W1, 9000], [HW0, 9000]], [[W2, -9000], [EW1, -9000], [EW1, 9000], [W2, 9000]], Array.from({ length: 24 }, (_, k) => [lake.x + Math.cos(k / 24 * 6.283) * lake.rx, lake.z + Math.sin(k / 24 * 6.283) * lake.rz])],
|
| 860 |
WATER_Y, rivers: { hudson: [HW0, W1], east: [W2, EW1] },
|
| 861 |
beaches: [], walkways: [], bounds: { x0: XA - 220, x1: brooklyn + 300, z0: ZA - 160, z1: ZB + 160 }, credit: "a made-up city in code",
|
static/game.js
CHANGED
|
@@ -78,6 +78,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 78 |
if ($("gHorn")) $("gHorn").onclick = () => horn();
|
| 79 |
if ($("gTime")) $("gTime").onclick = () => opts.cycleTime && opts.cycleTime();
|
| 80 |
if ($("gPhoto")) $("gPhoto").onclick = togglePhoto;
|
|
|
|
| 81 |
$("gGo").onclick = () => { $("gReady").hidden = true; if (!sound.on) sound.setOn(true); g.started = true; };
|
| 82 |
|
| 83 |
// ---- extra stunts: ramps round the city and rings in the sky ----
|
|
@@ -103,17 +104,22 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 103 |
{ x: -600, z: 1400, yaw: Math.PI / 2, len: 30, h: .7 }, { x: -760, z: 1370, yaw: Math.PI / 4, len: 18, h: 1.3 },
|
| 104 |
{ x: 974, z: 1215, yaw: Math.PI / 2, len: 210, h: .9 }, // the boardwalk railing
|
| 105 |
{ x: 2580, z: 12, yaw: 0, len: 50, h: .8 }, { x: 2580, z: -12, yaw: 0, len: 50, h: .8 }, // by the highway at the foot of the mountains
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
].map(r => ({ ...r, c: Math.cos(r.yaw), s: Math.sin(r.yaw) }));
|
| 107 |
{
|
| 108 |
const parts = [];
|
| 109 |
for (const r of RAILS) {
|
| 110 |
const bar = new THREE.CylinderGeometry(.06, .06, r.len, 8).rotateZ(Math.PI / 2).translate(r.len / 2, r.h, 0);
|
| 111 |
-
const g = [bar]; for (let a = 1; a < r.len; a += 3) g.push(new THREE.BoxGeometry(.08, r.h, .08).translate(a, r.h / 2, 0));
|
| 112 |
for (const q of g) { q.rotateY(-r.yaw); q.translate(r.x, 0, r.z); parts.push(q.toNonIndexed()); }
|
| 113 |
}
|
| 114 |
W.scene.add(new THREE.Mesh(mergeGeometries(parts.map(q => { for (const k of Object.keys(q.attributes)) if (k !== "position" && k !== "normal") q.deleteAttribute(k); return q; })), new THREE.MeshStandardMaterial({ color: 0xd8dde4, metalness: .9, roughness: .25 })));
|
| 115 |
}
|
| 116 |
-
|
|
|
|
| 117 |
const rampAt = (x, z) => {
|
| 118 |
for (const r of RAMPS) {
|
| 119 |
const dx = x - r.x, dz = z - r.z, c = Math.cos(r.yaw), s = Math.sin(r.yaw), a = dx * c + dz * s, b = -dx * s + dz * c;
|
|
@@ -132,7 +138,17 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 132 |
const m = new THREE.Mesh(new THREE.TorusGeometry(9, .6, 10, 40), mat.clone()); m.position.set(x, y, z); m.rotation.y = -yaw + Math.PI / 2; W.scene.add(m);
|
| 133 |
RINGS.push({ m, x, y, z, nx: Math.cos(yaw), nz: Math.sin(yaw), done: 0, side: 0 }); void rr;
|
| 134 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
}
|
|
|
|
| 136 |
|
| 137 |
function spawn(at) {
|
| 138 |
const s = at || SPAWN; rig.yaw = null; if (g && g.ride) releaseRide(); if (g) { g.heroPark = null; }
|
|
@@ -263,7 +279,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 263 |
g.trS += turn * 8.5 * dt; if (held("drift")) g.trF += 9.5 * dt; if (held("down")) g.trH = (g.trH || 0) + 9.5 * dt; if (held("nitro")) g.grabT = (g.grabT || 0) + dt;
|
| 264 |
g.airT += dt; g.charge = 0;
|
| 265 |
if (held("up") && !g.jumpHeld && g.dbl) { g.dbl = false; g.vy = Math.max(g.vy, 0) + 5.5; u += 3; sound.whoosh(); g.shake = .3; } // double jump: one thruster burst
|
| 266 |
-
if (g.vy <= 1.5) { const rn = railNear(g.x, g.z, g.y); if (rn) { const along = fx * rn.r.c + fz * rn.r.s; if (Math.abs(along) > .
|
| 267 |
landBoard(); g.grind = { r: rn.r, a: rn.a, dir: Math.sign(along), v: Math.max(7, Math.abs(u) * Math.abs(along)), m: 0 }; sound.thud && sound.thud(.45); g.jumpHeld = held("up"); return; } } }
|
| 268 |
}
|
| 269 |
g.jumpHeld = held("up");
|
|
@@ -303,7 +319,21 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 303 |
function wreck(why) { g.wreck = 2.6; g.boom = 1; g.vel.set(0, 0, 0); say(why + ". Respawning…", 2.6); sound.crash(); }
|
| 304 |
// into the water: a splash, the car sinks, and you're put back on the last bit of road (no explosion, no wreck)
|
| 305 |
function splash() { const lake = Math.hypot(g.x - city.lake.x, g.z - city.lake.z) < 120; g.sink = 1.6; g.splashT = 1; g.mode = "drive"; say(lake ? "Splash! That's the park lake" : "Splash! You drove into the river", 2.2); sound.crash(); }
|
| 306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
function horn() { sound.horn && sound.horn(opts.hornType ? opts.hornType() : 0); life && life.honk(g.x, g.z); }
|
| 308 |
|
| 309 |
// the ground under a point: ramps, rooftops (only if you are up there), else the street; water is -1
|
|
@@ -351,8 +381,9 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 351 |
pv.x = pv.x * .3 + nvx * .6; pv.z = pv.z * .3 + nvz * .6; c.v *= .3;
|
| 352 |
hurt(dmg, `Hit by a ${c.kind.id}`); impact((g.x + c.x) / 2, .6, (g.z + c.z) / 2, Math.max(dmg, rel * .6)); if (dmg > 2) { sound.crash(); g.sparks = .7; } else sound.pop();
|
| 353 |
}
|
| 354 |
-
} else if (ps > 25 && Math.abs(along) < hl + 1 && Math.abs(side) < hw +
|
| 355 |
-
const t = g.near.get(c) || 0
|
|
|
|
| 356 |
}
|
| 357 |
}
|
| 358 |
}
|
|
@@ -427,9 +458,18 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 427 |
else if (g.fuel < .15 && g.fuelMsg !== 2 && g.fuel > 0) { g.fuelMsg = 2; say("Low fuel: find a ⛽ station", 4); }
|
| 428 |
if (g.fuel > .2) g.fuelMsg = 0;
|
| 429 |
service(dt);
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
|
| 434 |
if (g.veh && g.veh !== "car" && opts.vehicles) {
|
| 435 |
const I = { turn, gas, brake, up: g.fuel > 0 && (g.ap ? g.ap.up : held("up")) ? 1 : 0, down: (g.ap ? g.ap.down : held("down")) ? 1 : 0, nitro: g.nitroOn > .3, stickY: -stick.y };
|
|
@@ -456,6 +496,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 456 |
if (gas) u += (u < -.5 ? 20 : 11.5 * acc * (1 + .1 * (U.engine || 0)) * (1 - clamp(u / top) ** 2) + g.nitroOn * 11) * gas * dt;
|
| 457 |
else if (g.nitroOn > .1) u += g.nitroOn * 11 * dt;
|
| 458 |
if (brake) u -= (u > .5 ? 26 : 8) * brake * dt;
|
|
|
|
| 459 |
u = Math.max(-16, u - Math.sign(u) * (.3 + .00034 * u * u) * dt);
|
| 460 |
if (!gas && !brake && Math.abs(u) < .25) u = 0;
|
| 461 |
const grip = (hand ? 1.4 + .15 * (U.grip || 0) : 9 * (1 + .12 * (U.grip || 0)) + Math.min(9, Math.abs(u) * .09)) * (RM ? RM.grip : 1) * (HA ? .8 : 1.2) * gripT;
|
|
@@ -469,8 +510,11 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 469 |
// drift scoring
|
| 470 |
const slip = Math.atan2(Math.abs(w), Math.max(1, Math.abs(u)));
|
| 471 |
g.slip = Math.abs(u) > 6 ? clamp((slip - .12) * 3) + (brake && Math.abs(u) > 20 ? .35 : 0) : 0; if (g.thudT > 0) g.thudT -= dt;
|
| 472 |
-
if (slip > .22 && Math.abs(u) > 12) { g.drift += slip * Math.abs(u) * dt * 6; g.driftT = .7; }
|
| 473 |
-
else if (g.driftT > 0) {
|
|
|
|
|
|
|
|
|
|
| 474 |
// move, with ramps, rooftops, buildings, water and traffic
|
| 475 |
const nx = g.x + g.vel.x * dt, nz = g.z + g.vel.z * dt;
|
| 476 |
const hit = hitBox(nx, nz, g.y + .5, 1.15);
|
|
@@ -504,6 +548,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 504 |
// drive into the loop and the track takes you round
|
| 505 |
if (g.x > LOOP_X - 1.5 && g.x < LOOP_X + .5 && Math.abs(g.z) < HW && Math.cos(g.yaw) > .8 && u > 3 && g.y < .2) { g.mode = "rail"; g.d = T.D[T.loopIn]; g.v = u; return; }
|
| 506 |
traffic(dt);
|
|
|
|
| 507 |
g.roll = lerp(g.roll, (g.sr || 0) + (g.tRoll || 0), clamp(dt * 20));
|
| 508 |
if ((g.y === 0 || gr.terrain) && Math.abs(u) < 40 && !gr.roof && !city.isWater(g.x, g.z) && !hitBox(g.x, g.z, .5, 3)) g.last = { x: g.x, z: g.z, yaw: g.yaw, y: gr.terrain ? g.y : 0 };
|
| 509 |
g.gForce = 1 + Math.abs(u * yawRate) / G * .5;
|
|
@@ -588,13 +633,28 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 588 |
a.y += vert * lift;
|
| 589 |
}
|
| 590 |
g.vel.addScaledVector(a, dt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 591 |
g.x += g.vel.x * dt; g.y += g.vel.y * dt; g.z += g.vel.z * dt;
|
| 592 |
g.thr = lerp(g.thr, (up ? 1 : down ? .7 : gas ? .9 : g.hover || g.landing ? .55 : g.jump ? 0 : .3) + g.nitroOn * .4, clamp(dt * 6));
|
| 593 |
g.gForce = 1 + Math.abs(a.clone().addScaledVector(UP, G).dot(bu)) / G * .6;
|
| 594 |
// stunt rings
|
| 595 |
for (const r of RINGS) {
|
| 596 |
const dx = g.x - r.x, dy = g.y - r.y, dz = g.z - r.z, plane = dx * r.nx + dz * r.nz, side = Math.sign(plane);
|
| 597 |
-
if (r.side && side !== r.side && Math.abs(plane) < 6 && Math.hypot(dx - plane * r.nx, dy, dz - plane * r.nz) < 8.5 && performance.now() - r.done > 3000) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 598 |
r.side = side;
|
| 599 |
}
|
| 600 |
// buildings
|
|
@@ -607,6 +667,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 607 |
if (g.wreck > 0) return;
|
| 608 |
}
|
| 609 |
traffic(dt);
|
|
|
|
| 610 |
const gr = groundAt(g.x, g.z, g.y);
|
| 611 |
// flying low and fast pays too
|
| 612 |
if (!g.jump && g.y - gr.h > 1 && g.y - gr.h < 12 && g.vel.length() > 42) { g.lowT = Math.max(0, g.lowT || 0) + dt; if (g.lowT > 2.5) { g.lowT = -5; addScore(250, "Low pass"); } } else if ((g.lowT || 0) > 0) g.lowT = 0; else if (g.lowT < 0) g.lowT += dt;
|
|
@@ -668,7 +729,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 668 |
mx.drawImage(mapC, -(g.x - bounds.x0) / MM, -(g.z - bounds.z0) / MM);
|
| 669 |
for (const z of ZONES) { const px = (z.x - g.x) / MM, pz = (z.z - g.z) / MM; mx.fillStyle = z.safe ? (g.done.has(z.id) ? "#888" : "#3dff8a") : "#ff4455"; mx.beginPath(); mx.arc(px, pz, 5, 0, 7); mx.fill(); }
|
| 670 |
if (opts.mapExtra) opts.mapExtra(mx, g, MM, c);
|
| 671 |
-
|
| 672 |
if (life) { mx.fillStyle = "#ffd23d"; for (const n of life.nearCars(g.x, g.z, c * MM)) { const px = (n.x - g.x) / MM, pz = (n.z - g.z) / MM; if (Math.abs(px) < c && Math.abs(pz) < c) mx.fillRect(px - 1, pz - 1, 2, 2); } }
|
| 673 |
mx.restore();
|
| 674 |
mx.fillStyle = "#fff"; mx.beginPath(); mx.moveTo(c, c - 8); mx.lineTo(c - 6, c + 6); mx.lineTo(c + 6, c + 6); mx.closePath(); mx.fill();
|
|
@@ -696,7 +757,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 696 |
},
|
| 697 |
};
|
| 698 |
return {
|
| 699 |
-
api, RINGS,
|
| 700 |
get state() { return g; }, get photo() { return photo; },
|
| 701 |
enter() { active = true; start(); },
|
| 702 |
exit() { active = false; keys.clear(); touch.clear(); sound.setGame("off"); if (photo) togglePhoto(); },
|
|
@@ -763,7 +824,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 763 |
$("gSpd").textContent = Math.round(speed); $("gAlt").textContent = Math.round(Math.max(0, g.y)); $("gVs").textContent = (air ? g.vel.y : 0).toFixed(1);
|
| 764 |
const landAid = air && g.above < 40 && g.vel.y < -1 ? `${g.above < 12 && g.vel.y < -5 ? "PULL UP · " : ""}${Math.round(g.above)} m · sink ${(-g.vel.y).toFixed(1)} m/s${-g.vel.y < 3 ? " ✓" : ""}` : "";
|
| 765 |
if (g.veh === "foot" && (g.nearT = (g.nearT || 0) - dt) <= 0) { g.nearT = .25; const n = nearestCar(); g.nearName = n ? (n.kind === "hero" ? "your VOID car" : n.kind === "owned" ? n.o.ride.model.name : n.o.model.name) : cartNear() ? "🌭" : ""; }
|
| 766 |
-
$("gHint").textContent = g.msgT > 0 ? g.msg : g.veh === "foot" && g.nearName ? (g.nearName === "🌭" ? "E: buy a hot dog ($10, +30 health)" : `E: get into ${g.nearName}`) : g.stall > .5 ? "STALL: push the nose down or add thrust" : landAid || (g.drift > 20 ? `Drift ${Math.round(g.drift)}` : "");
|
| 767 |
$("gFly").textContent = g.mode === "air" ? (g.landing ? "Hover" : "Land") : "Fly";
|
| 768 |
if ($("gHp")) { $("gHp").style.setProperty("--v", g.hp / 100); $("gHp").classList.toggle("low", g.hp < 35); }
|
| 769 |
if ($("gNos")) $("gNos").style.setProperty("--v", g.nitro);
|
|
@@ -778,7 +839,7 @@ export function createGame(W, car, sound, life, opts = {}) {
|
|
| 778 |
thrust: { power: air && g.veh === "car" ? g.thr : 0, angle: g.ang, deploy: air && g.veh === "car" && !(g.jump && !g.hover && !g.landing && g.thr < .05) ? 1 : 0 }, wings: g.veh === "car" ? g.wings : 0, air, cam,
|
| 779 |
inside: view === "seat", screenOn: view === "seat", mode: !air ? "DRIVE" : g.wings > .9 ? "GLIDE" : g.hover ? "HOVER" : "THRUST",
|
| 780 |
rpm, gear, load: held("gas") || gp.gas > .3 ? 1 : .2, engine: g.veh === "foot" || g.veh === "board" ? 0 : !air ? 1 : .15, walk: g.walk || 0, crouch: g.veh === "board" ? Math.max((g.charge || 0) / .6, g.grabT > 0 ? 1 : 0) : 0, grinding: !!g.grind, braking: g.ap ? (g.ap.brake || 0) : (g.brakeIn || 0), ride: g.ride, heroPark: g.heroPark, ridePark: g.ridePark, boat: g.boat, zones, reveal: 1,
|
| 781 |
-
splash: g.splashT > 0 ? (g.splashT -= dt, 1) : 0, nitro: g.nitroOn, hp: g.hp, veh: g.veh || "car", fuel: g.fuel, thr: g.thr, boom: g.boom, sparks: g.sparks, shake: g.shake || 0, wrecked: g.wreck > 0,
|
| 782 |
};
|
| 783 |
},
|
| 784 |
};
|
|
|
|
| 78 |
if ($("gHorn")) $("gHorn").onclick = () => horn();
|
| 79 |
if ($("gTime")) $("gTime").onclick = () => opts.cycleTime && opts.cycleTime();
|
| 80 |
if ($("gPhoto")) $("gPhoto").onclick = togglePhoto;
|
| 81 |
+
if ($("gResetBtn")) $("gResetBtn").onclick = () => reset();
|
| 82 |
$("gGo").onclick = () => { $("gReady").hidden = true; if (!sound.on) sound.setOn(true); g.started = true; };
|
| 83 |
|
| 84 |
// ---- extra stunts: ramps round the city and rings in the sky ----
|
|
|
|
| 104 |
{ x: -600, z: 1400, yaw: Math.PI / 2, len: 30, h: .7 }, { x: -760, z: 1370, yaw: Math.PI / 4, len: 18, h: 1.3 },
|
| 105 |
{ x: 974, z: 1215, yaw: Math.PI / 2, len: 210, h: .9 }, // the boardwalk railing
|
| 106 |
{ x: 2580, z: 12, yaw: 0, len: 50, h: .8 }, { x: 2580, z: -12, yaw: 0, len: 50, h: .8 }, // by the highway at the foot of the mountains
|
| 107 |
+
{ x: 1720, z: 9.6, yaw: 0, len: 860, h: .8 }, { x: 1720, z: -9.6, yaw: 0, len: 860, h: .8 }, // the highway guardrails
|
| 108 |
+
// rooftop ledges: a railing along one edge of a dozen mid-height roofs (land the car up there, then Y)
|
| 109 |
+
...W.buildings.filter(b => b.h > 16 && b.h < 48 && b.hw > 9 && b.hd > 6 && Math.abs(b.x) < 900).sort((a, b) => a.x * 7 + a.z - (b.x * 7 + b.z)).filter((b, i) => i % 23 === 0).slice(0, 12)
|
| 110 |
+
.map(b => ({ x: b.x - b.hw + 1, z: b.z - b.hd + .7, yaw: 0, len: b.hw * 2 - 2, h: b.h + .8, b0: b.h })),
|
| 111 |
].map(r => ({ ...r, c: Math.cos(r.yaw), s: Math.sin(r.yaw) }));
|
| 112 |
{
|
| 113 |
const parts = [];
|
| 114 |
for (const r of RAILS) {
|
| 115 |
const bar = new THREE.CylinderGeometry(.06, .06, r.len, 8).rotateZ(Math.PI / 2).translate(r.len / 2, r.h, 0);
|
| 116 |
+
const b0 = r.b0 || 0, g = [bar]; for (let a = 1; a < r.len; a += 3) g.push(new THREE.BoxGeometry(.08, r.h - b0, .08).translate(a, (r.h + b0) / 2, 0));
|
| 117 |
for (const q of g) { q.rotateY(-r.yaw); q.translate(r.x, 0, r.z); parts.push(q.toNonIndexed()); }
|
| 118 |
}
|
| 119 |
W.scene.add(new THREE.Mesh(mergeGeometries(parts.map(q => { for (const k of Object.keys(q.attributes)) if (k !== "position" && k !== "normal") q.deleteAttribute(k); return q; })), new THREE.MeshStandardMaterial({ color: 0xd8dde4, metalness: .9, roughness: .25 })));
|
| 120 |
}
|
| 121 |
+
// (magnet: falling onto a rail from the air catches it from further away, and the grind pulls you onto the bar)
|
| 122 |
+
const railNear = (x, z, y, m) => { for (const r of RAILS) { const dx = x - r.x, dz = z - r.z, a = dx * r.c + dz * r.s, b = -dx * r.s + dz * r.c; if (a > .3 && a < r.len - .3 && Math.abs(b) < (m ? 2.2 : .8) && y > r.h + (m ? -.3 : .05) && y < r.h + (m ? 2.4 : 1.4)) return { r, a }; } return null; };
|
| 123 |
const rampAt = (x, z) => {
|
| 124 |
for (const r of RAMPS) {
|
| 125 |
const dx = x - r.x, dz = z - r.z, c = Math.cos(r.yaw), s = Math.sin(r.yaw), a = dx * c + dz * s, b = -dx * s + dz * c;
|
|
|
|
| 138 |
const m = new THREE.Mesh(new THREE.TorusGeometry(9, .6, 10, 40), mat.clone()); m.position.set(x, y, z); m.rotation.y = -yaw + Math.PI / 2; W.scene.add(m);
|
| 139 |
RINGS.push({ m, x, y, z, nx: Math.cos(yaw), nz: Math.sin(yaw), done: 0, side: 0 }); void rr;
|
| 140 |
});
|
| 141 |
+
// boost chains: five cyan rings in a row high over the towers; each refills nitro and flings you on, all five in a row pays big
|
| 142 |
+
const boostMat = new THREE.MeshBasicMaterial({ color: new THREE.Color(0x3df5ff).multiplyScalar(2.4), toneMapped: false }), ringGeo = new THREE.TorusGeometry(11, .8, 10, 44);
|
| 143 |
+
[[-420, 320, -300, 0], [-320, 430, 1300, 0], [620, 260, 260, Math.PI / 2]].forEach(([x0, y0, z0, yaw], chain) => {
|
| 144 |
+
for (let k = 0; k < 5; k++) {
|
| 145 |
+
const x = x0 + Math.cos(yaw) * k * 120, z = z0 + Math.sin(yaw) * k * 120, y = y0 + Math.sin(k * 1.3) * 14;
|
| 146 |
+
const m = new THREE.Mesh(ringGeo, boostMat); m.position.set(x, y, z); m.rotation.y = -yaw + Math.PI / 2; W.scene.add(m);
|
| 147 |
+
RINGS.push({ m, x, y, z, nx: Math.cos(yaw), nz: Math.sin(yaw), done: 0, side: 0, boost: true, chain, idx: k, R: 10.5 });
|
| 148 |
+
}
|
| 149 |
+
});
|
| 150 |
}
|
| 151 |
+
const chains = [0, 0, 0].map(() => ({ n: 0, t: 0 }));
|
| 152 |
|
| 153 |
function spawn(at) {
|
| 154 |
const s = at || SPAWN; rig.yaw = null; if (g && g.ride) releaseRide(); if (g) { g.heroPark = null; }
|
|
|
|
| 279 |
g.trS += turn * 8.5 * dt; if (held("drift")) g.trF += 9.5 * dt; if (held("down")) g.trH = (g.trH || 0) + 9.5 * dt; if (held("nitro")) g.grabT = (g.grabT || 0) + dt;
|
| 280 |
g.airT += dt; g.charge = 0;
|
| 281 |
if (held("up") && !g.jumpHeld && g.dbl) { g.dbl = false; g.vy = Math.max(g.vy, 0) + 5.5; u += 3; sound.whoosh(); g.shake = .3; } // double jump: one thruster burst
|
| 282 |
+
if (g.vy <= 1.5) { const rn = railNear(g.x, g.z, g.y, true); if (rn) { const along = fx * rn.r.c + fz * rn.r.s; if (Math.abs(along) > .35) {
|
| 283 |
landBoard(); g.grind = { r: rn.r, a: rn.a, dir: Math.sign(along), v: Math.max(7, Math.abs(u) * Math.abs(along)), m: 0 }; sound.thud && sound.thud(.45); g.jumpHeld = held("up"); return; } } }
|
| 284 |
}
|
| 285 |
g.jumpHeld = held("up");
|
|
|
|
| 319 |
function wreck(why) { g.wreck = 2.6; g.boom = 1; g.vel.set(0, 0, 0); say(why + ". Respawning…", 2.6); sound.crash(); }
|
| 320 |
// into the water: a splash, the car sinks, and you're put back on the last bit of road (no explosion, no wreck)
|
| 321 |
function splash() { const lake = Math.hypot(g.x - city.lake.x, g.z - city.lake.z) < 120; g.sink = 1.6; g.splashT = 1; g.mode = "drive"; say(lake ? "Splash! That's the park lake" : "Splash! You drove into the river", 2.2); sound.crash(); }
|
| 322 |
+
// R: back on your wheels right where you are, lined up with the street and at the same speed (stuck, flipped,
|
| 323 |
+
// nosed into a wall); in the air it levels you out; only when there is no free ground near is it the last road
|
| 324 |
+
function reset() {
|
| 325 |
+
if (!g || !g.started || g.wreck > 0) return;
|
| 326 |
+
const back = () => { spawn({ ...g.last }); say("Back on the road", 1.5); };
|
| 327 |
+
if (g.veh !== "car" || g.mode === "rail") return back();
|
| 328 |
+
if (g.mode === "air") { Object.assign(g, { roll: 0, pitch: 0, hover: true, landing: false, jump: false, stall: 0 }); say("Levelled out", 1.2); return; }
|
| 329 |
+
let spot = null;
|
| 330 |
+
for (let rad = 0; rad <= 24 && !spot; rad += 2) for (let a = 0; a < 6.3 && !spot; a += rad ? .5 : 7) { const x = g.x + Math.cos(a) * rad, z = g.z + Math.sin(a) * rad; if (!hitBox(x, z, .5, 1.4) && !city.isWater(x, z)) spot = [x, z]; }
|
| 331 |
+
if (!spot) return back();
|
| 332 |
+
const sp = Math.hypot(g.vel.x, g.vel.z); let yaw = Math.round(g.yaw / (Math.PI / 2)) * (Math.PI / 2);
|
| 333 |
+
for (const d of [0, Math.PI / 2, -Math.PI / 2, Math.PI]) if (!hitBox(spot[0] + Math.cos(yaw + d) * 7, spot[1] + Math.sin(yaw + d) * 7, .5, 1.2)) { yaw += d; break; }
|
| 334 |
+
Object.assign(g, { x: spot[0], z: spot[1], y: Math.max(0, groundAt(spot[0], spot[1], 0).h), yaw, pitch: 0, roll: 0, mode: "drive", sp: 0, sr: 0, spV: 0, srV: 0, trS: 0, trF: 0 });
|
| 335 |
+
g.vel.set(Math.cos(yaw) * sp, 0, Math.sin(yaw) * sp); rig.yaw = null; say("Back on your wheels", 1.2);
|
| 336 |
+
}
|
| 337 |
function horn() { sound.horn && sound.horn(opts.hornType ? opts.hornType() : 0); life && life.honk(g.x, g.z); }
|
| 338 |
|
| 339 |
// the ground under a point: ramps, rooftops (only if you are up there), else the street; water is -1
|
|
|
|
| 381 |
pv.x = pv.x * .3 + nvx * .6; pv.z = pv.z * .3 + nvz * .6; c.v *= .3;
|
| 382 |
hurt(dmg, `Hit by a ${c.kind.id}`); impact((g.x + c.x) / 2, .6, (g.z + c.z) / 2, Math.max(dmg, rel * .6)); if (dmg > 2) { sound.crash(); g.sparks = .7; } else sound.pop();
|
| 383 |
}
|
| 384 |
+
} else if (ps > 25 && Math.abs(along) < hl + 1 && Math.abs(side) < hw + 2 && Math.abs(side) >= hw) { // within 2 m of its side
|
| 385 |
+
const t = g.near.get(c) || 0, now = performance.now();
|
| 386 |
+
if (now - t > 4000) { g.near.set(c, now); g.nearN = now - (g.nearLast || 0) < 3500 ? (g.nearN || 0) + 1 : 1; g.nearLast = now; addScore(25 * g.nearN, g.nearN > 1 ? `NEAR MISS ×${g.nearN}` : "NEAR MISS", true); sound.pop(); }
|
| 387 |
}
|
| 388 |
}
|
| 389 |
}
|
|
|
|
| 458 |
else if (g.fuel < .15 && g.fuelMsg !== 2 && g.fuel > 0) { g.fuelMsg = 2; say("Low fuel: find a ⛽ station", 4); }
|
| 459 |
if (g.fuel > .2) g.fuelMsg = 0;
|
| 460 |
service(dt);
|
| 461 |
+
// three stages: a tap is a quick kick, holding boosts, and holding from a full tank for a second is OVERDRIVE
|
| 462 |
+
const nHeld = !!(held("nitro") || (g.ap && g.ap.nitro));
|
| 463 |
+
if (nHeld && !g.nWas) { g.nT = 0; g.odArm = g.nitro > .985; }
|
| 464 |
+
if (nHeld) g.nT = (g.nT || 0) + dt;
|
| 465 |
+
if (!nHeld && g.nWas && g.nT < .2 && g.nitro > .1 && g.fuel > 0) { g.nitro -= .1; g.kick = 7; g.micro = .35; }
|
| 466 |
+
g.nWas = nHeld; g.micro = Math.max(0, (g.micro || 0) - dt);
|
| 467 |
+
const wantNitro = nHeld && (g.nT >= .16 || g.ap) && g.nitro > .02 && g.fuel > 0;
|
| 468 |
+
if (wantNitro && g.odArm && g.nT > 1 && !g.od) { g.od = true; say("⚡ OVERDRIVE", 1.6); sound.whoosh(); g.shake = .5; }
|
| 469 |
+
if (!wantNitro) g.od = false;
|
| 470 |
+
g.nitroOn = lerp(g.nitroOn, wantNitro ? (g.od ? 1.6 : 1) : g.micro > 0 ? .8 : 0, clamp(dt * 8));
|
| 471 |
+
const nCap = 1 + .35 * ((opts.upg || {}).nitro || 0) + (opts.tune ? opts.tune("nitro") : 0);
|
| 472 |
+
if (wantNitro) g.nitro = Math.max(0, g.nitro - dt / (5 * nCap) * (g.od ? 1.3 : 1)); else g.nitro = Math.min(1, g.nitro + dt / 14);
|
| 473 |
|
| 474 |
if (g.veh && g.veh !== "car" && opts.vehicles) {
|
| 475 |
const I = { turn, gas, brake, up: g.fuel > 0 && (g.ap ? g.ap.up : held("up")) ? 1 : 0, down: (g.ap ? g.ap.down : held("down")) ? 1 : 0, nitro: g.nitroOn > .3, stickY: -stick.y };
|
|
|
|
| 496 |
if (gas) u += (u < -.5 ? 20 : 11.5 * acc * (1 + .1 * (U.engine || 0)) * (1 - clamp(u / top) ** 2) + g.nitroOn * 11) * gas * dt;
|
| 497 |
else if (g.nitroOn > .1) u += g.nitroOn * 11 * dt;
|
| 498 |
if (brake) u -= (u > .5 ? 26 : 8) * brake * dt;
|
| 499 |
+
if (g.kick) { u += g.kick; g.kick = 0; g.shake = Math.max(g.shake || 0, .25); }
|
| 500 |
u = Math.max(-16, u - Math.sign(u) * (.3 + .00034 * u * u) * dt);
|
| 501 |
if (!gas && !brake && Math.abs(u) < .25) u = 0;
|
| 502 |
const grip = (hand ? 1.4 + .15 * (U.grip || 0) : 9 * (1 + .12 * (U.grip || 0)) + Math.min(9, Math.abs(u) * .09)) * (RM ? RM.grip : 1) * (HA ? .8 : 1.2) * gripT;
|
|
|
|
| 510 |
// drift scoring
|
| 511 |
const slip = Math.atan2(Math.abs(w), Math.max(1, Math.abs(u)));
|
| 512 |
g.slip = Math.abs(u) > 6 ? clamp((slip - .12) * 3) + (brake && Math.abs(u) > 20 ? .35 : 0) : 0; if (g.thudT > 0) g.thudT -= dt;
|
| 513 |
+
if (slip > .22 && Math.abs(u) > 12) { g.drift += slip * Math.abs(u) * dt * 6; g.driftT = .7; g.driftDur = (g.driftDur || 0) + dt; g.driftMul = Math.min(5, 1 + Math.floor(g.driftDur / 1.5)); }
|
| 514 |
+
else if (g.driftT > 0) {
|
| 515 |
+
g.driftT -= dt;
|
| 516 |
+
if (g.driftT <= 0) { if (g.drift > 30) addScore(Math.round(g.drift * (g.driftMul || 1)), g.driftMul > 1 ? `Drift ×${g.driftMul}` : "Drift"); g.drift = 0; g.driftDur = 0; g.driftMul = 1; }
|
| 517 |
+
}
|
| 518 |
// move, with ramps, rooftops, buildings, water and traffic
|
| 519 |
const nx = g.x + g.vel.x * dt, nz = g.z + g.vel.z * dt;
|
| 520 |
const hit = hitBox(nx, nz, g.y + .5, 1.15);
|
|
|
|
| 548 |
// drive into the loop and the track takes you round
|
| 549 |
if (g.x > LOOP_X - 1.5 && g.x < LOOP_X + .5 && Math.abs(g.z) < HW && Math.cos(g.yaw) > .8 && u > 3 && g.y < .2) { g.mode = "rail"; g.d = T.D[T.loopIn]; g.v = u; return; }
|
| 550 |
traffic(dt);
|
| 551 |
+
if (opts.props && Math.abs(u) > 4) opts.props(g.x, g.z, g.y, g.vel);
|
| 552 |
g.roll = lerp(g.roll, (g.sr || 0) + (g.tRoll || 0), clamp(dt * 20));
|
| 553 |
if ((g.y === 0 || gr.terrain) && Math.abs(u) < 40 && !gr.roof && !city.isWater(g.x, g.z) && !hitBox(g.x, g.z, .5, 3)) g.last = { x: g.x, z: g.z, yaw: g.yaw, y: gr.terrain ? g.y : 0 };
|
| 554 |
g.gForce = 1 + Math.abs(u * yawRate) / G * .5;
|
|
|
|
| 633 |
a.y += vert * lift;
|
| 634 |
}
|
| 635 |
g.vel.addScaledVector(a, dt);
|
| 636 |
+
if (g.kick) { g.vel.addScaledVector(f, g.kick); g.kick = 0; }
|
| 637 |
+
// landing assist: under 10 m on a landing the sink is cushioned to a soft touchdown, and near a helipad you're eased onto its middle
|
| 638 |
+
if (g.landing && above < 10 && g.vel.y < -2.5) g.vel.y = lerp(g.vel.y, -2.5, clamp(dt * 6));
|
| 639 |
+
if (g.landing) { const pad = (opts.pads ? opts.pads() : ZONES).find(z => z.y && Math.hypot(g.x - z.x, g.z - z.z) < 60 && g.y > z.y - 2); if (pad) { g.vel.x += ((pad.x - g.x) * .8 - g.vel.x * .6) * dt; g.vel.z += ((pad.z - g.z) * .8 - g.vel.z * .6) * dt; } }
|
| 640 |
+
// the sonic boom: past 500 km/h on nitro the air cracks (a shockwave, a bonus and some nitro back)
|
| 641 |
+
if (g.veh === "car" && V > 140 && g.nitroOn > .5 && performance.now() - (g.boomT || 0) > 12000) { g.boomT = performance.now(); g.sonic = 1; g.nitro = Math.min(1, g.nitro + .3); g.shake = 1; addScore(500, "💥 SONIC BOOM"); sound.impact && sound.impact(); }
|
| 642 |
+
g.sonic = Math.max(0, (g.sonic || 0) - dt);
|
| 643 |
g.x += g.vel.x * dt; g.y += g.vel.y * dt; g.z += g.vel.z * dt;
|
| 644 |
g.thr = lerp(g.thr, (up ? 1 : down ? .7 : gas ? .9 : g.hover || g.landing ? .55 : g.jump ? 0 : .3) + g.nitroOn * .4, clamp(dt * 6));
|
| 645 |
g.gForce = 1 + Math.abs(a.clone().addScaledVector(UP, G).dot(bu)) / G * .6;
|
| 646 |
// stunt rings
|
| 647 |
for (const r of RINGS) {
|
| 648 |
const dx = g.x - r.x, dy = g.y - r.y, dz = g.z - r.z, plane = dx * r.nx + dz * r.nz, side = Math.sign(plane);
|
| 649 |
+
if (r.side && side !== r.side && Math.abs(plane) < 6 && Math.hypot(dx - plane * r.nx, dy, dz - plane * r.nz) < (r.R || 8.5) && performance.now() - r.done > 3000) {
|
| 650 |
+
r.done = performance.now();
|
| 651 |
+
if (r.boost) { // refill the nitro and throw the car forward
|
| 652 |
+
g.nitro = 1; const V0 = g.vel.length() || 1, add = Math.min(30, Math.max(0, 160 - V0)); g.vel.multiplyScalar((V0 + add) / V0); g.shake = .6; sound.whoosh();
|
| 653 |
+
const C = chains[r.chain], now = performance.now(); C.n = r.idx === 0 || now - C.t > 9000 ? (r.idx === 0 ? 1 : 0) : r.idx === C.n ? C.n + 1 : 0; C.t = now;
|
| 654 |
+
if (C.n === 5) { C.n = 0; addScore(2000, "⚡ SKY CHAIN COMPLETE"); } else addScore(200, `⚡ Sky boost${C.n > 1 ? ` ${C.n}/5` : ""}`);
|
| 655 |
+
opts.onBoostRing && opts.onBoostRing(r);
|
| 656 |
+
} else { g.rings++; addScore(300, `Ring ${g.rings}`); r.m.material.color.set(0x3dff8a).multiplyScalar(2.5); setTimeout(() => r.m.material.color.set(0xffc23d).multiplyScalar(2.2), 3000); }
|
| 657 |
+
}
|
| 658 |
r.side = side;
|
| 659 |
}
|
| 660 |
// buildings
|
|
|
|
| 667 |
if (g.wreck > 0) return;
|
| 668 |
}
|
| 669 |
traffic(dt);
|
| 670 |
+
if (opts.props && g.y < 9) opts.props(g.x, g.z, g.y, g.vel);
|
| 671 |
const gr = groundAt(g.x, g.z, g.y);
|
| 672 |
// flying low and fast pays too
|
| 673 |
if (!g.jump && g.y - gr.h > 1 && g.y - gr.h < 12 && g.vel.length() > 42) { g.lowT = Math.max(0, g.lowT || 0) + dt; if (g.lowT > 2.5) { g.lowT = -5; addScore(250, "Low pass"); } } else if ((g.lowT || 0) > 0) g.lowT = 0; else if (g.lowT < 0) g.lowT += dt;
|
|
|
|
| 729 |
mx.drawImage(mapC, -(g.x - bounds.x0) / MM, -(g.z - bounds.z0) / MM);
|
| 730 |
for (const z of ZONES) { const px = (z.x - g.x) / MM, pz = (z.z - g.z) / MM; mx.fillStyle = z.safe ? (g.done.has(z.id) ? "#888" : "#3dff8a") : "#ff4455"; mx.beginPath(); mx.arc(px, pz, 5, 0, 7); mx.fill(); }
|
| 731 |
if (opts.mapExtra) opts.mapExtra(mx, g, MM, c);
|
| 732 |
+
for (const r of RINGS) { const px = (r.x - g.x) / MM, pz = (r.z - g.z) / MM; if (Math.abs(px) < c && Math.abs(pz) < c) { mx.fillStyle = r.boost ? "#3df5ff" : "#ffc23d"; mx.beginPath(); mx.arc(px, pz, r.boost ? 4 : 3, 0, 7); mx.fill(); } }
|
| 733 |
if (life) { mx.fillStyle = "#ffd23d"; for (const n of life.nearCars(g.x, g.z, c * MM)) { const px = (n.x - g.x) / MM, pz = (n.z - g.z) / MM; if (Math.abs(px) < c && Math.abs(pz) < c) mx.fillRect(px - 1, pz - 1, 2, 2); } }
|
| 734 |
mx.restore();
|
| 735 |
mx.fillStyle = "#fff"; mx.beginPath(); mx.moveTo(c, c - 8); mx.lineTo(c - 6, c + 6); mx.lineTo(c + 6, c + 6); mx.closePath(); mx.fill();
|
|
|
|
| 757 |
},
|
| 758 |
};
|
| 759 |
return {
|
| 760 |
+
api, RINGS, RAILS, RAMPS,
|
| 761 |
get state() { return g; }, get photo() { return photo; },
|
| 762 |
enter() { active = true; start(); },
|
| 763 |
exit() { active = false; keys.clear(); touch.clear(); sound.setGame("off"); if (photo) togglePhoto(); },
|
|
|
|
| 824 |
$("gSpd").textContent = Math.round(speed); $("gAlt").textContent = Math.round(Math.max(0, g.y)); $("gVs").textContent = (air ? g.vel.y : 0).toFixed(1);
|
| 825 |
const landAid = air && g.above < 40 && g.vel.y < -1 ? `${g.above < 12 && g.vel.y < -5 ? "PULL UP · " : ""}${Math.round(g.above)} m · sink ${(-g.vel.y).toFixed(1)} m/s${-g.vel.y < 3 ? " ✓" : ""}` : "";
|
| 826 |
if (g.veh === "foot" && (g.nearT = (g.nearT || 0) - dt) <= 0) { g.nearT = .25; const n = nearestCar(); g.nearName = n ? (n.kind === "hero" ? "your VOID car" : n.kind === "owned" ? n.o.ride.model.name : n.o.model.name) : cartNear() ? "🌭" : ""; }
|
| 827 |
+
$("gHint").textContent = g.msgT > 0 ? g.msg : g.veh === "foot" && g.nearName ? (g.nearName === "🌭" ? "E: buy a hot dog ($10, +30 health)" : `E: get into ${g.nearName}`) : g.stall > .5 ? "STALL: push the nose down or add thrust" : landAid || (g.drift > 20 ? `Drift ${Math.round(g.drift)}${g.driftMul > 1 ? ` ×${g.driftMul}` : ""}` : "");
|
| 828 |
$("gFly").textContent = g.mode === "air" ? (g.landing ? "Hover" : "Land") : "Fly";
|
| 829 |
if ($("gHp")) { $("gHp").style.setProperty("--v", g.hp / 100); $("gHp").classList.toggle("low", g.hp < 35); }
|
| 830 |
if ($("gNos")) $("gNos").style.setProperty("--v", g.nitro);
|
|
|
|
| 839 |
thrust: { power: air && g.veh === "car" ? g.thr : 0, angle: g.ang, deploy: air && g.veh === "car" && !(g.jump && !g.hover && !g.landing && g.thr < .05) ? 1 : 0 }, wings: g.veh === "car" ? g.wings : 0, air, cam,
|
| 840 |
inside: view === "seat", screenOn: view === "seat", mode: !air ? "DRIVE" : g.wings > .9 ? "GLIDE" : g.hover ? "HOVER" : "THRUST",
|
| 841 |
rpm, gear, load: held("gas") || gp.gas > .3 ? 1 : .2, engine: g.veh === "foot" || g.veh === "board" ? 0 : !air ? 1 : .15, walk: g.walk || 0, crouch: g.veh === "board" ? Math.max((g.charge || 0) / .6, g.grabT > 0 ? 1 : 0) : 0, grinding: !!g.grind, braking: g.ap ? (g.ap.brake || 0) : (g.brakeIn || 0), ride: g.ride, heroPark: g.heroPark, ridePark: g.ridePark, boat: g.boat, zones, reveal: 1,
|
| 842 |
+
splash: g.splashT > 0 ? (g.splashT -= dt, 1) : 0, nitro: g.nitroOn, od: !!g.od, nitroFull: g.nitro > .985, slip: g.veh === "car" && g.mode === "drive" ? g.slip || 0 : 0, sonic: g.sonic || 0, hp: g.hp, veh: g.veh || "car", fuel: g.fuel, thr: g.thr, boom: g.boom, sparks: g.sparks, shake: g.shake || 0, wrecked: g.wreck > 0,
|
| 843 |
};
|
| 844 |
},
|
| 845 |
};
|
static/legion.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// New Legion: the layer on top of the game that makes the first minute click and keeps every minute after it
|
| 2 |
+
// worth playing. Three keys to start and the neon launch ramp, key hints that turn up when you need them, the GPS
|
| 3 |
+
// beam and arrow, drift trails, the sonic boom and the cloud deck, smashable street props, smoke and fireballs when
|
| 4 |
+
// traffic falls out of the sky, score pops, and the city's light columns only where they help.
|
| 5 |
+
import * as THREE from "three";
|
| 6 |
+
import { RAMP_X, LZ } from "./world.js";
|
| 7 |
+
|
| 8 |
+
export function createLegion(o) {
|
| 9 |
+
const { W, game, sound, store, life, COARSE } = o, scene = W.scene, city = W.city, fx = W.fx, $ = id => document.getElementById(id);
|
| 10 |
+
const add = m => { scene.add(m); return m; };
|
| 11 |
+
const puff = (x, y, z, vx, vy, vz, col, size, life = 1) => { const pf = fx.puffs[fx.puffI++ % fx.puffs.length]; pf.s.position.set(x, y, z); pf.life = life; pf.s.visible = true; pf.s.scale.setScalar(size); pf.grow = size; pf.s.material.color.set(col); pf.v.set(vx, vy, vz); };
|
| 12 |
+
const rnd = () => Math.random() - .5;
|
| 13 |
+
|
| 14 |
+
// ---- score pops: the big moments get a word in the middle of the screen ----
|
| 15 |
+
const popEl = $("gPop"); let popAt = 0;
|
| 16 |
+
function pop(text, cls = "") { if (!popEl || performance.now() - popAt < 220) return; popAt = performance.now(); popEl.className = "g-pop"; popEl.textContent = text; void popEl.offsetWidth; popEl.className = "g-pop on " + cls; }
|
| 17 |
+
function onScore(why, pts) {
|
| 18 |
+
if (/^NEAR MISS/.test(why)) pop(`${why} +$${pts}`);
|
| 19 |
+
else if (/SONIC BOOM/.test(why)) pop(`💥 SONIC BOOM +$${pts}`, "hot");
|
| 20 |
+
else if (/SKY CHAIN/.test(why)) pop(`⚡ SKY CHAIN +$${pts.toLocaleString()}`, "gold");
|
| 21 |
+
else if (/^⚡ Sky boost/.test(why)) pop(why);
|
| 22 |
+
else if (/^Drift ×/.test(why)) pop(`${why.toUpperCase()} +$${pts.toLocaleString()}`, "hot");
|
| 23 |
+
else if (/^Full loop|^Landed at|^Butter landing|Above the clouds/.test(why)) pop(why.toUpperCase(), "gold");
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
// ---- light columns (race starts, VOID Motors, helipad beacons): only near enough to matter, never right on top of you,
|
| 27 |
+
// and the tall helipad beacons only while you fly. A render layer is switched, so the modules' own show/hide still works ----
|
| 28 |
+
const columns = [];
|
| 29 |
+
scene.traverse(m => { const P = m.isMesh && m.geometry.type === "CylinderGeometry" && m.geometry.parameters; if (!P || !P.openEnded || ![260, 80, 60, 34].includes(P.height)) return; m.updateMatrixWorld(); columns.push({ m, sky: P.height === 260, far: P.height === 80 ? 700 : 350, p: new THREE.Vector3().setFromMatrixPosition(m.matrixWorld) }); });
|
| 30 |
+
let colT = 0;
|
| 31 |
+
function columnsUpdate(dt, cam, air) {
|
| 32 |
+
if ((colT -= dt) > 0) return; colT = .25;
|
| 33 |
+
for (const c of columns) { if (c.m.parent !== scene) c.p.setFromMatrixPosition(c.m.matrixWorld); const d = c.p.distanceTo(cam); c.m.layers.set((c.sky ? air && d < 2500 : d > 28 && d < c.far) ? 0 : 30); }
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// ---- traffic in the sky: a smoke trail on the way down, a fireball where it lands (or where two collide) ----
|
| 37 |
+
life.onSmoke = (x, y, z) => puff(x, y, z, rnd(), 1 + Math.random(), rnd(), 0x2b2b2b, 1.3, 1.3);
|
| 38 |
+
life.onBoom = (x, z, power, y = 0) => {
|
| 39 |
+
for (let k = 0; k < 36; k++) puff(x + rnd() * 3, y + 1 + Math.random() * 2, z + rnd() * 3, rnd() * 16, 3 + Math.random() * 12, rnd() * 16, k % 3 ? 0xff7a1a : k % 2 ? 0xffd23d : 0x222222, 1.6 + Math.random(), 1.4);
|
| 40 |
+
const s = game.state; if (!s) return; const d = Math.hypot(x - s.x, z - s.z);
|
| 41 |
+
if (d < 420) { sound.crash(); if (d < 140) s.shake = Math.min(1, (s.shake || 0) + .5 * (1 - d / 140)); }
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
// ---- the GPS: a light column on the destination and a floating arrow just ahead of the car pointing the way ----
|
| 45 |
+
const beamMat = new THREE.MeshBasicMaterial({ color: new THREE.Color(0x3dfcff).multiplyScalar(1.5), transparent: true, opacity: .2, blending: THREE.AdditiveBlending, depthWrite: false, toneMapped: false, side: THREE.DoubleSide });
|
| 46 |
+
const beam = add(new THREE.Mesh(new THREE.CylinderGeometry(1.8, 1.8, 420, 18, 1, true).translate(0, 210, 0), beamMat)), pad = add(new THREE.Mesh(new THREE.RingGeometry(5, 6.4, 40).rotateX(-Math.PI / 2), beamMat));
|
| 47 |
+
const chevGeo = new THREE.ShapeGeometry(new THREE.Shape([[0, 1.1], [1, -.45], [.5, -.45], [0, .25], [-.5, -.45], [-1, -.45]].map(([x, y]) => new THREE.Vector2(x, y)))).rotateX(-Math.PI / 2).rotateY(-Math.PI / 2);
|
| 48 |
+
const chev = add(new THREE.Mesh(chevGeo, new THREE.MeshBasicMaterial({ color: new THREE.Color(0x3dfcff).multiplyScalar(1.8), transparent: true, opacity: .9, toneMapped: false, side: THREE.DoubleSide, depthWrite: false })));
|
| 49 |
+
beam.visible = pad.visible = chev.visible = false;
|
| 50 |
+
function gpsUpdate(time, s) {
|
| 51 |
+
const R = o.races && o.races(), race = R && R.race && R.race.next, nav = o.nav && o.nav(), dest = nav && nav.dest, pts = nav ? nav.pts : [];
|
| 52 |
+
let tx = null, tz = null;
|
| 53 |
+
if (race) { tx = race[0]; tz = race[2]; }
|
| 54 |
+
else if (dest) {
|
| 55 |
+
tx = dest.x; tz = dest.z;
|
| 56 |
+
if (pts.length > 1) { let best = 0, bd = 1e9; pts.forEach(([x, z], i) => { const d = Math.hypot(x - s.x, z - s.z); if (d < bd) { bd = d; best = i; } }); for (let i = best; i < pts.length; i++) { const [x, z] = pts[i]; if (Math.hypot(x - s.x, z - s.z) > 25) { tx = x; tz = z; break; } } }
|
| 57 |
+
}
|
| 58 |
+
beam.visible = pad.visible = !!dest && Math.hypot(dest.x - s.x, dest.z - s.z) > 12;
|
| 59 |
+
if (beam.visible) { const gy = Math.max(0, dest.y || 0); beam.position.set(dest.x, gy, dest.z); pad.position.set(dest.x, gy + .15, dest.z); pad.scale.setScalar(1 + .12 * Math.sin(time * 4)); beamMat.opacity = .13 + .07 * Math.sin(time * 3); }
|
| 60 |
+
chev.visible = tx != null && s.veh !== "foot" && Math.hypot(tx - s.x, tz - s.z) > 14;
|
| 61 |
+
if (chev.visible) { const f = s.veh === "board" ? 4 : 7; chev.position.set(s.x + Math.cos(s.yaw) * f, s.y + 2.3 + Math.sin(time * 5) * .12, s.z + Math.sin(s.yaw) * f); chev.rotation.y = -Math.atan2(tz - s.z, tx - s.x); }
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
// ---- drift trails: two neon ribbons from the rear tyres while the car slides, fading over four seconds ----
|
| 65 |
+
const TQ = 320, tPos = new Float32Array(TQ * 18), tCol = new Float32Array(TQ * 18), tAge = new Float32Array(TQ).fill(99), tBase = new Float32Array(TQ * 3);
|
| 66 |
+
const tGeo = new THREE.BufferGeometry(); tGeo.setAttribute("position", new THREE.BufferAttribute(tPos, 3).setUsage(THREE.DynamicDrawUsage)); tGeo.setAttribute("color", new THREE.BufferAttribute(tCol, 3).setUsage(THREE.DynamicDrawUsage));
|
| 67 |
+
const trail = add(new THREE.Mesh(tGeo, new THREE.MeshBasicMaterial({ vertexColors: true, transparent: true, blending: THREE.AdditiveBlending, depthWrite: false, toneMapped: false, side: THREE.DoubleSide, polygonOffset: true, polygonOffsetFactor: -4, polygonOffsetUnits: -4 })));
|
| 68 |
+
trail.frustumCulled = false; let tq = 0, tLive = 0; const lastW = [null, null];
|
| 69 |
+
function trailsUpdate(dt, s, S) {
|
| 70 |
+
const on = S.slip > .35 && s.mode === "drive" && s.veh === "car" && s.y < .5, fx0 = Math.cos(s.yaw), fz0 = Math.sin(s.yaw), col = o.trailColor ? o.trailColor() : [1, .2, .85];
|
| 71 |
+
for (let w = 0; w < 2; w++) {
|
| 72 |
+
const sd = w ? .8 : -.8, x = s.x - fx0 * 1.35 - fz0 * sd, z = s.z - fz0 * 1.35 + fx0 * sd;
|
| 73 |
+
if (!on) { lastW[w] = null; continue; }
|
| 74 |
+
if (Math.random() < .35) puff(x, .3, z, rnd(), .8, rnd(), 0xd8d8dc, .5, .9);
|
| 75 |
+
const L = lastW[w]; if (L && Math.hypot(x - L[0], z - L[1]) < .45) continue;
|
| 76 |
+
if (L && Math.hypot(x - L[0], z - L[1]) < 6) {
|
| 77 |
+
const dx = x - L[0], dz = z - L[1], len = Math.hypot(dx, dz), nx = -dz / len * .16, nz = dx / len * .16, q = tq++ % TQ;
|
| 78 |
+
tPos.set([L[0] + nx, .05, L[1] + nz, L[0] - nx, .05, L[1] - nz, x - nx, .05, z - nz, L[0] + nx, .05, L[1] + nz, x - nx, .05, z - nz, x + nx, .05, z + nz], q * 18);
|
| 79 |
+
tAge[q] = 0; tBase.set(col, q * 3); tLive = 4.2;
|
| 80 |
+
}
|
| 81 |
+
lastW[w] = [x, z];
|
| 82 |
+
}
|
| 83 |
+
if (tLive <= 0) return; tLive -= dt;
|
| 84 |
+
for (let q = 0; q < TQ; q++) {
|
| 85 |
+
if (tAge[q] > 4) { if (tAge[q] < 90) { tAge[q] = 99; tCol.fill(0, q * 18, q * 18 + 18); } continue; }
|
| 86 |
+
tAge[q] += dt; const k = Math.max(0, 1 - tAge[q] / 4) * .9;
|
| 87 |
+
for (let i = 0; i < 6; i++) { const b = q * 18 + i * 3; tCol[b] = tBase[q * 3] * k; tCol[b + 1] = tBase[q * 3 + 1] * k; tCol[b + 2] = tBase[q * 3 + 2] * k; }
|
| 88 |
+
}
|
| 89 |
+
tGeo.attributes.position.needsUpdate = tGeo.attributes.color.needsUpdate = true;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
// ---- the sonic boom (a shockwave ring round the car) and the cloud deck high over the city ----
|
| 93 |
+
const shockMat = new THREE.MeshBasicMaterial({ color: 0xffffff, transparent: true, opacity: 0, blending: THREE.AdditiveBlending, depthWrite: false, toneMapped: false, side: THREE.DoubleSide });
|
| 94 |
+
const shock = add(new THREE.Mesh(new THREE.RingGeometry(.86, 1, 56), shockMat)); shock.visible = false; let shockT = 0;
|
| 95 |
+
const cloudTex = (() => { const c = document.createElement("canvas"); c.width = c.height = 64; const g = c.getContext("2d"), r = g.createRadialGradient(32, 32, 2, 32, 32, 32); r.addColorStop(0, "rgba(255,255,255,.9)"); r.addColorStop(.5, "rgba(255,255,255,.35)"); r.addColorStop(1, "rgba(255,255,255,0)"); g.fillStyle = r; g.fillRect(0, 0, 64, 64); return new THREE.CanvasTexture(c); })();
|
| 96 |
+
const NCL = COARSE ? 260 : 620, cp = new Float32Array(NCL * 3);
|
| 97 |
+
for (let i = 0; i < NCL; i++) cp.set([-1600 + Math.random() * 4400, 405 + Math.random() * 55, -1300 + Math.random() * 3800], i * 3);
|
| 98 |
+
const cGeo = new THREE.BufferGeometry(); cGeo.setAttribute("position", new THREE.BufferAttribute(cp, 3));
|
| 99 |
+
const cloudMat = new THREE.PointsMaterial({ map: cloudTex, size: 150, sizeAttenuation: true, transparent: true, opacity: 0, depthWrite: false, color: 0xe4eaf4, fog: false });
|
| 100 |
+
const clouds = add(new THREE.Points(cGeo, cloudMat)); clouds.frustumCulled = false; let aboveDone = false;
|
| 101 |
+
|
| 102 |
+
// ---- smashable street props: lamps, hydrants, bins, benches, cones and barriers fly off the car (no speed lost) ----
|
| 103 |
+
const DEB = { lamp: [new THREE.CylinderGeometry(.1, .14, 8, 6), 0x22252b, 4], hydrant: [new THREE.CylinderGeometry(.22, .26, .8, 8), 0xc8202a, .4], bin: [new THREE.CylinderGeometry(.35, .3, 1, 8), 0x2d4a2d, .5],
|
| 104 |
+
bench: [new THREE.BoxGeometry(1.8, .5, .6), 0x4a3a2a, .3], cone: [new THREE.ConeGeometry(.24, .72, 10), 0xff5a12, .36], barrier: [new THREE.BoxGeometry(.12, .5, 2.4), 0xe8e8e8, .5] };
|
| 105 |
+
const debMat = {}; for (const k in DEB) debMat[k] = new THREE.MeshStandardMaterial({ color: DEB[k][1], roughness: .6 });
|
| 106 |
+
const debris = [], downs = []; let smashN = 0, smashCash = 0, smashT = 0;
|
| 107 |
+
function props(x, z, y, vel) {
|
| 108 |
+
const sp = Math.hypot(vel.x, vel.z); if (y > 4 || sp < 4 || !city.props) return;
|
| 109 |
+
for (const q of city.props.near(x, z, 1.7)) {
|
| 110 |
+
city.props.hide(q); downs.push({ q, t: 50 });
|
| 111 |
+
const [geo, , hh] = DEB[q.kind] || DEB.bin;
|
| 112 |
+
let d = debris.find(e => !e.m.visible && e.kind === q.kind);
|
| 113 |
+
if (!d && debris.length >= 36) d = debris.find(e => e.kind === q.kind);
|
| 114 |
+
if (!d) { d = { m: add(new THREE.Mesh(geo, debMat[q.kind] || debMat.bin)), kind: q.kind, v: new THREE.Vector3(), w: new THREE.Vector3() }; d.m.castShadow = true; debris.push(d); }
|
| 115 |
+
d.m.visible = true; d.m.scale.setScalar(1); d.t = 7; d.hh = hh; d.m.position.set(q.x, hh, q.z); d.m.rotation.set(0, Math.random() * 6, 0);
|
| 116 |
+
d.v.set(vel.x * .9 + rnd() * 4, 3 + sp * .18 + Math.random() * 3, vel.z * .9 + rnd() * 4); d.w.set(rnd() * 10, rnd() * 6, rnd() * 10);
|
| 117 |
+
for (let k = 0; k < 5; k++) puff(q.x, .6, q.z, rnd() * 6, 1 + Math.random() * 3, rnd() * 6, q.kind === "lamp" ? 0xffd27a : 0xb0b0b0, .25, .5);
|
| 118 |
+
smashN++; smashCash += q.kind === "lamp" ? 40 : q.kind === "barrier" ? 25 : 15; smashT = .7; sound.thud && sound.thud(.45);
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
function debrisUpdate(dt, cam) {
|
| 122 |
+
for (const d of debris) if (d.m.visible) {
|
| 123 |
+
d.t -= dt; d.v.y -= 9.81 * dt; d.m.position.addScaledVector(d.v, dt); d.m.rotation.x += d.w.x * dt; d.m.rotation.y += d.w.y * dt; d.m.rotation.z += d.w.z * dt;
|
| 124 |
+
if (d.m.position.y < d.hh * .35) { d.m.position.y = d.hh * .35; d.v.y = Math.abs(d.v.y) * .3; d.v.x *= .6; d.v.z *= .6; d.w.multiplyScalar(.6); }
|
| 125 |
+
if (d.t < 1) d.m.scale.setScalar(Math.max(.01, d.t)); if (d.t <= 0) d.m.visible = false;
|
| 126 |
+
}
|
| 127 |
+
for (let i = downs.length - 1; i >= 0; i--) { const D = downs[i]; if ((D.t -= dt) <= 0 && Math.hypot(D.q.x - cam.x, D.q.z - cam.z) > 80) { city.props.restore(D.q); downs.splice(i, 1); } }
|
| 128 |
+
if (smashT > 0 && (smashT -= dt) <= 0 && smashN) { game.api.addScore(smashCash, smashN > 1 ? `Smashed ${smashN} props` : "Smashed a prop"); smashN = smashCash = 0; }
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
// ---- the first minute: the neon launch ramp ahead of the spawn (a ring over the jump and chevrons leading in) ----
|
| 132 |
+
{
|
| 133 |
+
const neon = new THREE.MeshBasicMaterial({ color: new THREE.Color(0xff3df0).multiplyScalar(2.2), toneMapped: false });
|
| 134 |
+
const ring = add(new THREE.Mesh(new THREE.TorusGeometry(9, .7, 10, 44), neon)); ring.position.set(RAMP_X + 46, 20, LZ); ring.rotation.y = Math.PI / 2;
|
| 135 |
+
game.RINGS.push({ m: ring, x: RAMP_X + 46, y: 20, z: LZ, nx: 1, nz: 0, done: 0, side: 0 });
|
| 136 |
+
const chevMat = new THREE.MeshBasicMaterial({ color: new THREE.Color(0xff3df0).multiplyScalar(1.6), toneMapped: false, transparent: true, opacity: .85, depthWrite: false, polygonOffset: true, polygonOffsetFactor: -4, polygonOffsetUnits: -4 });
|
| 137 |
+
for (const x of [RAMP_X - 70, RAMP_X - 45, RAMP_X - 20]) { const c = add(new THREE.Mesh(chevGeo, chevMat)); c.scale.setScalar(1.6); c.position.set(x, .07, LZ); }
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
// ---- key hints: each turns up once, the first time it's useful (the start screen only shows WASD, Shift and F) ----
|
| 141 |
+
const seen = new Set(store.get("void.hints") || []), hintEl = $("gKeyHint"); let hintOn = null, hintT = 0, chk = 0, played = 0, stillT = 0, stuckT = 0, flyT = 0;
|
| 142 |
+
const K = k => COARSE ? "" : `<kbd>${k}</kbd>`;
|
| 143 |
+
function hint(id, html, t = 7) { if (seen.has(id) || hintOn || !hintEl) return; seen.add(id); store.set("void.hints", [...seen]); hintOn = id; hintT = t; hintEl.innerHTML = html; hintEl.hidden = false; sound.pop && sound.pop(); }
|
| 144 |
+
const railDist = (x, z) => { let best = 1e9; for (const r of game.RAILS) { const a = Math.max(0, Math.min(r.len, (x - r.x) * r.c + (z - r.z) * r.s)); best = Math.min(best, Math.hypot(x - (r.x + r.c * a), z - (r.z + r.s * a))); } return best; };
|
| 145 |
+
function hints(dt, s, S) {
|
| 146 |
+
if (hintOn && (hintT -= dt) <= 0) { hintOn = null; hintEl.hidden = true; }
|
| 147 |
+
played += dt; const sp = Math.hypot(s.vel.x, s.vel.z);
|
| 148 |
+
stillT = s.veh === "car" && sp < 1 ? stillT + dt : 0;
|
| 149 |
+
stuckT = s.veh === "car" && sp < 1.5 && s.brakeIn === 0 && S.load > .5 ? stuckT + dt : 0;
|
| 150 |
+
flyT = s.mode === "air" && s.veh === "car" ? flyT + dt : 0;
|
| 151 |
+
if (s.mode === "air" && s.veh === "car" && s.hover && !store.get("void.flew")) store.set("void.flew", 1);
|
| 152 |
+
// the launch ramp: until you've flown once
|
| 153 |
+
if (!store.get("void.flew") && s.mode === "drive" && s.veh === "car" && Math.cos(s.yaw) > .7 && s.x > RAMP_X - 160 && s.x < RAMP_X && Math.abs(s.z - LZ) < 10) game.api.say(COARSE ? "🚀 Hit the ramp, then tap Fly in mid-air!" : "🚀 Hit the ramp & press F in mid-air to fly!", .6);
|
| 154 |
+
if ((chk -= dt) > 0) return; chk = .5;
|
| 155 |
+
if (flyT > 5) hint("land", `${K("L")} Land: the car glides down and touches down softly${COARSE ? " (tap Land)" : ""}`);
|
| 156 |
+
if (S.nitroFull && played > 40) hint("od", `Tap ${K("Shift")} for a kick · hold it from full for ⚡ OVERDRIVE`);
|
| 157 |
+
if (stuckT > 2.5) hint("reset", `${K("R")} Stuck? Back on your wheels right here${COARSE ? " (↺)" : ""}`);
|
| 158 |
+
if ((s.veh === "foot" || sp < 9) && railDist(s.x, s.z) < 35) hint("board", COARSE ? "🛹 Hoverboard (Menu ☰ → Vehicle): grind these rails" : `${K("Y")} Hoverboard: grind these rails, ollie with Space`);
|
| 159 |
+
if (played > 50 && stillT > 4) hint("foot", COARSE ? "🚶 Get out and walk · take any car" : `${K("E")} Get out and walk · take any car`);
|
| 160 |
+
if (o.dealer && o.dealer() && o.dealer().sites.some(st => Math.hypot(st.x - s.x, st.z - s.z) < 45)) hint("garage", `${K("G")} VOID Motors: your garage, every car is yours`);
|
| 161 |
+
if (played > 120 && stillT > 3 && Math.abs(s.x) < 1000 && s.z > -700 && s.z < 2100) hint("taxi", COARSE ? "🚕 Taxi jobs (Menu ☰): passengers pay cash" : `${K("J")} Taxi jobs: passengers pay cash`);
|
| 162 |
+
if (played > 90) hint("radio", COARSE ? "📻 Change the station: Menu ☰ → Radio" : `${K("U")} Change the radio station`);
|
| 163 |
+
if (played > 360) hint("route", COARSE ? "🏁 Build your own race (Menu ☰ → Routes)" : `${K("B")} Build your own race route and race your ghost`);
|
| 164 |
+
}
|
| 165 |
+
addEventListener("keydown", e => { if (e.code === "KeyU" && !e.repeat && game.api.active() && !/INPUT|TEXTAREA/.test(document.activeElement.tagName)) o.radioNext && o.radioNext(); });
|
| 166 |
+
|
| 167 |
+
let odWas = false;
|
| 168 |
+
return {
|
| 169 |
+
props, pop, onScore,
|
| 170 |
+
update(dt, time, S, cam) {
|
| 171 |
+
const s = game.state; if (!s || !s.started) { columnsUpdate(dt, cam, false); return; }
|
| 172 |
+
columnsUpdate(dt, cam, s.mode === "air");
|
| 173 |
+
gpsUpdate(time, s); trailsUpdate(dt, s, S); debrisUpdate(dt, cam); hints(dt, s, S);
|
| 174 |
+
const nos = $("gNos"); if (nos) { nos.classList.toggle("od", !!S.od); nos.classList.toggle("full", !!S.nitroFull && !S.od); }
|
| 175 |
+
if (S.od && !odWas) pop("⚡ OVERDRIVE", "hot"); odWas = !!S.od;
|
| 176 |
+
// the shockwave: a ring that bursts out across the flight path
|
| 177 |
+
if (S.sonic > .95 && shockT <= 0) { shockT = .9; shock.position.copy(S.pos); shock.lookAt(S.pos.x + s.vel.x, S.pos.y + s.vel.y, S.pos.z + s.vel.z); shock.visible = true; for (let k = 0; k < 16; k++) puff(S.pos.x, S.pos.y, S.pos.z, rnd() * 30, rnd() * 30, rnd() * 30, 0xffffff, .8, .6); }
|
| 178 |
+
if (shockT > 0) { shockT -= dt; const k = 1 - shockT / .9; shock.scale.setScalar(3 + k * 80); shockMat.opacity = (1 - k) * .55; if (shockT <= 0) shock.visible = false; }
|
| 179 |
+
// the cloud deck fades in as you climb; above it pays once a flight
|
| 180 |
+
cloudMat.opacity = Math.max(0, Math.min(1, (cam.y - 140) / 160)) * (W.timeOfDay === "night" ? .32 : .6);
|
| 181 |
+
clouds.visible = cloudMat.opacity > .01;
|
| 182 |
+
if (s.mode === "air" && s.y > 470 && !aboveDone) { aboveDone = true; game.api.addScore(300, "☁️ Above the clouds"); }
|
| 183 |
+
if (s.mode !== "air") aboveDone = false;
|
| 184 |
+
},
|
| 185 |
+
};
|
| 186 |
+
}
|
static/main.js
CHANGED
|
@@ -9,11 +9,11 @@ Object.defineProperty(THREE.Material.prototype, "forceSinglePass", { get: () =>
|
|
| 9 |
const V = new URL(import.meta.url).search;
|
| 10 |
const $ = id => document.getElementById(id);
|
| 11 |
const LT = window.__loadTimes = [], lt = k => LT.push([k, Math.round(performance.now())]); // where the loading time goes (window.__loadTimes)
|
| 12 |
-
const setLoad = p => { $("ldbar").style.width = p + "%"; $("ldpct").textContent = Math.round(p); lt(p); };
|
| 13 |
setLoad(15);
|
| 14 |
const [{ createWorld, clamp, lerp, smooth, frame, PAD_R, ZONES }, { buildCar, MODELS }, { addInterior, HEAD }, { Sound, BAR }, { createWatch, TOTAL, CHAPTERS }, { createGame }, { createLife, personGeo }] = await Promise.all(
|
| 15 |
["world", "car", "interior", "sound", "watch", "game", "npc"].map(n => import(`./${n}.js${V}`)));
|
| 16 |
-
const [{ createPolice }, { createRaces }, { createNet, EMOTES }, { createNav }, { createVehicles }, { createAtmos, WEATHERS }, { createGoals, GOALS }, { createExtras }, { createContracts }, { createDealer }] = await Promise.all(["police", "race", "net", "nav", "vehicles", "atmos", "goals", "extras", "contracts", "dealer"].map(n => import(`./${n}.js${V}`)));
|
| 17 |
setLoad(40);
|
| 18 |
|
| 19 |
const COARSE = matchMedia("(pointer: coarse)").matches, REDUCED = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -61,7 +61,7 @@ const DENSITY = { few: .55, normal: 1, busy: 1.3 }[(store.get("void.settings") |
|
|
| 61 |
const life = createLife(scene, W.roads, W.walkways, COARSE || LITE, DENSITY); lt("life");
|
| 62 |
const TIMES = ["night", "sunset", "day"];
|
| 63 |
function cycleTime() { const k = TIMES[(TIMES.indexOf(W.timeOfDay) + 1) % 3]; W.setTime(k); store.set("void.time", k); toast({ night: "Night in the city", sunset: "Golden hour", day: "Daytime" }[k]); cubeN = 0; }
|
| 64 |
-
let police, races, nav;
|
| 65 |
const net = createNet(); lt("net");
|
| 66 |
setInterval(() => { if (document.hidden) net.tick(.5, null); }, 500); // a hosting tab in the background still relays everyone
|
| 67 |
// settings: graphics quality, look speed, auto gas, touch steering (kept on this device)
|
|
@@ -73,7 +73,8 @@ const SET = Object.assign({ q: LITE ? "lite" : TOP ? "ultra" : STRONG ? "high" :
|
|
| 73 |
const gameOpts = {
|
| 74 |
handling: () => SET.handling, buyFood: () => { if (cash < 10) return false; cash -= 10; store.set("void.cash", cash); earn(0); return true; }, heroOwned: () => !!store.get("void.hero"), starter: () => { const m = life.models.find(m => m.id === "compact-3") || life.models.find(m => m.kind.id === "compact"); return { model: { ...m, top: 31, acc: .7, grip: .9 }, color: 0x6b5a44, rust: .75, owned: true }; }, onSteal: c => { police && police.event("steal"); goals.stats.steals = (goals.stats.steals || 0) + 1; },
|
| 75 |
garage: () => openGarage(true), cycleTime, hornType: () => build.horn, autoGas: () => SET.autogas === "on", onRepair: () => car.repair && car.repair(),
|
| 76 |
-
|
|
|
|
| 77 |
onSmash: kind => police && police.event("smash", kind), policeClear: () => police && police.clear(),
|
| 78 |
autopilot: (g, dt, over) => nav ? nav.controls(g, dt, over) : null, openGps: () => document.getElementById("gGpsBtn").click(),
|
| 79 |
mapExtra(mx, g, MM) {
|
|
@@ -98,7 +99,7 @@ function renderGoals() {
|
|
| 98 |
document.getElementById("gGoals").innerHTML = GOALS.map(g => { const v = Math.min(1, (S[g.stat] || 0) / g.need), ok = goals.done.has(g.id); return `<div class="goal${ok ? " ok" : ""}"><b>${g.icon}</b><div><span>${g.name}</span><small>${g.text}</small><i style="--v:${v}"></i></div>${ok ? "🏆" : `<em>${Math.floor(v * 100)}%</em>`}</div>`; }).join("");
|
| 99 |
document.getElementById("gStatsRow").innerHTML = `<div><b>${(S.best || 0).toLocaleString()}</b><span>Best score</span></div><div><b>${Math.round(S.top)}</b><span>Top km/h</span></div><div><b>${S.km.toFixed(1)}</b><span>km travelled</span></div><div><b>${goals.done.size}/${GOALS.length}</b><span>Trophies</span></div><div><b>$${cash.toLocaleString()}</b><span>Cash · spend in Garage</span></div>`;
|
| 100 |
}
|
| 101 |
-
const WX_ICON = { clear: "☀️ Clear", rain: "🌧 Rain", storm: "⛈ Storm", fog: "🌫 Fog", snow: "❄️ Snow" }, RADIO = { score: "🎵 VOID Score", voidfm: "📻 VOID FM", off: "🔇 Radio off" };
|
| 102 |
function chips() { document.getElementById("gChips").innerHTML = `<span>${{ night: "🌙", sunset: "🌇", day: "☀️" }[W.timeOfDay]} ${W.timeOfDay}</span><span>${WX_ICON[atmos.weather]}</span>`; document.getElementById("gWeather").innerHTML = `<b>${WX_ICON[SET.weather].split(" ")[0]}</b>${WX_ICON[SET.weather].split(" ").slice(1).join(" ")}`; document.getElementById("gRadio").innerHTML = `<b>${RADIO[SET.radio].split(" ")[0]}</b>${RADIO[SET.radio].split(" ").slice(1).join(" ")}`; }
|
| 103 |
document.getElementById("gWeather").onclick = () => { SET.weather = WEATHERS[(WEATHERS.indexOf(SET.weather) + 1) % WEATHERS.length]; atmos.setWeather(SET.weather); store.set("void.settings", SET); chips(); toast(WX_ICON[SET.weather]); };
|
| 104 |
document.getElementById("gRadio").onclick = () => { const k = Object.keys(RADIO); SET.radio = k[(k.indexOf(SET.radio) + 1) % k.length]; if (!sound.on) setSound(true); sound.setRadio(SET.radio); store.set("void.settings", SET); chips(); toast(RADIO[SET.radio]); };
|
|
@@ -615,7 +616,7 @@ function frameLoop(fixed) {
|
|
| 615 |
const night = W.timeOfDay !== "day";
|
| 616 |
heads.intensity = night && veh === "car" ? (W.timeOfDay === "night" ? 260 : 120) : 0;
|
| 617 |
W.sky.position.copy(camera.position); W.grade.uniforms.time.value = time % 100; W.grade.uniforms.sharp.value = renderer.getPixelRatio() < (devicePixelRatio || 1) * .95 ? .45 : .22;
|
| 618 |
-
W.grade.uniforms.blur.value = mode === "play" && motionOK() ? Math.max(0, Math.min(1, (S.speed - 160) / 220)) * .9 + (S.nitro || 0) * .5 : 0;
|
| 619 |
atmos.update(dt, time, S, mode === "play" ? game.state : null);
|
| 620 |
W.city.poolMat.opacity = W.timeOfDay === "night" ? 1 : W.timeOfDay === "sunset" ? .45 : 0; W.city.poolMat.visible = W.timeOfDay !== "day";
|
| 621 |
extras.sky(dt, time);
|
|
@@ -624,7 +625,7 @@ function frameLoop(fixed) {
|
|
| 624 |
life.raining = atmos.weather === "rain" || atmos.weather === "storm"; life.night = W.timeOfDay !== "day";
|
| 625 |
// the El train is solid: you get shoved off the track (and hurt if you hit it hard)
|
| 626 |
if (mode === "play" && W.city.el && game.state) { const T = W.city.el.train, s = game.state; if (Math.abs(s.x - W.city.el.x) < 2.6 && s.y > W.city.el.top - .5 && s.y < W.city.el.top + 4 && Math.abs(s.z - T.z) < T.len / 2 + 1) { s.x = W.city.el.x + (s.x >= W.city.el.x ? 3 : -3); const sp = Math.hypot(s.vel.x, s.vel.z); if (sp > 8 || T.v > 5) { game.api.hurt(8 + T.v, "Hit by the train"); sound.crash(); } } }
|
| 627 |
-
if (mode === "play") { contracts.update(dt, time); dealer.update(dt, time); tutUpdate(); if ((dailyT += dt) > 1) { dailyT = 0; dailyCheck(); } extras.update(dt, time); goals.stats.coins = extras.coins().got; goals.stats.cams = extras.fastCams(); goals.update(dt, game.state, S.speed); if (time - lastChips > 2) { lastChips = time; chips(); } }
|
| 628 |
if (mode === "play" && time - lastGauge > .05) { lastGauge = time; drawGauge(S); const fu = document.getElementById("gFuel"); if (fu && S.fuel != null) { fu.style.setProperty("--v", S.fuel); fu.classList.toggle("low", S.fuel < .2); } }
|
| 629 |
if (heroDriven) { car.group.position.copy(S.pos); car.group.quaternion.copy(S.quat); } else if (gsx && gsx.heroPark) { car.group.position.set(gsx.heroPark.x, 0, gsx.heroPark.z); car.group.quaternion.setFromAxisAngle(new THREE.Vector3(0, 1, 0), -gsx.heroPark.yaw); }
|
| 630 |
car.setReveal(S.reveal);
|
|
@@ -674,7 +675,7 @@ function frameLoop(fixed) {
|
|
| 674 |
pf.life -= dt * .9; pf.s.position.addScaledVector(pf.v, dt); pf.v.multiplyScalar(.97);
|
| 675 |
pf.s.scale.setScalar((pf.grow || .4) + (1 - pf.life) * 4.5); pf.s.material.opacity = Math.max(0, pf.life) * .5; if (pf.life <= 0) pf.s.visible = false;
|
| 676 |
}
|
| 677 |
-
const lineA = smooth(240, 320, S.speed) * (S.inside ? 0 : 1);
|
| 678 |
fx.lines.material.opacity = lineA * .08;
|
| 679 |
if (lineA > .01) {
|
| 680 |
const d = new THREE.Object3D();
|
|
@@ -702,7 +703,7 @@ function frameLoop(fixed) {
|
|
| 702 |
const c = S.cam, shake = !motionOK() ? 0 : (Math.max(0, S.g - 2) * .004 + S.thrust.power * .01 + (S.shake || 0) * .25 + (S.nitro || 0) * .02) * (S.inside ? .25 : 1);
|
| 703 |
camera.position.copy(c.pos).add(new THREE.Vector3(Math.sin(time * 53) * shake, Math.sin(time * 61 + 1) * shake, Math.sin(time * 47 + 2) * shake));
|
| 704 |
camera.up.copy(c.up || new THREE.Vector3(0, 1, 0)); camera.lookAt(c.look);
|
| 705 |
-
camera.fov = fovFor(c.fov); camera.near = S.inside || S.screenOn ? .06 : .35; camera.updateProjectionMatrix();
|
| 706 |
camLight.position.copy(camera.position).add(new THREE.Vector3(0, 3, 0)); camLight.target.position.copy(S.pos);
|
| 707 |
scene.fog.far = lerp(950, 2600, smooth(20, 160, S.alt)) * W.weatherFog; scene.fog.near = lerp(120, 400, smooth(20, 160, S.alt)) * W.weatherFog;
|
| 708 |
const DET = { lite: .42, low: .55, medium: .8, high: 1, ultra: 1.2 }[W.quality] || 1; life.detail = DET; W.city.detail = DET;
|
|
@@ -735,6 +736,8 @@ try {
|
|
| 735 |
});
|
| 736 |
if (parts.length) { const geo = mergeGeometries(parts); geo.translate(0, -.02, 0); life.setVoidGeo(geo); life.setVoidDetail(W.quality !== "lite"); window.__voidTris = geo.attributes.position.count / 3; }
|
| 737 |
} catch (e) { console.warn("VOID flyers keep the simple shape", e); }
|
|
|
|
|
|
|
| 738 |
setLoad(95);
|
| 739 |
await precompile(); lt("compile");
|
| 740 |
// warm-up: draw every mesh once into a tiny target so its buffers and textures are on the graphics card before you play.
|
|
@@ -747,6 +750,7 @@ try {
|
|
| 747 |
for (const [o, v, f, m] of saved) { o.visible = v; o.frustumCulled = f; o.layers.mask = m; } for (const [o, v] of parents) o.visible = v;
|
| 748 |
} catch (e) { console.warn("warm-up skipped", e); }
|
| 749 |
lt("warm-up");
|
|
|
|
| 750 |
let raf;
|
| 751 |
let frameErr = 0;
|
| 752 |
const loop = () => { raf = requestAnimationFrame(loop); try { frameLoop(); } catch (e) { if (frameErr++ < 3) console.error(e); } }; // one bad frame never stops the game
|
|
|
|
| 9 |
const V = new URL(import.meta.url).search;
|
| 10 |
const $ = id => document.getElementById(id);
|
| 11 |
const LT = window.__loadTimes = [], lt = k => LT.push([k, Math.round(performance.now())]); // where the loading time goes (window.__loadTimes)
|
| 12 |
+
const setLoad = p => { $("ldbar").style.width = p + "%"; $("ldpct").textContent = Math.round(p); $("loader").style.setProperty("--p", p / 100); lt(p); };
|
| 13 |
setLoad(15);
|
| 14 |
const [{ createWorld, clamp, lerp, smooth, frame, PAD_R, ZONES }, { buildCar, MODELS }, { addInterior, HEAD }, { Sound, BAR }, { createWatch, TOTAL, CHAPTERS }, { createGame }, { createLife, personGeo }] = await Promise.all(
|
| 15 |
["world", "car", "interior", "sound", "watch", "game", "npc"].map(n => import(`./${n}.js${V}`)));
|
| 16 |
+
const [{ createPolice }, { createRaces }, { createNet, EMOTES }, { createNav }, { createVehicles }, { createAtmos, WEATHERS }, { createGoals, GOALS }, { createExtras }, { createContracts }, { createDealer }, { createLegion }] = await Promise.all(["police", "race", "net", "nav", "vehicles", "atmos", "goals", "extras", "contracts", "dealer", "legion"].map(n => import(`./${n}.js${V}`)));
|
| 17 |
setLoad(40);
|
| 18 |
|
| 19 |
const COARSE = matchMedia("(pointer: coarse)").matches, REDUCED = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
|
|
| 61 |
const life = createLife(scene, W.roads, W.walkways, COARSE || LITE, DENSITY); lt("life");
|
| 62 |
const TIMES = ["night", "sunset", "day"];
|
| 63 |
function cycleTime() { const k = TIMES[(TIMES.indexOf(W.timeOfDay) + 1) % 3]; W.setTime(k); store.set("void.time", k); toast({ night: "Night in the city", sunset: "Golden hour", day: "Daytime" }[k]); cubeN = 0; }
|
| 64 |
+
let police, races, nav, legion = null;
|
| 65 |
const net = createNet(); lt("net");
|
| 66 |
setInterval(() => { if (document.hidden) net.tick(.5, null); }, 500); // a hosting tab in the background still relays everyone
|
| 67 |
// settings: graphics quality, look speed, auto gas, touch steering (kept on this device)
|
|
|
|
| 73 |
const gameOpts = {
|
| 74 |
handling: () => SET.handling, buyFood: () => { if (cash < 10) return false; cash -= 10; store.set("void.cash", cash); earn(0); return true; }, heroOwned: () => !!store.get("void.hero"), starter: () => { const m = life.models.find(m => m.id === "compact-3") || life.models.find(m => m.kind.id === "compact"); return { model: { ...m, top: 31, acc: .7, grip: .9 }, color: 0x6b5a44, rust: .75, owned: true }; }, onSteal: c => { police && police.event("steal"); goals.stats.steals = (goals.stats.steals || 0) + 1; },
|
| 75 |
garage: () => openGarage(true), cycleTime, hornType: () => build.horn, autoGas: () => SET.autogas === "on", onRepair: () => car.repair && car.repair(),
|
| 76 |
+
props: (x, z, y, vel) => legion && legion.props(x, z, y, vel),
|
| 77 |
+
onScore: (n, why, pts) => { if (legion) legion.onScore(why, pts ?? n); if (/^Drift/.test(why)) goals.drift(n); if (/^(🥇|🥈|🥉)/.test(why)) goals.stats.meds = (goals.stats.meds || 0) + 1; { const gm = /^Grind (\d+) m/.exec(why); if (gm) goals.stats.grind = (goals.stats.grind || 0) + +gm[1]; const sp = /^(\d+)( |$)/.exec(why); if (sp && +sp[1] >= 720) goals.stats.b720 = 1; if (/Kickflip|Heelflip/.test(why) && / \+ /.test(why)) goals.stats.combo = (goals.stats.combo || 0) + 1; } goals.note(why); earn(pts ?? n); },
|
| 78 |
onSmash: kind => police && police.event("smash", kind), policeClear: () => police && police.clear(),
|
| 79 |
autopilot: (g, dt, over) => nav ? nav.controls(g, dt, over) : null, openGps: () => document.getElementById("gGpsBtn").click(),
|
| 80 |
mapExtra(mx, g, MM) {
|
|
|
|
| 99 |
document.getElementById("gGoals").innerHTML = GOALS.map(g => { const v = Math.min(1, (S[g.stat] || 0) / g.need), ok = goals.done.has(g.id); return `<div class="goal${ok ? " ok" : ""}"><b>${g.icon}</b><div><span>${g.name}</span><small>${g.text}</small><i style="--v:${v}"></i></div>${ok ? "🏆" : `<em>${Math.floor(v * 100)}%</em>`}</div>`; }).join("");
|
| 100 |
document.getElementById("gStatsRow").innerHTML = `<div><b>${(S.best || 0).toLocaleString()}</b><span>Best score</span></div><div><b>${Math.round(S.top)}</b><span>Top km/h</span></div><div><b>${S.km.toFixed(1)}</b><span>km travelled</span></div><div><b>${goals.done.size}/${GOALS.length}</b><span>Trophies</span></div><div><b>$${cash.toLocaleString()}</b><span>Cash · spend in Garage</span></div>`;
|
| 101 |
}
|
| 102 |
+
const WX_ICON = { clear: "☀️ Clear", rain: "🌧 Rain", storm: "⛈ Storm", fog: "🌫 Fog", snow: "❄️ Snow" }, RADIO = { score: "🎵 VOID Score", synth: "🌆 Cyber Synth", chill: "🌙 Chill Night Drive", chase: "🔥 High-Octane Chase", voidfm: "📻 VOID FM", off: "🔇 Radio off" };
|
| 103 |
function chips() { document.getElementById("gChips").innerHTML = `<span>${{ night: "🌙", sunset: "🌇", day: "☀️" }[W.timeOfDay]} ${W.timeOfDay}</span><span>${WX_ICON[atmos.weather]}</span>`; document.getElementById("gWeather").innerHTML = `<b>${WX_ICON[SET.weather].split(" ")[0]}</b>${WX_ICON[SET.weather].split(" ").slice(1).join(" ")}`; document.getElementById("gRadio").innerHTML = `<b>${RADIO[SET.radio].split(" ")[0]}</b>${RADIO[SET.radio].split(" ").slice(1).join(" ")}`; }
|
| 104 |
document.getElementById("gWeather").onclick = () => { SET.weather = WEATHERS[(WEATHERS.indexOf(SET.weather) + 1) % WEATHERS.length]; atmos.setWeather(SET.weather); store.set("void.settings", SET); chips(); toast(WX_ICON[SET.weather]); };
|
| 105 |
document.getElementById("gRadio").onclick = () => { const k = Object.keys(RADIO); SET.radio = k[(k.indexOf(SET.radio) + 1) % k.length]; if (!sound.on) setSound(true); sound.setRadio(SET.radio); store.set("void.settings", SET); chips(); toast(RADIO[SET.radio]); };
|
|
|
|
| 616 |
const night = W.timeOfDay !== "day";
|
| 617 |
heads.intensity = night && veh === "car" ? (W.timeOfDay === "night" ? 260 : 120) : 0;
|
| 618 |
W.sky.position.copy(camera.position); W.grade.uniforms.time.value = time % 100; W.grade.uniforms.sharp.value = renderer.getPixelRatio() < (devicePixelRatio || 1) * .95 ? .45 : .22;
|
| 619 |
+
W.grade.uniforms.blur.value = mode === "play" && motionOK() ? (Math.max(0, Math.min(1, (S.speed - 160) / 220)) * .9 + Math.min(1, S.nitro || 0) * .5) * (S.air ? .15 : 1) : 0;
|
| 620 |
atmos.update(dt, time, S, mode === "play" ? game.state : null);
|
| 621 |
W.city.poolMat.opacity = W.timeOfDay === "night" ? 1 : W.timeOfDay === "sunset" ? .45 : 0; W.city.poolMat.visible = W.timeOfDay !== "day";
|
| 622 |
extras.sky(dt, time);
|
|
|
|
| 625 |
life.raining = atmos.weather === "rain" || atmos.weather === "storm"; life.night = W.timeOfDay !== "day";
|
| 626 |
// the El train is solid: you get shoved off the track (and hurt if you hit it hard)
|
| 627 |
if (mode === "play" && W.city.el && game.state) { const T = W.city.el.train, s = game.state; if (Math.abs(s.x - W.city.el.x) < 2.6 && s.y > W.city.el.top - .5 && s.y < W.city.el.top + 4 && Math.abs(s.z - T.z) < T.len / 2 + 1) { s.x = W.city.el.x + (s.x >= W.city.el.x ? 3 : -3); const sp = Math.hypot(s.vel.x, s.vel.z); if (sp > 8 || T.v > 5) { game.api.hurt(8 + T.v, "Hit by the train"); sound.crash(); } } }
|
| 628 |
+
if (mode === "play") { contracts.update(dt, time); dealer.update(dt, time); tutUpdate(); if ((dailyT += dt) > 1) { dailyT = 0; dailyCheck(); } extras.update(dt, time); legion.update(dt, time, S, camera.position); goals.stats.coins = extras.coins().got; goals.stats.cams = extras.fastCams(); goals.update(dt, game.state, S.speed); if (time - lastChips > 2) { lastChips = time; chips(); } }
|
| 629 |
if (mode === "play" && time - lastGauge > .05) { lastGauge = time; drawGauge(S); const fu = document.getElementById("gFuel"); if (fu && S.fuel != null) { fu.style.setProperty("--v", S.fuel); fu.classList.toggle("low", S.fuel < .2); } }
|
| 630 |
if (heroDriven) { car.group.position.copy(S.pos); car.group.quaternion.copy(S.quat); } else if (gsx && gsx.heroPark) { car.group.position.set(gsx.heroPark.x, 0, gsx.heroPark.z); car.group.quaternion.setFromAxisAngle(new THREE.Vector3(0, 1, 0), -gsx.heroPark.yaw); }
|
| 631 |
car.setReveal(S.reveal);
|
|
|
|
| 675 |
pf.life -= dt * .9; pf.s.position.addScaledVector(pf.v, dt); pf.v.multiplyScalar(.97);
|
| 676 |
pf.s.scale.setScalar((pf.grow || .4) + (1 - pf.life) * 4.5); pf.s.material.opacity = Math.max(0, pf.life) * .5; if (pf.life <= 0) pf.s.visible = false;
|
| 677 |
}
|
| 678 |
+
const lineA = smooth(240, 320, S.speed) * (S.inside ? 0 : 1) * (S.air ? .3 : 1);
|
| 679 |
fx.lines.material.opacity = lineA * .08;
|
| 680 |
if (lineA > .01) {
|
| 681 |
const d = new THREE.Object3D();
|
|
|
|
| 703 |
const c = S.cam, shake = !motionOK() ? 0 : (Math.max(0, S.g - 2) * .004 + S.thrust.power * .01 + (S.shake || 0) * .25 + (S.nitro || 0) * .02) * (S.inside ? .25 : 1);
|
| 704 |
camera.position.copy(c.pos).add(new THREE.Vector3(Math.sin(time * 53) * shake, Math.sin(time * 61 + 1) * shake, Math.sin(time * 47 + 2) * shake));
|
| 705 |
camera.up.copy(c.up || new THREE.Vector3(0, 1, 0)); camera.lookAt(c.look);
|
| 706 |
+
camera.fov = fovFor(c.fov); camera.near = S.inside || S.screenOn ? .06 : mode === "play" ? .6 : .35; camera.updateProjectionMatrix();
|
| 707 |
camLight.position.copy(camera.position).add(new THREE.Vector3(0, 3, 0)); camLight.target.position.copy(S.pos);
|
| 708 |
scene.fog.far = lerp(950, 2600, smooth(20, 160, S.alt)) * W.weatherFog; scene.fog.near = lerp(120, 400, smooth(20, 160, S.alt)) * W.weatherFog;
|
| 709 |
const DET = { lite: .42, low: .55, medium: .8, high: 1, ultra: 1.2 }[W.quality] || 1; life.detail = DET; W.city.detail = DET;
|
|
|
|
| 736 |
});
|
| 737 |
if (parts.length) { const geo = mergeGeometries(parts); geo.translate(0, -.02, 0); life.setVoidGeo(geo); life.setVoidDetail(W.quality !== "lite"); window.__voidTris = geo.attributes.position.count / 3; }
|
| 738 |
} catch (e) { console.warn("VOID flyers keep the simple shape", e); }
|
| 739 |
+
legion = createLegion({ W, game, sound, store, life, COARSE, races: () => races, nav: () => nav, dealer: () => dealer, radioNext: () => document.getElementById("gRadio").click(),
|
| 740 |
+
trailColor: () => { const v = OPTS.glow.items[build.glow][1]; return v ? new THREE.Color(v).toArray() : [1, .2, .85]; } });
|
| 741 |
setLoad(95);
|
| 742 |
await precompile(); lt("compile");
|
| 743 |
// warm-up: draw every mesh once into a tiny target so its buffers and textures are on the graphics card before you play.
|
|
|
|
| 750 |
for (const [o, v, f, m] of saved) { o.visible = v; o.frustumCulled = f; o.layers.mask = m; } for (const [o, v] of parents) o.visible = v;
|
| 751 |
} catch (e) { console.warn("warm-up skipped", e); }
|
| 752 |
lt("warm-up");
|
| 753 |
+
for (const pr of renderer.info.programs) if (pr.diagnostics && !pr.diagnostics.runnable) console.error("VOID shader failed:", pr.diagnostics.vertexShader.log, pr.diagnostics.fragmentShader.log); // (parallel compiling hides these otherwise)
|
| 754 |
let raf;
|
| 755 |
let frameErr = 0;
|
| 756 |
const loop = () => { raf = requestAnimationFrame(loop); try { frameLoop(); } catch (e) { if (frameErr++ < 3) console.error(e); } }; // one bad frame never stops the game
|
static/npc.js
CHANGED
|
@@ -67,7 +67,11 @@ export const CAR_MODELS = (() => {
|
|
| 67 |
words.forEach((w, i) => {
|
| 68 |
const beater = k.id !== "hover" && k.id !== "supercar" && (i % 5 === 3 || k.id === "classic" && i % 3 === 0);
|
| 69 |
const brand = BRANDS[(i * 5 + k.id.length) % BRANDS.length];
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
cols: beater ? [0x6b5a44, 0x7a3a2a, 0x5a6a5a, 0x8a7a5a] : k.cols.slice(0, 2 + Math.floor(rr() * (k.cols.length - 1))), rust: beater ? .55 + rr() * .45 : rr() < .15 ? rr() * .3 : 0,
|
| 72 |
top: perf[0] * (beater ? .85 : .92 + rr() * .16), acc: perf[1] * (beater ? .85 : .95 + rr() * .1), grip: perf[2] * (beater ? .85 : 1), offroad: OFFROAD[k.id] });
|
| 73 |
});
|
|
@@ -211,6 +215,7 @@ export function vehicle(k) {
|
|
| 211 |
return { body: mergeGeometries(p), lights: mergeGeometries(lt) };
|
| 212 |
}
|
| 213 |
const [body, glass, roof] = PROFILES[kind](L);
|
|
|
|
| 214 |
p.push(ext(body, W, BODY, .1), ext(glass, W * .9, GLASS, .06), ext(roof, W * .86, BODY, .05));
|
| 215 |
p.push(B(.2, .22, W * .96, L / 2 - .02, .42, 0, DARK), B(.2, .22, W * .96, -L / 2 + .02, .42, 0, DARK)); // bumpers
|
| 216 |
p.push(B(.03, .14, W * .5, L / 2 + .02, .58, 0, [.12, .12, .13])); // grille
|
|
@@ -225,8 +230,25 @@ export function vehicle(k) {
|
|
| 225 |
if (k.id === "taxi") { p.push(B(.55, .26, .9, -.1, 1.6, 0, BODY)); lt.push(B(.57, .16, .92, -.1, 1.62, 0, [1, .92, .6])); for (const s of [1, -1]) p.push(B(L * .7, .1, .02, 0, .66, s * (W / 2 + .01), [.03, .03, .03])); }
|
| 226 |
if (k.id === "police") { for (const s of [1, -1]) p.push(B(L * .8, .24, .02, 0, .65, s * (W / 2 + .01), [.12, .25, .75])); lt.push(B(.3, .14, .5, -.15, 1.52, .32, [.2, .35, 1]), B(.3, .14, .5, -.15, 1.52, -.32, [1, .15, .15])); }
|
| 227 |
lamps(kind === "sports" || kind === "supercar" ? .5 : kind === "hover" ? .55 : kind === "suv" || kind === "pickup" ? .85 : kind === "van" ? .85 : .66);
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
}
|
|
|
|
|
|
|
|
|
|
| 230 |
// people: torso and arms (shirt colour), each leg on its own so they can swing, a head and hair
|
| 231 |
const C = (rt, rb, h, seg, x, y, z, c, sx = 1, sz = 1) => tint(new THREE.CylinderGeometry(rt, rb, h, seg).scale(sx, 1, sz).translate(x, y, z).toNonIndexed(), c);
|
| 232 |
export function personGeo() {
|
|
@@ -267,8 +289,26 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 267 |
// ---- vehicles ----
|
| 268 |
const carMat = new THREE.MeshStandardMaterial({ vertexColors: true, roughness: .32, metalness: .55, envMapIntensity: 1.1 });
|
| 269 |
carMat.onBeforeCompile = sh => {
|
| 270 |
-
sh.vertexShader = sh.vertexShader.replace("#include <common>", "#include <common>\nattribute float aRust; varying float vRust; varying vec3 vOP;
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
.replace("#include <color_fragment>", "#include <color_fragment>\nfloat rn = fract(sin(dot(floor(vOP * 7.0), vec3(12.9898, 78.233, 37.719))) * 43758.5453) * .6 + fract(sin(dot(floor(vOP * 23.0), vec3(39.3, 11.7, 83.1))) * 9631.7) * .4; float rr = vRust * smoothstep(.55 - vRust * .35, .9, rn) * step(.12, diffuseColor.r + diffuseColor.g + diffuseColor.b); diffuseColor.rgb = mix(diffuseColor.rgb * (1.0 - vRust * .35), vec3(.36, .17, .07) * (.6 + .7 * rn), rr);")
|
| 273 |
.replace("#include <roughnessmap_fragment>", "#include <roughnessmap_fragment>\nroughnessFactor = mix(roughnessFactor, .95, vRust * .85);")
|
| 274 |
.replace("#include <metalnessmap_fragment>", "#include <metalnessmap_fragment>\nmetalnessFactor *= 1.0 - vRust * .85;");
|
|
@@ -278,6 +318,7 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 278 |
const meshes = KINDS.map((k, ti) => {
|
| 279 |
const g = vehicle(k), body = new THREE.InstancedMesh(g.body, carMat, Math.max(1, counts[ti])), lights = new THREE.InstancedMesh(g.lights, lightMat, Math.max(1, counts[ti]));
|
| 280 |
const rust = new Float32Array(Math.max(1, counts[ti])); body.geometry.setAttribute("aRust", new THREE.InstancedBufferAttribute(rust, 1)); body.rust = rust;
|
|
|
|
| 281 |
body.castShadow = true; body.frustumCulled = lights.frustumCulled = false; scene.add(body, lights); return { body, lights };
|
| 282 |
});
|
| 283 |
const cars = [], col = new THREE.Color();
|
|
@@ -306,10 +347,12 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 306 |
KINDS.forEach((k, ti) => {
|
| 307 |
for (let n = 0; n < counts[ti]; n++) {
|
| 308 |
const ms = CAR_MODELS.filter(m => m.kind === k), model = ms[Math.floor(rnd() * ms.length)];
|
| 309 |
-
const c = { kind: k, ti, n, model, v: 0, want: (k.id === "bus" || k.id === "truck" ? 8 : k.id === "sports" || k.id === "supercar" ? 13 : k.fly ? 18 : 10) + rnd() * 4, x: 0, z: 0, yaw: 0, y: 0, rx: 0, rz: 0, bump: 0, near: false, rust: model.rust ? Math.min(1, model.rust * (.8 + rnd() * .4)) : 0, fly: k.fly ? 20 + rnd() * 34 : FLYK.has(k.id) && rnd() < .
|
| 310 |
if (c.fly) c.want = 15 + rnd() * 9;
|
| 311 |
place(c); cars.push(c);
|
| 312 |
c.color = model.cols[Math.floor(rnd() * model.cols.length)]; c.col = new THREE.Color(c.color);
|
|
|
|
|
|
|
| 313 |
}
|
| 314 |
meshes[ti].body.setColorAt(0, col.setHex(0xffffff));
|
| 315 |
});
|
|
@@ -364,9 +407,9 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 364 |
};
|
| 365 |
|
| 366 |
// ---- per frame ----
|
| 367 |
-
const legQ = new THREE.Quaternion(), legM = new THREE.Matrix4(), legT = new THREE.Matrix4(), Z = new THREE.Vector3(0, 0, 1), squash = new THREE.Vector3(), m4 = new THREE.Matrix4(), q = new THREE.Quaternion(), e = new THREE.Euler(), Y = new THREE.Vector3(0, 1, 0), pos = new THREE.Vector3(), one = new THREE.Vector3(1, 1, 1), zero = new THREE.Vector3();
|
| 368 |
const buckets = new Map(), tmp = {}, cell = new Map(), CELL = 30;
|
| 369 |
-
let frameN = 0, debLive = 1, crashT = 0, reckT = 6;
|
| 370 |
const MASS = { bus: 4, truck: 3.5, sixer: 3, monster: 2.6, van: 1.6, suv: 1.4, pickup: 1.5, limo: 1.5, compact: .75, hatch: .85, buggy: .7 };
|
| 371 |
const LEGS = [[null, 1, .1], [null, -1, -.1]], pscale = new THREE.Vector3();
|
| 372 |
function decide(c, k) { // at the crossing k: straight on, or turn onto the cross road
|
|
@@ -392,11 +435,13 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 392 |
if (debris.instanceColor) debris.instanceColor.needsUpdate = true;
|
| 393 |
return;
|
| 394 |
}
|
| 395 |
-
const fly = power >
|
|
|
|
| 396 |
c.crush = fly ? .72 : .82;
|
| 397 |
c.wreck = fly ? { t: 0, vx: vx * .8 + (rnd() - .5) * 4, vz: vz * .8 + (rnd() - .5) * 4, vy: 4 + power * .25, wx: (rnd() - .5) * 8, wy: (rnd() - .5) * 6, wz: (rnd() - .5) * 8 }
|
| 398 |
: { t: 0, vx: vx * .45, vz: vz * .45, vy: 0, wx: 0, wy: (rnd() - .5) * 3, wz: 0 };
|
| 399 |
-
c.
|
|
|
|
| 400 |
c.col.setHex(c.color).multiplyScalar(fly ? .28 : .45);
|
| 401 |
debLive = 1; for (let k = 0; k < (fly ? 14 : 6); k++) {
|
| 402 |
const di = debI++ % DEB, d = deb[di]; d.life = 3 + rnd() * 2; d.p.set(c.x, 1, c.z); d.v.set(vx * .6 + (rnd() - .5) * 14, 3 + rnd() * 9, vz * .6 + (rnd() - .5) * 14); d.w.set(rnd() * 12, rnd() * 12, rnd() * 12); d.c = k % 3 ? c.color : 0x222222;
|
|
@@ -446,9 +491,9 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 446 |
return {
|
| 447 |
get detail() { return api.detail; }, set detail(v) { api.detail = v; },
|
| 448 |
cars, people, meshes, smash, near, models: CAR_MODELS,
|
| 449 |
-
set onHit(f) { api.onHit = f; }, set onCrash(f) { api.onCrash = f; },
|
| 450 |
// the flying VOID cars: the real car's shape, or (Lite) the simple low-poly body traffic uses
|
| 451 |
-
setVoidGeo(geo) { const M = meshes[KINDS.findIndex(k => k.id === "voidcar")]; if (!M) return; M.simple = M.simple || { body: M.body.geometry, lights: M.lights.geometry }; geo.setAttribute("aRust", M.simple.body.attributes.aRust); M.full = geo; },
|
| 452 |
setVoidDetail(full) { const M = meshes[KINDS.findIndex(k => k.id === "voidcar")]; if (!M || !M.full) return; M.body.geometry = full ? M.full : M.simple.body; M.lights.geometry = full ? jetGeo : M.simple.lights; }, set collide(f) { api.collide = f; }, set raining(v) { api.raining = v; }, set night(v) { api.night = v; },
|
| 453 |
take(c) { c.taken = true; c.parked = false; c.turn = null; },
|
| 454 |
park(c, x, z, yaw) { Object.assign(c, { taken: false, parked: true, x, z, yaw, v: 0, y: 0, wreck: null, turn: null, crush: 0 }); },
|
|
@@ -477,10 +522,14 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 477 |
const h = far ? dt * every : dt;
|
| 478 |
if (c.wreck) { // a smashed car tumbles, bounces, then lies there smoking until it is towed
|
| 479 |
const w = c.wreck; w.t += h;
|
| 480 |
-
if (c.y > 0 || w.vy > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
c.x += w.vx * h; c.z += w.vz * h; const f = Math.pow(c.y > 0 ? .9 : .2, h); w.vx *= f; w.vz *= f;
|
| 482 |
if (c.y === 0) { c.rx = Math.round(c.rx / Math.PI) * Math.PI * .02 + c.rx * .98; c.rz = Math.round(c.rz / Math.PI) * Math.PI * .02 + c.rz * .98; }
|
| 483 |
-
if (w.t > 24) { place(c); posOf(c); c.rx = c.rz = c.y = 0; c.col.setHex(c.color); c.crush = 0; c.dent = 0; }
|
| 484 |
} else if (c.parked) {
|
| 485 |
c.v = 0;
|
| 486 |
} else if (c.turn) {
|
|
@@ -530,12 +579,13 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 530 |
const ddx = c.x - cx0, ddz = c.z - cz0;
|
| 531 |
if (ddx * ddx + ddz * ddz < RC2) {
|
| 532 |
e.set(c.rx, -c.yaw, c.rz + (c.turn ? (c.fly ? .25 : .05) : 0), "YXZ"); q.setFromEuler(e); const md = c.model; m4.compose(pos.set(c.x, c.y, c.z), q, squash.set(md.sl, (c.crush || 1 - (c.dent || 0) * .07) * md.sh, md.sw));
|
| 533 |
-
const M = meshes[c.ti], k = M.k++; M.body.setMatrixAt(k, m4); M.body.setColorAt(k, c.col); M.body.rust[k] = c.rust;
|
|
|
|
| 534 |
if (c.fly && !c.wreck && c.kind.id !== "hover" && jk < 900) jets.setMatrixAt(jk++, m4);
|
| 535 |
if (!c.fly && c.y < 1.5 && bk2 < 2200 && ddx * ddx + ddz * ddz < 40000) {
|
| 536 |
bE.set(0, -c.yaw, 0); bQ.setFromEuler(bE); m4.compose(bP.set(c.x, .045, c.z), bQ, bS.set(c.kind.L * md.sl * 1.25, 1, c.kind.W * md.sw * 1.5)); blobs.setMatrixAt(bk2++, m4);
|
| 537 |
if (api.night && !c.wreck && hk2 < 600 && ddx * ddx + ddz * ddz < 25600) { const L = c.kind.L * md.sl; m4.compose(bP.set(c.x + Math.cos(c.yaw) * (L / 2 + 4.5), .05, c.z + Math.sin(c.yaw) * (L / 2 + 4.5)), bQ, bS.set(9, 1, 5.5)); beams.setMatrixAt(hk2++, m4); }
|
| 538 |
-
}
|
| 539 |
}
|
| 540 |
// collisions among the cars near the camera: a hard hit wrecks both, mass and momentum decide where they go
|
| 541 |
crashT += dt;
|
|
@@ -559,12 +609,23 @@ export function createLife(scene, roads, walkways, COARSE, DENS = 1) {
|
|
| 559 |
}
|
| 560 |
}
|
| 561 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 562 |
// every so often somebody near you drives like a maniac
|
| 563 |
-
if ((reckT -= .08) < 0 && player) { reckT =
|
| 564 |
}
|
| 565 |
jets.count = jk; jets.visible = jk > 0; jets.instanceMatrix.needsUpdate = true; jk = 0;
|
| 566 |
beams.count = hk2; beams.visible = hk2 > 0; beams.instanceMatrix.needsUpdate = true; hk2 = 0;
|
| 567 |
-
for (const m of meshes) { m.body.count = m.lights.count = m.k; m.body.visible = m.lights.visible = m.k > 0; m.body.instanceMatrix.needsUpdate = m.lights.instanceMatrix.needsUpdate = true; if (m.body.instanceColor) m.body.instanceColor.needsUpdate = true; m.body.geometry.attributes.aRust.needsUpdate = true; }
|
| 568 |
// debris (skipped once every piece has landed and been hidden)
|
| 569 |
if (debLive) { debLive = 0; for (let k = 0; k < DEB; k++) {
|
| 570 |
const d = deb[k];
|
|
|
|
| 67 |
words.forEach((w, i) => {
|
| 68 |
const beater = k.id !== "hover" && k.id !== "supercar" && (i % 5 === 3 || k.id === "classic" && i % 3 === 0);
|
| 69 |
const brand = BRANDS[(i * 5 + k.id.length) % BRANDS.length];
|
| 70 |
+
// its design: [roof height, nose drop, tail drop, part bits] (1 spoiler, 2 roof box, 4 hood scoop, 8 bull bar, 16 fender flares, 32 two-tone, 64 stripes)
|
| 71 |
+
const sporty = /sports|muscle|supercar|coupe/.test(k.id), utility = /suv|pickup|van|wagon/.test(k.id), P = (pr, b) => rr() < pr ? b : 0;
|
| 72 |
+
const bits = P(sporty ? .65 : .2, 1) + P(utility ? .45 : .1, 2) + P(k.id === "muscle" ? .7 : sporty ? .3 : .12, 4) + P(utility ? .4 : .05, 8) + P(sporty ? .4 : .12, 16) + P(.3, 32) + P(sporty ? .4 : .15, 64);
|
| 73 |
+
const design = [.86 + rr() * .3, (rr() - .3) * .55, (rr() - .25) * .6, beater ? bits & 58 : bits];
|
| 74 |
+
out.push({ id: `${k.id}-${i}`, name: `${brand} ${w}${beater ? " (rusty)" : ""}`, kind: k, design, sl: .9 + rr() * .2, sh: .93 + rr() * .14, sw: .95 + rr() * .1,
|
| 75 |
cols: beater ? [0x6b5a44, 0x7a3a2a, 0x5a6a5a, 0x8a7a5a] : k.cols.slice(0, 2 + Math.floor(rr() * (k.cols.length - 1))), rust: beater ? .55 + rr() * .45 : rr() < .15 ? rr() * .3 : 0,
|
| 76 |
top: perf[0] * (beater ? .85 : .92 + rr() * .16), acc: perf[1] * (beater ? .85 : .95 + rr() * .1), grip: perf[2] * (beater ? .85 : 1), offroad: OFFROAD[k.id] });
|
| 77 |
});
|
|
|
|
| 215 |
return { body: mergeGeometries(p), lights: mergeGeometries(lt) };
|
| 216 |
}
|
| 217 |
const [body, glass, roof] = PROFILES[kind](L);
|
| 218 |
+
const roofTop = Math.max(...roof.map(q => q[1])), deck = Math.max(...body.filter(q => q[0] < -L / 2 + .5).map(q => q[1])), hood = Math.max(...body.filter(q => q[0] > L / 2 - 1.3).map(q => q[1])), belt = Math.min(...glass.map(q => q[1]));
|
| 219 |
p.push(ext(body, W, BODY, .1), ext(glass, W * .9, GLASS, .06), ext(roof, W * .86, BODY, .05));
|
| 220 |
p.push(B(.2, .22, W * .96, L / 2 - .02, .42, 0, DARK), B(.2, .22, W * .96, -L / 2 + .02, .42, 0, DARK)); // bumpers
|
| 221 |
p.push(B(.03, .14, W * .5, L / 2 + .02, .58, 0, [.12, .12, .13])); // grille
|
|
|
|
| 230 |
if (k.id === "taxi") { p.push(B(.55, .26, .9, -.1, 1.6, 0, BODY)); lt.push(B(.57, .16, .92, -.1, 1.62, 0, [1, .92, .6])); for (const s of [1, -1]) p.push(B(L * .7, .1, .02, 0, .66, s * (W / 2 + .01), [.03, .03, .03])); }
|
| 231 |
if (k.id === "police") { for (const s of [1, -1]) p.push(B(L * .8, .24, .02, 0, .65, s * (W / 2 + .01), [.12, .25, .75])); lt.push(B(.3, .14, .5, -.15, 1.52, .32, [.2, .35, 1]), B(.3, .14, .5, -.15, 1.52, -.32, [1, .15, .15])); }
|
| 232 |
lamps(kind === "sports" || kind === "supercar" ? .5 : kind === "hover" ? .55 : kind === "suv" || kind === "pickup" ? .85 : kind === "van" ? .85 : .66);
|
| 233 |
+
// optional parts (each car switches its own on in the shader): spoiler, roof box, hood scoop, bull bar, fender flares
|
| 234 |
+
const opt = [];
|
| 235 |
+
if (k.id !== "taxi" && k.id !== "police") {
|
| 236 |
+
const ax = L / 2 - .95;
|
| 237 |
+
opt.push([1, [B(.34, .05, W * .88, -L / 2 + .3, deck + .34, 0, BODY), B(.06, .3, .06, -L / 2 + .32, deck + .17, W * .3, DARK), B(.06, .3, .06, -L / 2 + .32, deck + .17, -W * .3, DARK)]]);
|
| 238 |
+
opt.push([2, [B(L * .32, .17, W * .56, -.15, roofTop + .1, 0, DARK), B(L * .34, .03, W * .6, -.15, roofTop + .02, 0, CHR)]]);
|
| 239 |
+
opt.push([4, [B(.6, .13, .46, L / 2 - 1.05, hood + .05, 0, BODY), B(.04, .08, .4, L / 2 - .76, hood + .07, 0, [.05, .05, .05])]]);
|
| 240 |
+
opt.push([8, [B(.1, .36, W * .82, L / 2 + .12, .56, 0, CHR), B(.12, .08, W * .62, L / 2 - 1.5, roofTop + .06, 0, DARK)]]);
|
| 241 |
+
opt.push([16, [ax, -ax].flatMap(x => [1, -1].map(sd => B(1.0, .16, .1, x, .74, sd * (W / 2 + .03), DARK)))]);
|
| 242 |
+
}
|
| 243 |
+
for (const g of p) part(g, 0);
|
| 244 |
+
for (const [id, list] of opt) for (const g of list) p.push(part(g, Math.log2(id) + 1));
|
| 245 |
+
const merged = mergeGeometries(p);
|
| 246 |
+
shape(merged, L / 2, belt, roofTop);
|
| 247 |
+
return { body: merged, lights: mergeGeometries(lt) };
|
| 248 |
}
|
| 249 |
+
// which optional part a vertex belongs to (0: always there) and the body's shape numbers for the design shader
|
| 250 |
+
function part(g, id) { const n = g.attributes.position.count; g.setAttribute("aPart", new THREE.BufferAttribute(new Float32Array(n).fill(id), 1)); return g; }
|
| 251 |
+
function shape(g, hl, belt, top) { const n = g.attributes.position.count, a = new Float32Array(n * 3); for (let i = 0; i < n; i++) a.set([hl, belt, top], i * 3); g.setAttribute("aShape", new THREE.BufferAttribute(a, 3)); }
|
| 252 |
// people: torso and arms (shirt colour), each leg on its own so they can swing, a head and hair
|
| 253 |
const C = (rt, rb, h, seg, x, y, z, c, sx = 1, sz = 1) => tint(new THREE.CylinderGeometry(rt, rb, h, seg).scale(sx, 1, sz).translate(x, y, z).toNonIndexed(), c);
|
| 254 |
export function personGeo() {
|
|
|
|
| 289 |
// ---- vehicles ----
|
| 290 |
const carMat = new THREE.MeshStandardMaterial({ vertexColors: true, roughness: .32, metalness: .55, envMapIntensity: 1.1 });
|
| 291 |
carMat.onBeforeCompile = sh => {
|
| 292 |
+
sh.vertexShader = sh.vertexShader.replace("#include <common>", "#include <common>\nattribute float aRust; attribute vec4 aDesign; attribute vec3 aShape; attribute float aPart; varying float vRust; varying vec3 vOP; varying float vTone; varying float vStripe;")
|
| 293 |
+
.replace("#include <begin_vertex>", `#include <begin_vertex>
|
| 294 |
+
vRust = aRust; vOP = position; vTone = 0.; vStripe = 0.;
|
| 295 |
+
if (aShape.x > .1) {
|
| 296 |
+
float bits = aDesign.w;
|
| 297 |
+
if (aPart > .5 && mod(floor(bits / exp2(aPart - 1.)), 2.) < .5) transformed = vec3(0.); // a part this car doesn't have
|
| 298 |
+
else if (!(abs(color.b - color.r) < .005 && color.r < .07)) { // (tyres keep their shape)
|
| 299 |
+
float hl = aShape.x, belt = aShape.y, ax = abs(transformed.x) / hl;
|
| 300 |
+
if (transformed.y > belt) transformed.y = belt + (transformed.y - belt) * aDesign.x; // a taller or lower glasshouse
|
| 301 |
+
float topN = belt + (aShape.z - belt) * aDesign.x, lift = max(0., transformed.y - .32);
|
| 302 |
+
transformed.y -= (smoothstep(.45, 1., transformed.x / hl) * aDesign.y + smoothstep(.45, 1., -transformed.x / hl) * aDesign.z) * lift * .55; // sleek or blunt nose and tail
|
| 303 |
+
transformed.z *= 1. - .13 * pow(smoothstep(.55, 1., ax), 1.4) - .2 * smoothstep(belt - .05, topN + .05, transformed.y); // rounded corners, sides leaning in to the roof
|
| 304 |
+
transformed.y -= .07 * smoothstep(.82, 1., ax) * lift; // rounded top edges front and back
|
| 305 |
+
}
|
| 306 |
+
float painted = step(.9, color.r * color.g * color.b);
|
| 307 |
+
vTone = painted * mod(floor(bits / 32.), 2.) * step(position.y, aShape.y * .62);
|
| 308 |
+
vStripe = painted * mod(floor(bits / 64.), 2.) * step(abs(position.z), .22) * step(aShape.y * .8, position.y);
|
| 309 |
+
}`);
|
| 310 |
+
sh.fragmentShader = sh.fragmentShader.replace("#include <common>", "#include <common>\nvarying float vRust; varying vec3 vOP; varying float vTone; varying float vStripe;")
|
| 311 |
+
.replace("#include <color_fragment>", "#include <color_fragment>\nif (vTone > .5) diffuseColor.rgb *= .22; if (vStripe > .5) diffuseColor.rgb = dot(diffuseColor.rgb, vec3(.3, .59, .11)) > .45 ? vec3(.04) : vec3(.92);")
|
| 312 |
.replace("#include <color_fragment>", "#include <color_fragment>\nfloat rn = fract(sin(dot(floor(vOP * 7.0), vec3(12.9898, 78.233, 37.719))) * 43758.5453) * .6 + fract(sin(dot(floor(vOP * 23.0), vec3(39.3, 11.7, 83.1))) * 9631.7) * .4; float rr = vRust * smoothstep(.55 - vRust * .35, .9, rn) * step(.12, diffuseColor.r + diffuseColor.g + diffuseColor.b); diffuseColor.rgb = mix(diffuseColor.rgb * (1.0 - vRust * .35), vec3(.36, .17, .07) * (.6 + .7 * rn), rr);")
|
| 313 |
.replace("#include <roughnessmap_fragment>", "#include <roughnessmap_fragment>\nroughnessFactor = mix(roughnessFactor, .95, vRust * .85);")
|
| 314 |
.replace("#include <metalnessmap_fragment>", "#include <metalnessmap_fragment>\nmetalnessFactor *= 1.0 - vRust * .85;");
|
|
|
|
| 318 |
const meshes = KINDS.map((k, ti) => {
|
| 319 |
const g = vehicle(k), body = new THREE.InstancedMesh(g.body, carMat, Math.max(1, counts[ti])), lights = new THREE.InstancedMesh(g.lights, lightMat, Math.max(1, counts[ti]));
|
| 320 |
const rust = new Float32Array(Math.max(1, counts[ti])); body.geometry.setAttribute("aRust", new THREE.InstancedBufferAttribute(rust, 1)); body.rust = rust;
|
| 321 |
+
const des = new Float32Array(Math.max(1, counts[ti]) * 4); body.geometry.setAttribute("aDesign", new THREE.InstancedBufferAttribute(des, 4)); body.design = des;
|
| 322 |
body.castShadow = true; body.frustumCulled = lights.frustumCulled = false; scene.add(body, lights); return { body, lights };
|
| 323 |
});
|
| 324 |
const cars = [], col = new THREE.Color();
|
|
|
|
| 347 |
KINDS.forEach((k, ti) => {
|
| 348 |
for (let n = 0; n < counts[ti]; n++) {
|
| 349 |
const ms = CAR_MODELS.filter(m => m.kind === k), model = ms[Math.floor(rnd() * ms.length)];
|
| 350 |
+
const c = { kind: k, ti, n, model, v: 0, want: (k.id === "bus" || k.id === "truck" ? 8 : k.id === "sports" || k.id === "supercar" ? 13 : k.fly ? 18 : 10) + rnd() * 4, x: 0, z: 0, yaw: 0, y: 0, rx: 0, rz: 0, bump: 0, near: false, rust: model.rust ? Math.min(1, model.rust * (.8 + rnd() * .4)) : 0, fly: k.fly ? 20 + rnd() * 34 : FLYK.has(k.id) && rnd() < .22 ? 26 + rnd() * 44 : 0, idx: cars.length };
|
| 351 |
if (c.fly) c.want = 15 + rnd() * 9;
|
| 352 |
place(c); cars.push(c);
|
| 353 |
c.color = model.cols[Math.floor(rnd() * model.cols.length)]; c.col = new THREE.Color(c.color);
|
| 354 |
+
const d0 = model.design || [1, 0, 0, 0], plain = k.id === "taxi" || k.id === "police";
|
| 355 |
+
c.design = [plain ? 1 : d0[0] * (.94 + rnd() * .12), d0[1] + (rnd() - .5) * .16, d0[2] + (rnd() - .5) * .16, rnd() < .35 ? d0[3] ^ (1 << Math.floor(rnd() * 7)) : d0[3]];
|
| 356 |
}
|
| 357 |
meshes[ti].body.setColorAt(0, col.setHex(0xffffff));
|
| 358 |
});
|
|
|
|
| 407 |
};
|
| 408 |
|
| 409 |
// ---- per frame ----
|
| 410 |
+
const legQ = new THREE.Quaternion(), legM = new THREE.Matrix4(), legT = new THREE.Matrix4(), Z = new THREE.Vector3(0, 0, 1), squash = new THREE.Vector3(), m4 = new THREE.Matrix4(), lm4 = new THREE.Matrix4(), q = new THREE.Quaternion(), e = new THREE.Euler(), Y = new THREE.Vector3(0, 1, 0), pos = new THREE.Vector3(), one = new THREE.Vector3(1, 1, 1), zero = new THREE.Vector3();
|
| 411 |
const buckets = new Map(), tmp = {}, cell = new Map(), CELL = 30;
|
| 412 |
+
let frameN = 0, debLive = 1, crashT = 0, reckT = 6, skyT = 8;
|
| 413 |
const MASS = { bus: 4, truck: 3.5, sixer: 3, monster: 2.6, van: 1.6, suv: 1.4, pickup: 1.5, limo: 1.5, compact: .75, hatch: .85, buggy: .7 };
|
| 414 |
const LEGS = [[null, 1, .1], [null, -1, -.1]], pscale = new THREE.Vector3();
|
| 415 |
function decide(c, k) { // at the crossing k: straight on, or turn onto the cross road
|
|
|
|
| 435 |
if (debris.instanceColor) debris.instanceColor.needsUpdate = true;
|
| 436 |
return;
|
| 437 |
}
|
| 438 |
+
const fly = power > 22, air = c.y > 3; // (a flying car keeps its height and falls)
|
| 439 |
+
if (air) { c.fly0 = c.fly0 || c.fly; c.fly = 0; }
|
| 440 |
c.crush = fly ? .72 : .82;
|
| 441 |
c.wreck = fly ? { t: 0, vx: vx * .8 + (rnd() - .5) * 4, vz: vz * .8 + (rnd() - .5) * 4, vy: 4 + power * .25, wx: (rnd() - .5) * 8, wy: (rnd() - .5) * 6, wz: (rnd() - .5) * 8 }
|
| 442 |
: { t: 0, vx: vx * .45, vz: vz * .45, vy: 0, wx: 0, wy: (rnd() - .5) * 3, wz: 0 };
|
| 443 |
+
if (air) { c.wreck.vy = Math.max(c.wreck.vy * .5, 2); c.wreck.wx = (rnd() - .5) * 5; c.wreck.wz = (rnd() - .5) * 5; c.wreck.air = 1; } else c.y = 0;
|
| 444 |
+
c.rx = 0; c.rz = 0; c.v = 0; c.turn = null;
|
| 445 |
c.col.setHex(c.color).multiplyScalar(fly ? .28 : .45);
|
| 446 |
debLive = 1; for (let k = 0; k < (fly ? 14 : 6); k++) {
|
| 447 |
const di = debI++ % DEB, d = deb[di]; d.life = 3 + rnd() * 2; d.p.set(c.x, 1, c.z); d.v.set(vx * .6 + (rnd() - .5) * 14, 3 + rnd() * 9, vz * .6 + (rnd() - .5) * 14); d.w.set(rnd() * 12, rnd() * 12, rnd() * 12); d.c = k % 3 ? c.color : 0x222222;
|
|
|
|
| 491 |
return {
|
| 492 |
get detail() { return api.detail; }, set detail(v) { api.detail = v; },
|
| 493 |
cars, people, meshes, smash, near, models: CAR_MODELS,
|
| 494 |
+
set onHit(f) { api.onHit = f; }, set onCrash(f) { api.onCrash = f; }, set onBoom(f) { api.onBoom = f; }, set onSmoke(f) { api.onSmoke = f; },
|
| 495 |
// the flying VOID cars: the real car's shape, or (Lite) the simple low-poly body traffic uses
|
| 496 |
+
setVoidGeo(geo) { const M = meshes[KINDS.findIndex(k => k.id === "voidcar")]; if (!M) return; M.simple = M.simple || { body: M.body.geometry, lights: M.lights.geometry }; geo.setAttribute("aRust", M.simple.body.attributes.aRust); geo.setAttribute("aDesign", M.simple.body.attributes.aDesign); M.full = geo; },
|
| 497 |
setVoidDetail(full) { const M = meshes[KINDS.findIndex(k => k.id === "voidcar")]; if (!M || !M.full) return; M.body.geometry = full ? M.full : M.simple.body; M.lights.geometry = full ? jetGeo : M.simple.lights; }, set collide(f) { api.collide = f; }, set raining(v) { api.raining = v; }, set night(v) { api.night = v; },
|
| 498 |
take(c) { c.taken = true; c.parked = false; c.turn = null; },
|
| 499 |
park(c, x, z, yaw) { Object.assign(c, { taken: false, parked: true, x, z, yaw, v: 0, y: 0, wreck: null, turn: null, crush: 0 }); },
|
|
|
|
| 522 |
const h = far ? dt * every : dt;
|
| 523 |
if (c.wreck) { // a smashed car tumbles, bounces, then lies there smoking until it is towed
|
| 524 |
const w = c.wreck; w.t += h;
|
| 525 |
+
if (c.y > 0 || w.vy > 0) {
|
| 526 |
+
w.vy -= 9.81 * h; c.y = Math.max(0, c.y + w.vy * h); c.rx += w.wx * h; c.rz += w.wz * h; c.yaw += w.wy * h;
|
| 527 |
+
if (w.air && c.y > 2 && api.onSmoke && (w.st = (w.st || 0) - h) < 0) { w.st = .06; api.onSmoke(c.x, c.y + .6, c.z); } // a smoke trail on the way down
|
| 528 |
+
if (c.y === 0) { if (w.air && w.vy < -10) { w.air = 0; if (api.onBoom) api.onBoom(c.x, c.z, -w.vy); } w.vy = -w.vy * .3; w.wx *= .5; w.wz *= .5; w.wy *= .5; if (Math.abs(w.vy) < 1) w.vy = 0; }
|
| 529 |
+
}
|
| 530 |
c.x += w.vx * h; c.z += w.vz * h; const f = Math.pow(c.y > 0 ? .9 : .2, h); w.vx *= f; w.vz *= f;
|
| 531 |
if (c.y === 0) { c.rx = Math.round(c.rx / Math.PI) * Math.PI * .02 + c.rx * .98; c.rz = Math.round(c.rz / Math.PI) * Math.PI * .02 + c.rz * .98; }
|
| 532 |
+
if (w.t > 24) { place(c); posOf(c); c.rx = c.rz = c.y = 0; c.col.setHex(c.color); c.crush = 0; c.dent = 0; if (c.fly0) { c.fly = c.fly0; c.fly0 = 0; } }
|
| 533 |
} else if (c.parked) {
|
| 534 |
c.v = 0;
|
| 535 |
} else if (c.turn) {
|
|
|
|
| 579 |
const ddx = c.x - cx0, ddz = c.z - cz0;
|
| 580 |
if (ddx * ddx + ddz * ddz < RC2) {
|
| 581 |
e.set(c.rx, -c.yaw, c.rz + (c.turn ? (c.fly ? .25 : .05) : 0), "YXZ"); q.setFromEuler(e); const md = c.model; m4.compose(pos.set(c.x, c.y, c.z), q, squash.set(md.sl, (c.crush || 1 - (c.dent || 0) * .07) * md.sh, md.sw));
|
| 582 |
+
const M = meshes[c.ti], k = M.k++; M.body.setMatrixAt(k, m4); M.body.setColorAt(k, c.col); M.body.rust[k] = c.rust; M.body.design.set(c.design, k * 4);
|
| 583 |
+
M.lights.setMatrixAt(k, c.wreck ? lm4.compose(pos, q, zero) : m4); // (before the shadow and headlight-pool code below reuse m4)
|
| 584 |
if (c.fly && !c.wreck && c.kind.id !== "hover" && jk < 900) jets.setMatrixAt(jk++, m4);
|
| 585 |
if (!c.fly && c.y < 1.5 && bk2 < 2200 && ddx * ddx + ddz * ddz < 40000) {
|
| 586 |
bE.set(0, -c.yaw, 0); bQ.setFromEuler(bE); m4.compose(bP.set(c.x, .045, c.z), bQ, bS.set(c.kind.L * md.sl * 1.25, 1, c.kind.W * md.sw * 1.5)); blobs.setMatrixAt(bk2++, m4);
|
| 587 |
if (api.night && !c.wreck && hk2 < 600 && ddx * ddx + ddz * ddz < 25600) { const L = c.kind.L * md.sl; m4.compose(bP.set(c.x + Math.cos(c.yaw) * (L / 2 + 4.5), .05, c.z + Math.sin(c.yaw) * (L / 2 + 4.5)), bQ, bS.set(9, 1, 5.5)); beams.setMatrixAt(hk2++, m4); }
|
| 588 |
+
} }
|
| 589 |
}
|
| 590 |
// collisions among the cars near the camera: a hard hit wrecks both, mass and momentum decide where they go
|
| 591 |
crashT += dt;
|
|
|
|
| 609 |
}
|
| 610 |
}
|
| 611 |
}
|
| 612 |
+
// every so often something happens in the sky near you: a flyer's engine dies, or two of them collide
|
| 613 |
+
if ((skyT -= .08) < 0 && player) {
|
| 614 |
+
skyT = 12 + rnd() * 14; const fx0 = player.vx || 0, fz0 = player.vz || 0, fl = Math.hypot(fx0, fz0) || 1;
|
| 615 |
+
const pick = cars.filter(c => c.fly && !c.wreck && c.kind.id !== "voidcar" && Math.hypot(c.x - player.x, c.z - player.z) < 420 && Math.hypot(c.x - player.x, c.z - player.z) > 70 && ((c.x - player.x) * fx0 + (c.z - player.z) * fz0) / fl > -40);
|
| 616 |
+
if (pick.length) {
|
| 617 |
+
const a = pick[Math.floor(rnd() * pick.length)], b = pick.find(o => o !== a && Math.hypot(o.x - a.x, o.z - a.z) < 140 && Math.abs(o.y - a.y) < 30);
|
| 618 |
+
if (b) { const nx = b.x - a.x, nz = b.z - a.z, d = Math.hypot(nx, nz) || 1; smash(a, nx / d * 12, nz / d * 12, 40); smash(b, -nx / d * 12, -nz / d * 12, 40); if (api.onBoom) api.onBoom((a.x + b.x) / 2, (a.z + b.z) / 2, 30, (a.y + b.y) / 2); }
|
| 619 |
+
else { a.fail = 2.2; }
|
| 620 |
+
}
|
| 621 |
+
}
|
| 622 |
+
for (const c of cars) if (c.fail > 0) { if (api.onSmoke) api.onSmoke(c.x, c.y + .5, c.z); if ((c.fail -= .08) <= 0 && !c.wreck) smash(c, Math.cos(c.yaw) * c.v, Math.sin(c.yaw) * c.v, 30); }
|
| 623 |
// every so often somebody near you drives like a maniac
|
| 624 |
+
if ((reckT -= .08) < 0 && player) { reckT = 6 + rnd() * 6; for (let t = 0; t < 40; t++) { const c = cars[Math.floor(rnd() * cars.length)], d = Math.hypot(c.x - player.x, c.z - player.z); if (!c.fly && !c.wreck && !c.taken && !c.parked && d > 70 && d < 260 && !(MASS[c.kind.id] > 1.5)) { c.reck = 20 + rnd() * 15; break; } } }
|
| 625 |
}
|
| 626 |
jets.count = jk; jets.visible = jk > 0; jets.instanceMatrix.needsUpdate = true; jk = 0;
|
| 627 |
beams.count = hk2; beams.visible = hk2 > 0; beams.instanceMatrix.needsUpdate = true; hk2 = 0;
|
| 628 |
+
for (const m of meshes) { m.body.count = m.lights.count = m.k; m.body.visible = m.lights.visible = m.k > 0; m.body.instanceMatrix.needsUpdate = m.lights.instanceMatrix.needsUpdate = true; if (m.body.instanceColor) m.body.instanceColor.needsUpdate = true; m.body.geometry.attributes.aRust.needsUpdate = true; if (m.body.geometry.attributes.aDesign) m.body.geometry.attributes.aDesign.needsUpdate = true; }
|
| 629 |
// debris (skipped once every piece has landed and been hidden)
|
| 630 |
if (debLive) { debLive = 0; for (let k = 0; k < DEB; k++) {
|
| 631 |
const d = deb[k];
|
static/sound.js
CHANGED
|
@@ -37,6 +37,17 @@ function gameMix(state) {
|
|
| 37 |
return { ...base, pad: .5, hat: .4, chop: .3, open: 900 };
|
| 38 |
}
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
export class Sound {
|
| 41 |
constructor() { this.on = false; this.ctx = null; this.songStart = null; this.liveStep = 0; this.gameState = "idle"; this.mode = "idle"; }
|
| 42 |
|
|
@@ -61,7 +72,7 @@ export class Sound {
|
|
| 61 |
rev.buffer = ir; this.revBus = C.createGain(); this.revBus.gain.value = .28; this.revBus.connect(rev).connect(this.musicIn);
|
| 62 |
|
| 63 |
this.bus = {};
|
| 64 |
-
for (const k of ["pad", "hat", "kick", "clap", "bass", "bell", "chop"]) {
|
| 65 |
const g = C.createGain(); g.gain.value = 0; this.bus[k] = g;
|
| 66 |
g.connect(k === "kick" || k === "clap" || k === "hat" ? this.musicIn : this.pump);
|
| 67 |
}
|
|
@@ -69,7 +80,7 @@ export class Sound {
|
|
| 69 |
this.bellIn = C.createGain(); const bd = C.createWaveShaper(); bd.curve = this.curve(9); bd.oversample = "4x";
|
| 70 |
const bellTone = C.createBiquadFilter(); bellTone.type = "peaking"; bellTone.frequency.value = 2200; bellTone.gain.value = 5;
|
| 71 |
this.bellIn.connect(bd).connect(bellTone).connect(this.bus.bell); bellTone.connect(this.revBus);
|
| 72 |
-
this.bus.chop.connect(this.revBus);
|
| 73 |
|
| 74 |
// pad: detuned saws through a lowpass that opens with the section
|
| 75 |
this.padF = C.createBiquadFilter(); this.padF.type = "lowpass"; this.padF.frequency.value = 900; this.padF.Q.value = .8;
|
|
@@ -135,8 +146,9 @@ export class Sound {
|
|
| 135 |
this.songStep++; this.next += STEP;
|
| 136 |
}
|
| 137 |
} else {
|
| 138 |
-
const
|
| 139 |
-
|
|
|
|
| 140 |
}
|
| 141 |
}
|
| 142 |
|
|
@@ -162,6 +174,21 @@ export class Sound {
|
|
| 162 |
if (m.chop > .01 && ((s === 0 && bar % 2 === 0) || (s === 10 && bar === 3))) this.chop(t, s === 0 ? "ah" : "ey", 1);
|
| 163 |
}
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
env(g, t, a, peak, dec) { g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a); g.gain.exponentialRampToValueAtTime(.0001, t + a + dec); }
|
| 166 |
duck(t) { const g = this.pump.gain; g.cancelScheduledValues(t); g.setValueAtTime(1, t); g.linearRampToValueAtTime(.3, t + .01); g.linearRampToValueAtTime(1, t + .22); }
|
| 167 |
kick(t) {
|
|
@@ -204,7 +231,8 @@ export class Sound {
|
|
| 204 |
whoosh() { if (this.on) this.noiseHit(this.ctx.currentTime, "bandpass", 700, .8, .5, .9, this.sfx); }
|
| 205 |
pop() { if (this.on) { const t = this.ctx.currentTime; this.noiseHit(t, "bandpass", 300, 1, .9, .07, this.sfx); this.noiseHit(t + .06, "bandpass", 260, 1, .6, .06, this.sfx); } }
|
| 206 |
crash() { if (this.on) { const t = this.ctx.currentTime; this.noiseHit(t, "lowpass", 2500, .4, 1, 1.2, this.sfx); this.noiseHit(t, "bandpass", 180, 1, 1, .6, this.sfx); } }
|
| 207 |
-
// the car radio: "score" is the game's own music
|
|
|
|
| 208 |
setRadio(st) { this.init(); this.radio = st; this.musicIn.gain.setTargetAtTime(st === "off" ? 0 : .5, this.ctx.currentTime, .3); if (st === "voidfm") this.startSong(0); else if (this.mode === "song") this.stopSong(); }
|
| 209 |
siren(level) { // a wailing two-tone siren whose volume follows how close the nearest cruiser is
|
| 210 |
if (!this.ctx || !this.on) return; const c = this.ctx, t = c.currentTime;
|
|
|
|
| 37 |
return { ...base, pad: .5, hat: .4, chop: .3, open: 900 };
|
| 38 |
}
|
| 39 |
|
| 40 |
+
// the radio's stations (beside the adaptive VOID Score): each has its own tempo, chords, drums and lead
|
| 41 |
+
const STATIONS = {
|
| 42 |
+
synth: { step: 60 / 118 / 4, roots: [110, 87.31, 130.81, 98], chords: [[220, 261.63, 329.63], [174.61, 220, 261.63], [196, 261.63, 329.63], [196, 246.94, 293.66]],
|
| 43 |
+
kick: [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], bass: [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1], clap: [4, 12], hat: [0, 0, .6, 0, 0, 0, .6, 0, 0, 0, .6, 0, 0, 0, .6, .4],
|
| 44 |
+
arp: { every: 1, mul: 2, wave: "sawtooth", len: .12, gain: .2, cut: 2600 }, mix: { pad: .5, hat: .8, kick: 1, clap: .7, bass: .8, arp: 1, open: 2800 } },
|
| 45 |
+
chill: { step: 60 / 84 / 4, roots: [73.42, 61.74, 98, 110], chords: [[185, 220, 277.18], [146.83, 185, 220], [146.83, 185, 246.94], [164.81, 220, 277.18]],
|
| 46 |
+
kick: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], bass: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], clap: [12], hat: [0, 0, .4, 0, 0, 0, .4, 0, 0, 0, .4, 0, 0, 0, .4, 0],
|
| 47 |
+
arp: { every: 2, mul: 1, wave: "triangle", len: .32, gain: .2, cut: 1800 }, mix: { pad: .75, hat: .35, kick: .6, clap: .35, bass: .6, arp: .8, open: 1100 } },
|
| 48 |
+
chase: { mix: { pad: .45, hat: 1, kick: 1, clap: 1, bass: 1, bell: 1, chop: .5, open: 4200 } }, // the phonk at full tilt, whatever you're doing
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
export class Sound {
|
| 52 |
constructor() { this.on = false; this.ctx = null; this.songStart = null; this.liveStep = 0; this.gameState = "idle"; this.mode = "idle"; }
|
| 53 |
|
|
|
|
| 72 |
rev.buffer = ir; this.revBus = C.createGain(); this.revBus.gain.value = .28; this.revBus.connect(rev).connect(this.musicIn);
|
| 73 |
|
| 74 |
this.bus = {};
|
| 75 |
+
for (const k of ["pad", "hat", "kick", "clap", "bass", "bell", "chop", "arp"]) {
|
| 76 |
const g = C.createGain(); g.gain.value = 0; this.bus[k] = g;
|
| 77 |
g.connect(k === "kick" || k === "clap" || k === "hat" ? this.musicIn : this.pump);
|
| 78 |
}
|
|
|
|
| 80 |
this.bellIn = C.createGain(); const bd = C.createWaveShaper(); bd.curve = this.curve(9); bd.oversample = "4x";
|
| 81 |
const bellTone = C.createBiquadFilter(); bellTone.type = "peaking"; bellTone.frequency.value = 2200; bellTone.gain.value = 5;
|
| 82 |
this.bellIn.connect(bd).connect(bellTone).connect(this.bus.bell); bellTone.connect(this.revBus);
|
| 83 |
+
this.bus.chop.connect(this.revBus); this.bus.arp.connect(this.revBus);
|
| 84 |
|
| 85 |
// pad: detuned saws through a lowpass that opens with the section
|
| 86 |
this.padF = C.createBiquadFilter(); this.padF.type = "lowpass"; this.padF.frequency.value = 900; this.padF.Q.value = .8;
|
|
|
|
| 146 |
this.songStep++; this.next += STEP;
|
| 147 |
}
|
| 148 |
} else {
|
| 149 |
+
const St = STATIONS[this.radio], step = St && St.step || STEP;
|
| 150 |
+
const mix = St ? St.mix : this.mode === "game" ? gameMix(this.gameState) : { pad: .4, hat: 0, kick: 0, clap: 0, bass: 0, bell: 0, chop: 0, rise: 0, half: true, riff: 0, open: 700 };
|
| 151 |
+
while (this.next < C.currentTime + .12) { this.applyMix(mix, this.next); if (St && St.chords) this.playStation(this.liveStep, this.next, St); else this.playStep(this.liveStep, this.next, mix); this.liveStep++; this.next += step; }
|
| 152 |
}
|
| 153 |
}
|
| 154 |
|
|
|
|
| 174 |
if (m.chop > .01 && ((s === 0 && bar % 2 === 0) || (s === 10 && bar === 3))) this.chop(t, s === 0 ? "ah" : "ey", 1);
|
| 175 |
}
|
| 176 |
|
| 177 |
+
// a station's bar: its chords on the pad, its drums, and an arpeggio up and down the chord
|
| 178 |
+
playStation(n, t, S) {
|
| 179 |
+
const s = n % 16, bar = Math.floor(n / 16) % 4, ch = S.chords[bar];
|
| 180 |
+
if (s === 0) ch.forEach((fr, i) => { this.padOsc[i * 2].frequency.setTargetAtTime(fr, t, .08); this.padOsc[i * 2 + 1].frequency.setTargetAtTime(fr * 1.003, t, .08); });
|
| 181 |
+
if (S.kick[s]) { this.kick(t); this.duck(t); }
|
| 182 |
+
if (S.bass[s]) this.bass808(t, S.roots[bar]);
|
| 183 |
+
if (S.clap.includes(s)) this.clap(t);
|
| 184 |
+
if (S.hat[s]) this.hat(t, S.hat[s]);
|
| 185 |
+
const A = S.arp; if (s % A.every === 0) { const notes = [ch[0], ch[1], ch[2], ch[0] * 2, ch[2], ch[1]]; this.arpNote(t, notes[Math.floor(n / A.every) % notes.length] * A.mul, A); }
|
| 186 |
+
}
|
| 187 |
+
arpNote(t, fr, A) {
|
| 188 |
+
const C = this.ctx, o = C.createOscillator(), g = C.createGain(), f = C.createBiquadFilter();
|
| 189 |
+
o.type = A.wave; o.frequency.value = fr; f.type = "lowpass"; f.frequency.setValueAtTime(A.cut, t); f.frequency.exponentialRampToValueAtTime(380, t + A.len);
|
| 190 |
+
this.env(g, t, .004, A.gain, A.len); o.connect(f).connect(g).connect(this.bus.arp); o.start(t); o.stop(t + A.len + .05);
|
| 191 |
+
}
|
| 192 |
env(g, t, a, peak, dec) { g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a); g.gain.exponentialRampToValueAtTime(.0001, t + a + dec); }
|
| 193 |
duck(t) { const g = this.pump.gain; g.cancelScheduledValues(t); g.setValueAtTime(1, t); g.linearRampToValueAtTime(.3, t + .01); g.linearRampToValueAtTime(1, t + .22); }
|
| 194 |
kick(t) {
|
|
|
|
| 231 |
whoosh() { if (this.on) this.noiseHit(this.ctx.currentTime, "bandpass", 700, .8, .5, .9, this.sfx); }
|
| 232 |
pop() { if (this.on) { const t = this.ctx.currentTime; this.noiseHit(t, "bandpass", 300, 1, .9, .07, this.sfx); this.noiseHit(t + .06, "bandpass", 260, 1, .6, .06, this.sfx); } }
|
| 233 |
crash() { if (this.on) { const t = this.ctx.currentTime; this.noiseHit(t, "lowpass", 2500, .4, 1, 1.2, this.sfx); this.noiseHit(t, "bandpass", 180, 1, 1, .6, this.sfx); } }
|
| 234 |
+
// the car radio: "score" is the game's own music (it follows what you do), "synth" / "chill" / "chase" are stations,
|
| 235 |
+
// "voidfm" loops the film track, "off" is engine and city only
|
| 236 |
setRadio(st) { this.init(); this.radio = st; this.musicIn.gain.setTargetAtTime(st === "off" ? 0 : .5, this.ctx.currentTime, .3); if (st === "voidfm") this.startSong(0); else if (this.mode === "song") this.stopSong(); }
|
| 237 |
siren(level) { // a wailing two-tone siren whose volume follows how close the nearest cruiser is
|
| 238 |
if (!this.ctx || !this.on) return; const c = this.ctx, t = c.currentTime;
|
static/style.css
CHANGED
|
@@ -462,3 +462,46 @@ body.show-fps .fps-hud { display: block; } .fps-hud.mid { color: #ffd23d; } .fps
|
|
| 462 |
.net-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
|
| 463 |
.net-row .pill { padding: 4px 10px; font-size: 12px; }
|
| 464 |
#gMic.on { background: linear-gradient(90deg, #3dff8a var(--lvl, 0%), #3dfcff var(--lvl, 0%)) !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
.net-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
|
| 463 |
.net-row .pill { padding: 4px 10px; font-size: 12px; }
|
| 464 |
#gMic.on { background: linear-gradient(90deg, #3dff8a var(--lvl, 0%), #3dfcff var(--lvl, 0%)) !important; }
|
| 465 |
+
|
| 466 |
+
/* loading: the Hydra drives down a night road while the city loads (--p is the progress, 0..1) */
|
| 467 |
+
#loader { background: linear-gradient(#05060c 0%, #10142a 55%, #1c1630 70%, #05060a 70.2%); display: block; overflow: hidden; --p: 0; }
|
| 468 |
+
.ld-title { position: absolute; top: 14vh; left: 0; right: 0; text-align: center; font: 900 clamp(46px, 10vw, 120px)/1 var(--wide); letter-spacing: .06em; color: transparent; -webkit-text-stroke: 1.4px rgba(255,255,255,.6); }
|
| 469 |
+
.ld-title span { display: block; margin-top: 10px; font: 700 clamp(11px, 1.6vw, 15px) var(--wide); letter-spacing: .5em; color: #c1121f; -webkit-text-stroke: 0; }
|
| 470 |
+
.ld-sky { position: absolute; left: 0; right: 0; bottom: 30%; height: 46%; }
|
| 471 |
+
.ld-moon { position: absolute; right: 14%; top: 4%; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff8e6, #d9d2c0 60%, transparent 62%); box-shadow: 0 0 60px rgba(255,240,210,.25); }
|
| 472 |
+
.ld-city { position: absolute; left: 0; right: 0; bottom: 0; background-repeat: repeat-x; background-position: 0 100%; animation: ldScroll linear infinite; }
|
| 473 |
+
.ld-city.far { height: 260px; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%221200%22%20height%3D%22260%22%20viewBox%3D%220%200%201200%20260%22%3E%3Crect%20x%3D%220%22%20y%3D%22131%22%20width%3D%2256%22%20height%3D%22129%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%2258%22%20y%3D%2232%22%20width%3D%2240%22%20height%3D%22228%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%2276%22%20y%3D%2214%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22100%22%20y%3D%22115%22%20width%3D%2268%22%20height%3D%22145%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22132%22%20y%3D%2297%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22176%22%20y%3D%22152%22%20width%3D%2262%22%20height%3D%22108%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22205%22%20y%3D%22134%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22248%22%20y%3D%22154%22%20width%3D%2263%22%20height%3D%22106%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22314%22%20y%3D%2220%22%20width%3D%2250%22%20height%3D%22240%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22372%22%20y%3D%22113%22%20width%3D%2239%22%20height%3D%22147%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22389%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22415%22%20y%3D%2262%22%20width%3D%2254%22%20height%3D%22198%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22440%22%20y%3D%2244%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22472%22%20y%3D%2291%22%20width%3D%2272%22%20height%3D%22169%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22548%22%20y%3D%2221%22%20width%3D%2242%22%20height%3D%22239%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22595%22%20y%3D%22145%22%20width%3D%2259%22%20height%3D%22115%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22657%22%20y%3D%22154%22%20width%3D%2272%22%20height%3D%22106%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22738%22%20y%3D%2233%22%20width%3D%2279%22%20height%3D%22227%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22824%22%20y%3D%2220%22%20width%3D%2265%22%20height%3D%22240%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22896%22%20y%3D%22106%22%20width%3D%2255%22%20height%3D%22154%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%22956%22%20y%3D%2222%22%20width%3D%2241%22%20height%3D%22238%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%221006%22%20y%3D%2255%22%20width%3D%2257%22%20height%3D%22205%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%221066%22%20y%3D%2238%22%20width%3D%2243%22%20height%3D%22222%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%221116%22%20y%3D%2244%22%20width%3D%2245%22%20height%3D%22216%22%20fill%3D%22%231b2140%22/%3E%3Crect%20x%3D%221164%22%20y%3D%2227%22%20width%3D%2284%22%20height%3D%22233%22%20fill%3D%22%231b2140%22/%3E%3C/svg%3E"); animation-duration: 60s; opacity: .9; }
|
| 474 |
+
.ld-city.near { height: 200px; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%221200%22%20height%3D%22200%22%20viewBox%3D%220%200%201200%20200%22%3E%3Crect%20x%3D%220%22%20y%3D%2230%22%20width%3D%2264%22%20height%3D%22170%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%2242%22%20y%3D%2238%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2215%22%20y%3D%2249%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2224%22%20y%3D%2249%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2215%22%20y%3D%2271%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2224%22%20y%3D%2271%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2215%22%20y%3D%2282%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%226%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2242%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%226%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2215%22%20y%3D%22115%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2233%22%20y%3D%22115%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%226%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2215%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2224%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2233%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%226%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2224%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2242%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2251%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%226%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%226%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2215%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2224%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%226%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2215%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2224%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2242%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2251%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2215%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2242%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2224%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2233%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2251%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2268%22%20y%3D%2260%22%20width%3D%2283%22%20height%3D%22140%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%2274%22%20y%3D%2268%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22110%22%20y%3D%2268%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22128%22%20y%3D%2268%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2274%22%20y%3D%2279%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22119%22%20y%3D%2279%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2283%22%20y%3D%2290%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22101%22%20y%3D%2290%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22119%22%20y%3D%2290%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22128%22%20y%3D%2290%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2274%22%20y%3D%22101%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2283%22%20y%3D%22101%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22128%22%20y%3D%22101%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2292%22%20y%3D%22112%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22101%22%20y%3D%22112%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22110%22%20y%3D%22112%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22128%22%20y%3D%22112%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22137%22%20y%3D%22112%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2283%22%20y%3D%22123%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22101%22%20y%3D%22123%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2274%22%20y%3D%22145%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2283%22%20y%3D%22145%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2283%22%20y%3D%22156%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2292%22%20y%3D%22156%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22101%22%20y%3D%22156%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22110%22%20y%3D%22156%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22119%22%20y%3D%22156%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%2292%22%20y%3D%22167%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22101%22%20y%3D%22167%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2274%22%20y%3D%22178%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%2292%22%20y%3D%22178%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22119%22%20y%3D%22178%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2274%22%20y%3D%22189%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%2283%22%20y%3D%22189%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22128%22%20y%3D%22189%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22137%22%20y%3D%22189%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22157%22%20y%3D%2234%22%20width%3D%2249%22%20height%3D%22166%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22181%22%20y%3D%2242%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22199%22%20y%3D%2242%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22163%22%20y%3D%2253%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22172%22%20y%3D%2253%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22181%22%20y%3D%2253%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22190%22%20y%3D%2253%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22199%22%20y%3D%2253%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22172%22%20y%3D%2264%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22181%22%20y%3D%2264%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22163%22%20y%3D%2275%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22172%22%20y%3D%2286%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22181%22%20y%3D%2286%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22190%22%20y%3D%2286%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22163%22%20y%3D%2297%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22172%22%20y%3D%2297%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22172%22%20y%3D%22108%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22190%22%20y%3D%22108%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22172%22%20y%3D%22119%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22199%22%20y%3D%22130%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22190%22%20y%3D%22141%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22190%22%20y%3D%22163%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22172%22%20y%3D%22174%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22181%22%20y%3D%22174%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22199%22%20y%3D%22174%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22181%22%20y%3D%22185%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22216%22%20y%3D%2254%22%20width%3D%2289%22%20height%3D%22146%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22249%22%20y%3D%2262%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22294%22%20y%3D%2262%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22240%22%20y%3D%2273%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22276%22%20y%3D%2273%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22231%22%20y%3D%2284%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22240%22%20y%3D%2284%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22258%22%20y%3D%2284%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22240%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22285%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22294%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22258%22%20y%3D%22106%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22285%22%20y%3D%22106%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22294%22%20y%3D%22106%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22222%22%20y%3D%22117%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22231%22%20y%3D%22117%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22258%22%20y%3D%22117%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22240%22%20y%3D%22128%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22267%22%20y%3D%22128%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22294%22%20y%3D%22128%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22249%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22276%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22285%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22294%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22231%22%20y%3D%22150%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22240%22%20y%3D%22150%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22249%22%20y%3D%22150%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22294%22%20y%3D%22150%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22231%22%20y%3D%22161%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22258%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22294%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22222%22%20y%3D%22183%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22249%22%20y%3D%22183%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22258%22%20y%3D%22183%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22315%22%20y%3D%2285%22%20width%3D%2258%22%20height%3D%22115%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22342%22%20y%3D%2267%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22339%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22348%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22339%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22357%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22348%22%20y%3D%22115%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22321%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22321%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22330%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22339%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22366%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22321%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22330%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22339%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22321%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22330%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22376%22%20y%3D%2284%22%20width%3D%2276%22%20height%3D%22116%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22382%22%20y%3D%2292%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22418%22%20y%3D%22103%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22445%22%20y%3D%22103%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22382%22%20y%3D%22114%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22409%22%20y%3D%22114%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22382%22%20y%3D%22125%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22400%22%20y%3D%22125%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22418%22%20y%3D%22125%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22382%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22391%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22409%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22427%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22445%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22391%22%20y%3D%22147%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22427%22%20y%3D%22147%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22400%22%20y%3D%22158%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22418%22%20y%3D%22158%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22436%22%20y%3D%22158%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22391%22%20y%3D%22169%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22418%22%20y%3D%22169%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22436%22%20y%3D%22169%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22391%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22400%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22409%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22436%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22445%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22391%22%20y%3D%22191%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22427%22%20y%3D%22191%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22445%22%20y%3D%22191%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22455%22%20y%3D%2237%22%20width%3D%2264%22%20height%3D%22163%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22506%22%20y%3D%2245%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22479%22%20y%3D%2267%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22488%22%20y%3D%2267%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22488%22%20y%3D%2278%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22497%22%20y%3D%2278%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22506%22%20y%3D%2289%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22479%22%20y%3D%22100%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22470%22%20y%3D%22111%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22488%22%20y%3D%22111%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22497%22%20y%3D%22111%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22461%22%20y%3D%22122%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22479%22%20y%3D%22122%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22506%22%20y%3D%22122%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22479%22%20y%3D%22133%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22497%22%20y%3D%22133%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22461%22%20y%3D%22144%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22470%22%20y%3D%22144%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22470%22%20y%3D%22155%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22479%22%20y%3D%22155%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22488%22%20y%3D%22155%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22497%22%20y%3D%22155%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22461%22%20y%3D%22166%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22479%22%20y%3D%22166%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22461%22%20y%3D%22188%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22526%22%20y%3D%22140%22%20width%3D%2290%22%20height%3D%2260%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22532%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22541%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22559%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22586%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22532%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22550%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22568%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22586%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22595%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22604%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22604%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22624%22%20y%3D%22113%22%20width%3D%2239%22%20height%3D%2287%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22639%22%20y%3D%22132%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22630%22%20y%3D%22143%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22639%22%20y%3D%22154%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22630%22%20y%3D%22165%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22648%22%20y%3D%22165%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22630%22%20y%3D%22176%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22648%22%20y%3D%22176%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22630%22%20y%3D%22187%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22648%22%20y%3D%22187%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22667%22%20y%3D%2295%22%20width%3D%2241%22%20height%3D%22105%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22103%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22700%22%20y%3D%22103%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22691%22%20y%3D%22114%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22125%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22691%22%20y%3D%22125%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22700%22%20y%3D%22136%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22673%22%20y%3D%22147%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22700%22%20y%3D%22147%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22158%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22169%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22691%22%20y%3D%22169%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22700%22%20y%3D%22180%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22673%22%20y%3D%22191%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22682%22%20y%3D%22191%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22714%22%20y%3D%2244%22%20width%3D%2257%22%20height%3D%22156%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22729%22%20y%3D%2252%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22747%22%20y%3D%2252%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22756%22%20y%3D%2263%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22729%22%20y%3D%2274%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22747%22%20y%3D%2274%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22756%22%20y%3D%2274%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22729%22%20y%3D%2285%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22738%22%20y%3D%2285%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22747%22%20y%3D%2296%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22756%22%20y%3D%22107%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22729%22%20y%3D%22118%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22756%22%20y%3D%22118%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22720%22%20y%3D%22129%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22738%22%20y%3D%22129%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22747%22%20y%3D%22129%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22738%22%20y%3D%22140%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22738%22%20y%3D%22151%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22747%22%20y%3D%22151%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22747%22%20y%3D%22162%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22756%22%20y%3D%22162%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22720%22%20y%3D%22173%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22738%22%20y%3D%22184%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22747%22%20y%3D%22184%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22781%22%20y%3D%2269%22%20width%3D%2240%22%20height%3D%22131%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22787%22%20y%3D%2277%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22787%22%20y%3D%2288%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22796%22%20y%3D%2288%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22805%22%20y%3D%2288%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22787%22%20y%3D%2299%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22805%22%20y%3D%2299%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22814%22%20y%3D%22110%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22796%22%20y%3D%22132%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22814%22%20y%3D%22132%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22787%22%20y%3D%22143%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22796%22%20y%3D%22143%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22805%22%20y%3D%22143%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22805%22%20y%3D%22154%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22805%22%20y%3D%22165%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22829%22%20y%3D%2285%22%20width%3D%2288%22%20height%3D%22115%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22871%22%20y%3D%2267%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22835%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22871%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22880%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22844%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22862%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22871%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22898%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22835%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22871%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22880%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22835%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22844%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22898%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22835%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22880%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22862%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22880%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22889%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22844%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22862%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22898%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22835%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22862%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22844%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22853%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22880%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22889%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22898%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22907%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22925%22%20y%3D%2268%22%20width%3D%2287%22%20height%3D%22132%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22966%22%20y%3D%2250%22%20width%3D%224%22%20height%3D%2218%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%22931%22%20y%3D%2276%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22940%22%20y%3D%2276%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22958%22%20y%3D%2276%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22976%22%20y%3D%2276%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221003%22%20y%3D%2276%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22931%22%20y%3D%2287%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22958%22%20y%3D%2298%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22967%22%20y%3D%2298%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22976%22%20y%3D%2298%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22994%22%20y%3D%2298%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22931%22%20y%3D%22109%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22967%22%20y%3D%22109%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22931%22%20y%3D%22120%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22994%22%20y%3D%22120%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22958%22%20y%3D%22131%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22967%22%20y%3D%22131%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22976%22%20y%3D%22131%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22976%22%20y%3D%22142%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22931%22%20y%3D%22153%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22976%22%20y%3D%22153%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%22994%22%20y%3D%22153%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22940%22%20y%3D%22164%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22958%22%20y%3D%22164%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22958%22%20y%3D%22175%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22976%22%20y%3D%22175%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%22985%22%20y%3D%22175%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%22949%22%20y%3D%22186%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221016%22%20y%3D%2230%22%20width%3D%2265%22%20height%3D%22170%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%221049%22%20y%3D%2238%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221058%22%20y%3D%2238%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221031%22%20y%3D%2260%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221040%22%20y%3D%2260%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221058%22%20y%3D%2260%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221022%22%20y%3D%2271%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221022%22%20y%3D%2282%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221040%22%20y%3D%2282%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221049%22%20y%3D%2282%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221022%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221067%22%20y%3D%2293%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221040%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221049%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221067%22%20y%3D%22104%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221067%22%20y%3D%22115%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221067%22%20y%3D%22126%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221058%22%20y%3D%22137%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221040%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221049%22%20y%3D%22148%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221022%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221040%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221049%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221058%22%20y%3D%22159%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221022%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221031%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221049%22%20y%3D%22170%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221067%22%20y%3D%22181%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221022%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221040%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221058%22%20y%3D%22192%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221087%22%20y%3D%2248%22%20width%3D%2266%22%20height%3D%22152%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%221093%22%20y%3D%2256%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221102%22%20y%3D%2256%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221129%22%20y%3D%2256%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221129%22%20y%3D%2267%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221138%22%20y%3D%2278%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221120%22%20y%3D%2289%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221138%22%20y%3D%2289%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221111%22%20y%3D%22100%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221120%22%20y%3D%22100%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221138%22%20y%3D%22100%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221111%22%20y%3D%22111%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221102%22%20y%3D%22133%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221111%22%20y%3D%22133%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221093%22%20y%3D%22144%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221120%22%20y%3D%22144%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221129%22%20y%3D%22144%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221129%22%20y%3D%22166%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221102%22%20y%3D%22177%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221129%22%20y%3D%22177%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221111%22%20y%3D%22188%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221120%22%20y%3D%22188%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221138%22%20y%3D%22188%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221157%22%20y%3D%2287%22%20width%3D%2272%22%20height%3D%22113%22%20fill%3D%22%230c0f1c%22/%3E%3Crect%20x%3D%221163%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221190%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221208%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221217%22%20y%3D%2295%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221199%22%20y%3D%22106%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221190%22%20y%3D%22117%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221217%22%20y%3D%22117%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221181%22%20y%3D%22128%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221217%22%20y%3D%22128%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221163%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221172%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221199%22%20y%3D%22139%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221181%22%20y%3D%22150%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221172%22%20y%3D%22161%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221181%22%20y%3D%22161%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221190%22%20y%3D%22161%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3Crect%20x%3D%221217%22%20y%3D%22161%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221172%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221181%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221199%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.5%22/%3E%3Crect%20x%3D%221208%22%20y%3D%22172%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221172%22%20y%3D%22183%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.7%22/%3E%3Crect%20x%3D%221217%22%20y%3D%22183%22%20width%3D%224%22%20height%3D%225%22%20fill%3D%22%23ffcf7a%22%20opacity%3D%220.9%22/%3E%3C/svg%3E"); animation-duration: 26s; }
|
| 475 |
+
@keyframes ldScroll { to { background-position: -1200px 100%; } }
|
| 476 |
+
.ld-road { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(#17171c, #0b0b0e 40%, #050506); border-top: 3px solid #2a2a30; }
|
| 477 |
+
.ld-dash { position: absolute; left: 0; right: 0; top: 34%; height: 5px; background: repeating-linear-gradient(90deg, #ffd23d 0 52px, transparent 52px 120px); animation: ldDash .45s linear infinite; opacity: .9; }
|
| 478 |
+
@keyframes ldDash { to { background-position: -120px 0; } }
|
| 479 |
+
.ld-run { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
|
| 480 |
+
.ld-run i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c1121f, #ff4a5a); box-shadow: 0 0 12px #ff2a3a; transition: width .25s ease; }
|
| 481 |
+
.ld-car { position: absolute; bottom: calc(30% - 34px); width: min(300px, 58vw); left: calc(4% + (92% - min(300px, 58vw)) * var(--p)); transition: left .35s ease; animation: ldBob .32s ease-in-out infinite alternate; }
|
| 482 |
+
.ld-hydra { width: 100%; height: auto; display: block; overflow: visible; }
|
| 483 |
+
.ld-wh { transform-box: fill-box; transform-origin: center; animation: ldSpin .35s linear infinite; }
|
| 484 |
+
@keyframes ldSpin { to { transform: rotate(360deg); } }
|
| 485 |
+
@keyframes ldBob { to { transform: translateY(-1.5px); } }
|
| 486 |
+
.ld-tail { filter: drop-shadow(0 0 6px #ff2a3a); }
|
| 487 |
+
.ld-car .ld-pct { position: absolute; left: 0; right: 0; top: -26px; text-align: center; font: 600 12px var(--wide); color: var(--mute); letter-spacing: .2em; }
|
| 488 |
+
@media (prefers-reduced-motion: reduce) { .ld-city, .ld-dash, .ld-wh, .ld-car { animation: none; } }
|
| 489 |
+
/* the first screen's three keys */
|
| 490 |
+
.keys3 { display: flex; justify-content: center; gap: 22px; margin: 18px 0 8px; }
|
| 491 |
+
.keys3 > div { display: grid; justify-items: center; gap: 8px; }
|
| 492 |
+
.keys3 em { font-style: normal; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
|
| 493 |
+
.keys3 kbd { min-width: 30px; padding: 6px 8px; font-size: 14px; } .keys3 kbd.wide { min-width: 64px; }
|
| 494 |
+
@media (pointer: coarse) { .key-only { display: none; } }
|
| 495 |
+
/* reset button (touch), score pops, contextual key hints */
|
| 496 |
+
.g-resetbtn { position: absolute; right: calc(var(--pad) + 62px); bottom: calc(150px + var(--bot, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.55); color: #fff; font-size: 22px; display: none; }
|
| 497 |
+
@media (pointer: coarse) { .g-resetbtn { display: block; } }
|
| 498 |
+
.g-pop { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); font: 900 clamp(22px, 4vw, 40px)/1 var(--wide); letter-spacing: .04em; color: #fff; text-shadow: 0 0 18px rgba(61,245,255,.7), 0 2px 0 #000; pointer-events: none; white-space: nowrap; opacity: 0; }
|
| 499 |
+
.g-pop.on { animation: gPop 1.1s cubic-bezier(.2,.8,.2,1); }
|
| 500 |
+
.g-pop.gold { text-shadow: 0 0 18px rgba(255,210,61,.8), 0 2px 0 #000; color: #ffe9a8; } .g-pop.hot { text-shadow: 0 0 20px rgba(255,80,40,.9), 0 2px 0 #000; color: #ffd6c8; }
|
| 501 |
+
@keyframes gPop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -64%) scale(.96); } }
|
| 502 |
+
.g-keyhint { position: absolute; left: 50%; bottom: calc(118px + var(--bot, 0px)); transform: translateX(-50%); padding: 9px 16px; border-radius: 12px; background: rgba(0,0,0,.72); border: 1px solid rgba(61,245,255,.45); font: 600 14px var(--body); color: #fff; pointer-events: none; animation: gKeyIn .35s ease; }
|
| 503 |
+
.g-keyhint kbd { margin: 0 3px; }
|
| 504 |
+
@keyframes gKeyIn { from { opacity: 0; transform: translate(-50%, 10px); } }
|
| 505 |
+
/* nitro bar: glows when full (ready for Overdrive), blue-white while in Overdrive */
|
| 506 |
+
.bar.nos.full i { box-shadow: 0 0 10px #3df5ff; } .bar.nos.od i { background: linear-gradient(90deg, #9ff3ff, #ffffff, #9ff3ff); box-shadow: 0 0 14px #9ff3ff; animation: odPulse .25s linear infinite alternate; }
|
| 507 |
+
@keyframes odPulse { to { filter: brightness(1.4); } }
|
static/world.js
CHANGED
|
@@ -230,7 +230,7 @@ export async function createWorld(canvas, COARSE) {
|
|
| 230 |
roadTex.wrapS = THREE.RepeatWrapping;
|
| 231 |
const roadMat = new THREE.MeshStandardMaterial({ map: roadTex, color: 0xb8bcc6, roughness: .85, metalness: 0, envMapIntensity: .25, side: THREE.DoubleSide });
|
| 232 |
const sideMat = new THREE.MeshStandardMaterial({ color: 0x111115, roughness: .5, metalness: .6, side: THREE.DoubleSide });
|
| 233 |
-
const edgeMat = new THREE.
|
| 234 |
ribbon(0, roadEnd, [-HW, 0], [HW, 0], roadMat);
|
| 235 |
ribbon(loopIn - 4, roadEnd, [-HW, -.4], [HW, -.4], sideMat);
|
| 236 |
for (const s of [-1, 1]) {
|
|
|
|
| 230 |
roadTex.wrapS = THREE.RepeatWrapping;
|
| 231 |
const roadMat = new THREE.MeshStandardMaterial({ map: roadTex, color: 0xb8bcc6, roughness: .85, metalness: 0, envMapIntensity: .25, side: THREE.DoubleSide });
|
| 232 |
const sideMat = new THREE.MeshStandardMaterial({ color: 0x111115, roughness: .5, metalness: .6, side: THREE.DoubleSide });
|
| 233 |
+
const edgeMat = new THREE.MeshStandardMaterial({ color: 0x8a8d94, roughness: .7, side: THREE.DoubleSide }); // matte: glowing edges read as stray lines of light down the street
|
| 234 |
ribbon(0, roadEnd, [-HW, 0], [HW, 0], roadMat);
|
| 235 |
ribbon(loopIn - 4, roadEnd, [-HW, -.4], [HW, -.4], sideMat);
|
| 236 |
for (const s of [-1, 1]) {
|