27:18Gemini 4 Hydrogen: Cheaper Tokens, More Expensive Answers?
Nov 13, 2026 · YouTube
18:40ERNIE 5.5 Flash Preview vs GLM 5.3 Flash: Baidu's new model is very impressive!
Nov 11, 2026 · YouTube
36:22Fable 5.2 robbing me blind, plus: Nex AGI's N2.6 vs GLM 5.3 Flash
Nov 11, 2026 · YouTube
14:03Gemini 4 Carbon: Can it handle my challenges? (First look with one-shot coding tests)
Nov 10, 2026 · YouTube
47:51Ranking major U.S. Open-Weights Models. (Where does Ripple 65B fit in?)
Nov 6, 2026 · YouTube
10:57"Crouton Alpha": the latest super-efficient coding model by Meta?
Nov 3, 2026 · YouTube
38:58Testing Particle-1: a post-trained DeepSeek V4.1 Flash specializing in coding and efficiency
Oct 28, 2026 · YouTube
22:14GPT-6.1 Terra Pro vs Terra: How Much Better Is Pro?
Oct 27, 2026 · YouTube
29:55Kimi K3.1 Pro Looked Incredible. Then I Kept Testing.
Oct 26, 2026 · YouTube
31:28Is this company reselling GPT Sol 6.1 at a loss (for non-agentic/text-only)?🤔 Is this sustainable?
Oct 20, 2026 · YouTube
17:58Nemotron 3.5 Super VL vs Opus 5.5: Testing NVIDIA’s new coding juggernaut
Oct 15, 2026 · YouTube
16:04Testing a *massive* new open-weights model 🤯: Muse Spark Open (vs. Nemotron, Opus 5.5, and more)
Oct 15, 2026 · YouTube
16:43Gemini 4 Argon: Great 🐈 Animation, but a broken escalator. (Coding challenge vs Opus 5.5, Sol 6.1)
Oct 13, 2026 · YouTube
16:37Meta's new "Muse Wonder" AI is impressive... but can it compete with Anthropic's models?
Oct 12, 2026 · YouTube
11:12WOW... Haiku 5.5 is very impressive. RIP OpenAI?
Oct 7, 2026 · YouTube
22:47Mistral Large 4 Is Cheap. But Is It Good Enough to Compete?
Oct 6, 2026 · YouTube
22:02Is Pareto 26.10 Preview Just Routing to GPT Sol? I Tested It Against Sol 6.1 Pro
Oct 1, 2026 · YouTube
11:22I Tested Sonnet 5.5 Against Opus 5.5. Is It Actually Cheaper?
Sep 28, 2026 · YouTube
30:00Did Elon Musk's team "train the gay away"... and make Grok 4.7 worse?
Sep 26, 2026 · YouTube
10:58So... how much better is Claude Opus 5.5 vs. GPT-6 Sol, really?
Sep 23, 2026 · YouTube
9:38Claude Opus 5.5... the BEST new model for coding!! 🤩
Sep 22, 2026 · YouTube
29:00Grok 4.7: improved, but GLM 5.3 FlashX beat it anyway (benchmark against Gemini, Sol, etc.)
Sep 22, 2026 · YouTube
16:54Stealth Union Alpha: Is this another cheap GPT model? (better than Luna, cheaper than Terra?)
Sep 16, 2026 · YouTube
16:45DeepSeek V4.1 Flash Is Shockingly Good for the Price
Sep 10, 2026 · YouTube
17:14How much better is GPT-6 Astra over Claude Opus 5? Real Website and Coding Tests
Sep 5, 2026 · YouTube
29:13Implementing a multiplayer game with GPT-6 Astra (+ Gemini 3.8, Opus 5, Sol Pro)
Sep 5, 2026 · YouTube
19:42Meta Muse Spark 1.3 Review: A Huge Leap Forward
Sep 2, 2026 · YouTube
17:31Testing Gemini 3.8 Flash on Real Coding Challenges (vs. other models)
Sep 2, 2026 · YouTube
19:45Fable 5.1 writes an animated novel using Ren'Py... did it do better than Sol Pro 5.6?
Sep 1, 2026 · YouTube
14:09Testing IBM Granite-4.2-8B! Can it name 100 women?
Aug 31, 2026 · YouTube
17:37Tencent Hy4 Preview Tested: Is It Really Better Than Kimi K3 and GLM 5.3?
Aug 28, 2026 · YouTube
23:58Qwen 3.8 Flash Tested: UI, Coding, Physics & more - compared to Opus 5, Sol Pro, Grok
Aug 27, 2026 · YouTube
You are a game developer who ships browser demos that have to work on the first click, in front of an audience, on someone else's laptop.
Build me a Tesla Cybertruck monster-truck rally as one self-contained HTML page. A fairly small stadium, a big crowd in the stands, artificial hills and debris across the floor, and trucks slamming into each other.
Then make it match the spec below exactly. The spec is the challenge; a great-looking rally that ignores it is a miss.
.html page. No build step. Saved to disk and double-clicked, it runs.localStorage, sessionStorage, cookies or indexedDB. It runs in a sandboxed frame where touching them throws.Both are checkable in ten seconds, which is why they are here.
#demo — if the page URL ends in #demo, the game starts with 20 seconds on the clock and the score already at 5000. This must run through the real game state, not a cosmetic overlay. Everything else behaves normally.P for photo mode — pressing P freezes the action and overlays the arena name and the current score, held until P is pressed again. The simulation stops; it does not keep playing behind the card.One sentence: the name of your rally and what it looks like.
Exactly one fenced html block containing the whole page and nothing else.
Exactly four bullets.
#demo sets, and why it is not an overlay.P is pressed — the render loop, the physics step, or both.Thunder Basin Stadium is a compact neon-lit monster-truck rally where five Cybertruck-style rigs brawl across hilly dirt, tire stacks, barriers, and debris while a full crowd rings the stands.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Thunder Basin Stadium</title>
<style>
html,body{margin:0;height:100%;overflow:hidden;background:#05070a;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#e8f0ff}
#hud{position:fixed;left:12px;top:12px;z-index:10;background:rgba(0,0,0,.48);padding:8px 12px;border-radius:8px;font-size:14px;line-height:1.45;backdrop-filter:blur(2px)}
#hud .name{font-weight:800;letter-spacing:.08em;color:#7df9ff}
#photo{position:fixed;inset:0;display:none;align-items:center;justify-content:center;flex-direction:column;background:rgba(0,0,0,.76);z-index:20;color:#fff;text-align:center}
#photo.show{display:flex}
#photo h1{font-size:clamp(2rem,8vw,5rem);margin:0;letter-spacing:.12em}
#photo p{font-size:clamp(1rem,3vw,2rem);margin:.6rem 0 0}
canvas{display:block}
</style>
</head>
<body>
<div id="hud">
<div class="name" id="arenaName">THUNDER BASIN STADIUM</div>
<div>Score: <span id="score">0</span></div>
<div>Time: <span id="time">90</span></div>
<div>WASD / Arrows drive · P photo mode</div>
</div>
<div id="photo"><h1 id="photoName"></h1><p>Score: <span id="photoScore"></span></p></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
const ARENA_NAME = "THUNDER BASIN STADIUM";
const isDemo = (location.hash === '#demo') || (location.href.endsWith('#demo'));
let score = isDemo ? 5000 : 0;
let timeLeft = isDemo ? 20 : 90;
let paused = false;
let running = true;
const keys = {up:false,down:false,left:false,right:false};
window.addEventListener('keydown', (e) => {
const k = e.key.toLowerCase();
if (k === 'p') { togglePhoto(); e.preventDefault(); return; }
if (k === 'arrowup' || k === 'w') keys.up = true;
if (k === 'arrowdown' || k === 's') keys.down = true;
if (k === 'arrowleft' || k === 'a') keys.left = true;
if (k === 'arrowright' || k === 'd') keys.right = true;
if (k.startsWith('arrow')) e.preventDefault();
});
window.addEventListener('keyup', (e) => {
const k = e.key.toLowerCase();
if (k === 'arrowup' || k === 'w') keys.up = false;
if (k === 'arrowdown' || k === 's') keys.down = false;
if (k === 'arrowleft' || k === 'a') keys.left = false;
if (k === 'arrowright' || k === 'd') keys.right = false;
});
function togglePhoto() {
paused = !paused;
const el = document.getElementById('photo');
if (paused) {
el.classList.add('show');
document.getElementById('photoName').textContent = ARENA_NAME;
document.getElementById('photoScore').textContent = score;
} else {
el.classList.remove('show');
}
}
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0a0f1f);
scene.fog = new THREE.Fog(0x0a0f1f, 45, 130);
const camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 300);
camera.position.set(0, 20, 30);
const renderer = new THREE.WebGLRenderer({antialias:true});
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.body.appendChild(renderer.domElement);
renderer.domElement.tabIndex = 0;
renderer.domElement.style.outline = 'none';
renderer.domElement.addEventListener('click', () => renderer.domElement.focus());
const ambient = new THREE.AmbientLight(0xffffff, 0.42);
scene.add(ambient);
const sun = new THREE.DirectionalLight(0xfff0cc, 1.05);
sun.position.set(24, 42, 12);
sun.castShadow = true;
sun.shadow.mapSize.set(1024,1024);
sun.shadow.camera.left = -40; sun.shadow.camera.right = 40;
sun.shadow.camera.top = 40; sun.shadow.camera.bottom = -40;
sun.shadow.camera.near = 1; sun.shadow.camera.far = 120;
scene.add(sun);
function terrainHeight(x,z) {
let h = 0;
h += 1.05*Math.exp(-((x-5)**2+(z+3)**2)/34);
h += 0.82*Math.exp(-((x+7)**2+(z-4)**2)/26);
h += 0.42*Math.sin(x*0.35)*Math.cos(z*0.28);
h += 0.22*Math.sin((x+z)*0.15);
if (h < 0) h = 0;
return h;
}
const groundGeo = new THREE.PlaneGeometry(72, 58, 100, 80);
groundGeo.rotateX(-Math.PI/2);
const gpos = groundGeo.attributes.position;
for (let i=0;i<gpos.count;i++) {
const x = gpos.getX(i);
const z = gpos.getZ(i);
gpos.setY(i, terrainHeight(x,z));
}
groundGeo.computeVertexNormals();
const ground = new THREE.Mesh(groundGeo, new THREE.MeshStandardMaterial({color:0x6a5338, roughness:0.96}));
ground.receiveShadow = true;
scene.add(ground);
for (let tier=0; tier<3; tier++) {
const r = 24 + tier*2.6;
const y = 1.1 + tier*1.05;
for (let i=0;i<22;i++) {
const a = i/22*Math.PI*2;
const x = r*Math.cos(a);
const z = r*0.78*Math.sin(a);
const seg = new THREE.Mesh(new THREE.BoxGeometry(5.2, 1.0, 4.0), new THREE.MeshStandardMaterial({color:0x3b404d, roughness:0.85}));
seg.position.set(x,y,z);
seg.rotation.y = a + Math.PI/2;
seg.castShadow = true;
seg.receiveShadow = true;
scene.add(seg);
}
}
const CROWD = 1800;
const crowdGeo = new THREE.BoxGeometry(0.28, 0.55, 0.28);
const crowdMat = new THREE.MeshStandardMaterial({color:0xffffff, roughness:0.85});
const crowd = new THREE.InstancedMesh(crowdGeo, crowdMat, CROWD);
const dummy = new THREE.Object3D();
for (let i=0;i<CROWD;i++) {
const a = Math.random()*Math.PI*2;
const r = 23 + Math.random()*8;
const x = r*Math.cos(a);
const z = r*0.78*Math.sin(a);
const tier = Math.floor(Math.random()*3);
const y = 1.35 + tier*1.05 + Math.random()*0.15;
dummy.position.set(x,y,z);
dummy.rotation.y = Math.random()*Math.PI*2;
const s = 0.8 + Math.random()*0.45;
dummy.scale.set(s,s,s);
dummy.updateMatrix();
crowd.setMatrixAt(i, dummy.matrix);
crowd.setColorAt(i, new THREE.Color().setHSL(Math.random(), 0.55, 0.45 + Math.random()*0.25));
}
crowd.instanceMatrix.needsUpdate = true;
crowd.instanceColor.needsUpdate = true;
scene.add(crowd);
const obstacles = [];
function placeObstacle(type, x, z, rot) {
const y = terrainHeight(x,z);
let mesh, radius, height;
if (type === 'barrier') {
mesh = new THREE.Mesh(new THREE.BoxGeometry(3.0, 1.0, 0.6), new THREE.MeshStandardMaterial({color:0x9aa0a6, roughness:0.6, metalness:0.2}));
radius = 1.75; height = 1.0;
} else if (type === 'debris') {
const g = new THREE.Group();
const mat = new THREE.MeshStandardMaterial({color:0x7b6a52, roughness:0.95});
for (let i=0;i<6;i++) {
const s = new THREE.Mesh(new THREE.DodecahedronGeometry(0.32 + Math.random()*0.22, 0), mat);
s.position.set((Math.random()-0.5)*1.3, 0.28 + Math.random()*0.45, (Math.random()-0.5)*1.3);
s.castShadow = true;
g.add(s);
}
mesh = g; radius = 1.35; height = 0.9;
} else if (type === 'tires') {
const g = new THREE.Group();
const mat = new THREE.MeshStandardMaterial({color:0x151515, roughness:0.9});
for (let i=0;i<4;i++) {
const c = new THREE.Mesh(new THREE.CylinderGeometry(0.45,0.45,0.35,12), mat);
c.rotation.z = Math.PI/2;
c.position.set((i%2)*0.55 - 0.27, 0.22 + i*0.3, Math.floor(i/2)*0.55 - 0.27);
c.castShadow = true;
g.add(c);
}
mesh = g; radius = 1.15; height = 1.25;
} else if (type === 'ramp') {
mesh = new THREE.Mesh(new THREE.BoxGeometry(3.6, 0.45, 2.3), new THREE.MeshStandardMaterial({color:0x55606b, roughness:0.7, metalness:0.15}));
radius = 2.05; height = 0.45;
}
mesh.position.set(x, y + height/2, z);
if (type === 'ramp') mesh.rotation.x = -0.34;
mesh.rotation.y = rot || 0;
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
obstacles.push({type, mesh, x, z, radius, destroyed:false});
}
for (let i=0;i<6;i++) {
const a = i/6*Math.PI*2;
placeObstacle('barrier', 12*Math.cos(a), 9*Math.sin(a), Math.atan2(9*Math.sin(a), 12*Math.cos(a)) + Math.PI/2);
}
for (let i=0;i<5;i++) {
const a = i/5*Math.PI*2 + 0.4;
placeObstacle('debris', 6.2*Math.cos(a), 4.8*Math.sin(a), Math.random()*Math.PI);
}
for (let i=0;i<6;i++) {
const a = i/6*Math.PI*2 + 0.2;
placeObstacle('tires', 15.5*Math.cos(a), 11.8*Math.sin(a), Math.random()*Math.PI);
}
for (let i=0;i<4;i++) {
const a = i/4*Math.PI*2 + 0.7;
placeObstacle('ramp', 9.5*Math.cos(a), 7.2*Math.sin(a), Math.random()*Math.PI);
}
function createTruck(color) {
const group = new THREE.Group();
const chassisMat = new THREE.MeshStandardMaterial({color, roughness:0.35, metalness:0.35, emissive:0x000000, emissiveIntensity:0});
const chassis = new THREE.Mesh(new THREE.BoxGeometry(2.35, 0.62, 4.1), chassisMat);
chassis.position.y = 0.55;
chassis.castShadow = true;
group.add(chassis);
const cabin = new THREE.Mesh(new THREE.BoxGeometry(1.95, 0.78, 1.75), new THREE.MeshStandardMaterial({color:0x1a1d24, roughness:0.5, metalness:0.2}));
cabin.position.set(0, 1.05, -0.55);
cabin.castShadow = true;
group.add(cabin);
const wheelGeo = new THREE.CylinderGeometry(0.46,0.46,0.34,12);
const wheelMat = new THREE.MeshStandardMaterial({color:0x0f0f0f, roughness:0.95});
const wheelPositions = [[-1.05,0.46,1.35],[1.05,0.46,1.35],[-1.05,0.46,-1.35],[1.05,0.46,-1.35]];
const wheels = [];
wheelPositions.forEach((p) => {
const w = new THREE.Mesh(wheelGeo, wheelMat);
w.rotation.z = Math.PI/2;
w.position.set(p[0],p[1],p[2]);
w.castShadow = true;
group.add(w);
wheels.push(w);
});
group.userData.wheels = wheels;
group.userData.chassis = chassis;
return group;
}
const truckColors = [0x1f7cff, 0xff3b30, 0xffcc00, 0x34c759, 0xff8c00];
const trucks = [];
for (let i=0;i<5;i++) {
const mesh = createTruck(truckColors[i]);
const a = i/5*Math.PI*2;
const r = 7 + (i%2)*3;
const x = r*Math.cos(a);
const z = r*Math.sin(a);
mesh.position.set(x, terrainHeight(x,z)+0.45, z);
scene.add(mesh);
trucks.push({
id:i,
isPlayer: i===0,
mesh,
x, z,
vx:0, vz:0,
angle: a + Math.PI,
angVel:0,
throttleInput:0,
steerInput:0,
health:100,
wrecked:false,
flash:0,
hitCooldown:0,
wheels: mesh.userData.wheels,
chassis: mesh.userData.chassis,
orbitR: 9 + i*2.1,
orbitA: a,
orbitSpeed: 0.32 + (i%3)*0.07
});
}
const particles = [];
function addSmoke(x,z) {
for (let i=0;i<10;i++) {
const m = new THREE.Mesh(new THREE.SphereGeometry(0.24,6,6), new THREE.MeshBasicMaterial({color:0x8a8a8a, transparent:true, opacity:0.7}));
m.position.set(x + (Math.random()-0.5)*1.6, 0.5, z + (Math.random()-0.5)*1.6);
scene.add(m);
particles.push({mesh:m, vx:(Math.random()-0.5)*2.2, vy:1.2+Math.random()*2.0, vz:(Math.random()-0.5)*2.2, life:1.6});
}
}
function wreckTruck(t) {
if (t.wrecked) return;
t.wrecked = true;
t.health = 0;
t.vx *= 0.15; t.vz *= 0.15; t.angVel = 0;
t.mesh.traverse((o) => {
if (o.isMesh && o.material) {
o.material = o.material.clone();
o.material.color.set(0x2a2a2a);
if (o.material.emissive) { o.material.emissive.set(0x330000); o.material.emissiveIntensity = 0.35; }
}
});
t.chassis = t.mesh.children[0];
addSmoke(t.x, t.z);
}
function normAngle(a) {
while (a > Math.PI) a -= Math.PI*2;
while (a < -Math.PI) a += Math.PI*2;
return a;
}
function updateAI(t, dt) {
if (t.wrecked) { t.throttleInput = 0; t.steerInput = 0; return; }
t.orbitA += t.orbitSpeed * dt;
let tx = t.orbitR * Math.cos(t.orbitA);
let tz = t.orbitR * 0.72 * Math.sin(t.orbitA);
let ax = 0, az = 0;
for (const other of trucks) {
if (other === t) continue;
const dx = t.x - other.x;
const dz = t.z - other.z;
const d = Math.hypot(dx,dz);
if (d > 0.01 && d < 5.0) {
const push = (5.0 - d) * 0.75;
ax += (dx/d)*push;
az += (dz/d)*push;
}
}
let nearest = 99;
for (const obs of obstacles) {
if (obs.destroyed) continue;
const dx = t.x - obs.x;
const dz = t.z - obs.z;
const d = Math.hypot(dx,dz);
if (d < nearest) nearest = d;
const avoidR = obs.radius + 2.6;
if (d > 0.01 && d < avoidR) {
const push = (avoidR - d) * 0.9;
ax += (dx/d)*push;
az += (dz/d)*push;
}
}
const bx = t.x/18, bz = t.z/14;
const br = Math.hypot(bx,bz);
if (br > 0.82) {
ax -= t.x * 0.08;
az -= t.z * 0.08;
}
const desiredX = tx + ax*2.2;
const desiredZ = tz + az*2.2;
const desiredAngle = Math.atan2(desiredZ - t.z, desiredX - t.x);
const diff = normAngle(desiredAngle - t.angle);
t.steerInput = Math.max(-1, Math.min(1, diff*1.9));
t.throttleInput = (nearest < 2.8) ? 0.35 : 0.82;
}
function updateTruck(t, dt) {
if (t.isPlayer && !t.wrecked) {
t.throttleInput = keys.up ? 1.0 : (keys.down ? -0.55 : 0);
t.steerInput = keys.left ? 1.0 : (keys.right ? -1.0 : 0);
}
if (!t.isPlayer) updateAI(t, dt);
if (t.wrecked) {
t.throttleInput = 0;
t.steerInput = 0;
}
let fx = Math.cos(t.angle);
let fz = Math.sin(t.angle);
let rx = -Math.sin(t.angle);
let rz = Math.cos(t.angle);
let fs = t.vx*fx + t.vz*fz;
let ls = t.vx*rx + t.vz*rz;
fs += t.throttleInput * 13 * dt;
fs *= 0.985;
ls *= 0.90;
t.angVel += t.steerInput * 2.3 * dt * (1 + Math.min(Math.abs(fs), 10)*0.06);
t.angVel *= 0.88;
t.angle += t.angVel * dt;
fx = Math.cos(t.angle); fz = Math.sin(t.angle);
rx = -Math.sin(t.angle); rz = Math.cos(t.angle);
t.vx = fx*fs + rx*ls;
t.vz = fz*fs + rz*ls;
t.x += t.vx*dt;
t.z += t.vz*dt;
const br = Math.hypot(t.x/18, t.z/14);
if (br > 0.985) {
const scale = 0.985/br;
t.x *= scale; t.z *= scale;
const nX = t.x/18, nZ = t.z/14;
const nL = Math.hypot(nX,nZ) || 1;
const nnX = nX/nL, nnZ = nZ/nL;
const vn = t.vx*nnX + t.vz*nnZ;
if (vn > 0) {
t.vx -= 1.5*vn*nnX;
t.vz -= 1.5*vn*nnZ;
}
}
const y = terrainHeight(t.x, t.z) + 0.45;
t.mesh.position.set(t.x, y, t.z);
t.mesh.rotation.y = t.angle;
const eps = 0.45;
const dhdx = (terrainHeight(t.x+eps,t.z)-terrainHeight(t.x-eps,t.z))/(2*eps);
const dhdz = (terrainHeight(t.x,t.z+eps)-terrainHeight(t.x,t.z-eps))/(2*eps);
t.mesh.rotation.x = -Math.atan(dhdz);
t.mesh.rotation.z = Math.atan(dhdx);
if (t.wrecked) t.mesh.rotation.z += 0.4;
const speed = Math.hypot(t.vx,t.vz);
for (const w of t.wheels) {
if (!t.wrecked) w.rotation.x += speed*dt*2.0;
}
t.hitCooldown = Math.max(0, t.hitCooldown - dt);
if (t.flash > 0) {
t.flash = Math.max(0, t.flash - dt);
if (t.chassis && t.chassis.material && t.chassis.material.emissive) {
t.chassis.material.emissiveIntensity = t.flash*3.2;
if (t.flash > 0) t.chassis.material.emissive.setHex(0xffffff);
}
} else if (t.chassis && t.chassis.material && t.chassis.material.emissive && !t.wrecked) {
t.chassis.material.emissiveIntensity = 0;
}
}
function handleCollisions() {
for (const t of trucks) {
for (const obs of obstacles) {
if (obs.destroyed) continue;
const dx = t.x - obs.x;
const dz = t.z - obs.z;
const d = Math.hypot(dx,dz);
const minD = 1.15 + obs.radius;
if (d > 0.001 && d < minD) {
const nx = dx/d, nz = dz/d;
const overlap = minD - d;
t.x += nx*overlap;
t.z += nz*overlap;
const vn = t.vx*nx + t.vz*nz;
if (vn < 0) {
t.vx -= (1+0.35)*vn*nx;
t.vz -= (1+0.35)*vn*nz;
}
if (!t.wrecked) t.flash = 0.2;
if (obs.type === 'debris' && Math.hypot(t.vx,t.vz) > 1.8 && running) {
obs.destroyed = true;
obs.mesh.visible = false;
score += 25;
}
}
}
}
for (let i=0;i<trucks.length;i++) {
for (let j=i+1;j<trucks.length;j++) {
const a = trucks[i], b = trucks[j];
const dx = b.x - a.x;
const dz = b.z - a.z;
const d = Math.hypot(dx,dz);
const minD = 2.3;
if (d > 0.001 && d < minD) {
const nx = dx/d, nz = dz/d;
const overlap = minD - d;
a.x -= nx*overlap*0.5;
a.z -= nz*overlap*0.5;
b.x += nx*overlap*0.5;
b.z += nz*overlap*0.5;
const rvx = b.vx - a.vx;
const rvz = b.vz - a.vz;
const rvn = rvx*nx + rvz*nz;
if (rvn < 0) {
const impulse = -(1+0.42)*rvn*0.5;
a.vx -= impulse*nx;
a.vz -= impulse*nz;
b.vx += impulse*nx;
b.vz += impulse*nz;
}
const relSpeed = Math.hypot(rvx,rvz);
if (!a.wrecked) a.flash = 0.18;
if (!b.wrecked) b.flash = 0.18;
if (relSpeed > 3.0 && running && a.hitCooldown <= 0 && b.hitCooldown <= 0) {
if (a.isPlayer && !b.isPlayer && !b.wrecked) {
b.health -= relSpeed*9;
if (b.health <= 0) wreckTruck(b);
score += 250;
}
if (b.isPlayer && !a.isPlayer && !a.wrecked) {
a.health -= relSpeed*9;
if (a.health <= 0) wreckTruck(a);
score += 250;
}
if (!a.isPlayer && !b.isPlayer) {
if (relSpeed > 4.5) {
if (!a.wrecked) { a.health -= relSpeed*6; if (a.health <= 0) wreckTruck(a); }
if (!b.wrecked) { b.health -= relSpeed*6; if (b.health <= 0) wreckTruck(b); }
}
}
a.hitCooldown = 0.8;
b.hitCooldown = 0.8;
}
}
}
}
}
function updateParticles(dt) {
for (let i=particles.length-1;i>=0;i--) {
const p = particles[i];
p.life -= dt;
if (p.life <= 0) {
scene.remove(p.mesh);
p.mesh.geometry.dispose();
p.mesh.material.dispose();
particles.splice(i,1);
continue;
}
p.mesh.position.x += p.vx*dt;
p.mesh.position.y += p.vy*dt;
p.mesh.position.z += p.vz*dt;
p.vy -= 1.8*dt;
p.mesh.material.opacity = Math.max(0, (p.life/1.6)*0.7);
const s = 1 + (1.6 - p.life)*0.9;
p.mesh.scale.set(s,s,s);
}
}
const scoreEl = document.getElementById('score');
const timeEl = document.getElementById('time');
const arenaEl = document.getElementById('arenaName');
arenaEl.textContent = ARENA_NAME;
document.getElementById('photoName').textContent = ARENA_NAME;
let lastTime = performance.now();
function loop(now) {
const dt = Math.min(0.033, (now - lastTime)/1000);
lastTime = now;
if (!paused) {
if (running) {
timeLeft -= dt;
if (timeLeft <= 0) {
timeLeft = 0;
running = false;
}
}
for (const t of trucks) updateTruck(t, dt);
handleCollisions();
updateParticles(dt);
}
const player = trucks[0];
const fx = Math.cos(player.angle);
const fz = Math.sin(player.angle);
const desiredX = player.x - fx*11;
const desiredY = terrainHeight(player.x,player.z) + 9;
const desiredZ = player.z - fz*11;
camera.position.x += (desiredX - camera.position.x)*0.08;
camera.position.y += (desiredY - camera.position.y)*0.08;
camera.position.z += (desiredZ - camera.position.z)*0.08;
camera.lookAt(player.x, terrainHeight(player.x,player.z)+1, player.z);
scoreEl.textContent = score;
timeEl.textContent = Math.ceil(timeLeft);
renderer.render(scene, camera);
requestAnimationFrame(loop);
}
requestAnimationFrame(loop);
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth/window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
</script>
</body>
</html>
#demo initializes the real variables score = 5000 and timeLeft = 20 before the simulation starts, so the countdown and scoring logic use those values directly rather than displaying a fake overlay.P sets paused = true, which skips the entire updateTruck, collision, particle, and clock-update block while still calling renderer.render, so the simulation genuinely stops behind the overlay.