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.CYBERDOME THUNDERDOME is a chrome-edged monster-truck rally where five angular Cybertrucks slam through ramps, boulders and tire walls inside a floodlit stadium bowl packed with a roaring crowd.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>CYBERDOME THUNDERDOME</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
html,body{width:100%;height:100%;overflow:hidden;background:#0a0e14;font-family:monospace}
#c{width:100%;height:100%;display:block}
#hud{position:fixed;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:linear-gradient(180deg,rgba(0,0,0,.85),rgba(0,0,0,.35));color:#fff;z-index:10;pointer-events:none;flex-wrap:wrap;gap:8px}
#hud b{color:#00e5ff;letter-spacing:1px}
#hud span{font-size:13px}
#center{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.7);color:#fff;padding:6px 12px;border-radius:6px;font-size:12px;z-index:10;pointer-events:none;text-align:center}
#photo{position:fixed;inset:0;background:rgba(6,10,18,.88);display:none;align-items:center;justify-content:center;z-index:20;flex-direction:column;color:#fff;text-align:center}
#photo h1{font-size:42px;letter-spacing:4px;color:#00e5ff;text-shadow:0 0 18px #00e5ff}
#photo p{font-size:22px;margin-top:10px}
#photo small{margin-top:18px;opacity:.7}
#msg{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.85);color:#fff;padding:18px 22px;border:2px solid #00e5ff;border-radius:10px;display:none;z-index:15;text-align:center}
</style>
</head>
<body>
<div id="hud">
<span><b id="arena">CYBERDOME THUNDERDOME</b> — MONSTER RALLY</span>
<span>SCORE: <b id="score">0</b></span>
<span>CLOCK: <b id="clock">90</b>s</span>
<span style="opacity:.9">WASD / ARROWS drive • P photo</span>
</div>
<div id="center">RAM rivals to score! Hit ramps & debris • Don't get wrecked</div>
<div id="photo"><h1>CYBERDOME THUNDERDOME</h1><p>SCORE <span id="photoScore">0</span></p><small>PHOTO MODE — Press P to resume</small></div>
<div id="msg"></div>
<canvas id="c"></canvas>
<script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
<script>
(() => {
const ARENA_NAME="CYBERDOME THUNDERDOME";
const canvas=document.getElementById('c');
const scoreEl=document.getElementById('score');
const clockEl=document.getElementById('clock');
const photoEl=document.getElementById('photo');
const photoScore=document.getElementById('photoScore');
const msgEl=document.getElementById('msg');
let score=0;
let timeRemaining=90;
if(location.hash==="#demo"){score=5000;timeRemaining=20;}
let photoPaused=false;
let gameOver=false;
const scene=new THREE.Scene();
scene.background=new THREE.Color(0x0b1220);
scene.fog=new THREE.Fog(0x0b1220,70,180);
const renderer=new THREE.WebGLRenderer({canvas,antialias:true});
renderer.shadowMap.enabled=true;
renderer.setPixelRatio(Math.min(devicePixelRatio,1.8));
function resize(){renderer.setSize(innerWidth,innerHeight);camera.aspect=innerWidth/innerHeight;camera.updateProjectionMatrix();}
const camera=new THREE.PerspectiveCamera(72,innerWidth/innerHeight,0.1,500);
camera.position.set(0,22,-28);
window.addEventListener('resize',resize);
scene.add(new THREE.HemisphereLight(0xffffff,0x223344,1.1));
const dir=new THREE.DirectionalLight(0xffffff,1.2);
dir.position.set(30,45,20);dir.castShadow=true;dir.shadow.mapSize.set(1024,1024);
scene.add(dir);
scene.add(new THREE.PointLight(0x00e5ff,1.2,120,1.5).translateX(0).translateY(25).translateZ(0));
// floor
const floorGeo=new THREE.PlaneGeometry(110,110);
const floorMat=new THREE.MeshStandardMaterial({color:0x3a2f1e,roughness:.95});
const floor=new THREE.Mesh(floorGeo,floorMat);
floor.rotation.x=-Math.PI/2;floor.receiveShadow=true;scene.add(floor);
const grid=new THREE.GridHelper(110,22,0x554433,0x554433);grid.position.y=0.05;scene.add(grid);
// walls
const wallMat=new THREE.MeshStandardMaterial({color:0x1a2333});
function wall(x,z,w,d){const m=new THREE.Mesh(new THREE.BoxGeometry(w,6,d),wallMat);m.position.set(x,3,z);m.castShadow=true;m.receiveShadow=true;scene.add(m);}
wall(0,55,110,2);wall(0,-55,110,2);wall(55,0,2,110);wall(-55,0,2,110);
// stands
function stands(){
const mat=new THREE.MeshStandardMaterial({color:0x1e2a44});
const crowdColors=[0xff3b30,0x00e5ff,0xffd400,0xffffff,0x00ff88];
for(let side=0;side<4;side++){
for(let row=0;row<6;row++){
const h=1.2, y=6+row*1.4;
let w,d,x,z,rx=0,rz=0;
if(side<2){ // north/south
w=118; d=2.2; x=0; z=(side===0?58: -58) + (side===0? row*2.2 : -row*2.2);
} else {
w=2.2; d=118; x=(side===2?58:-58)+(side===2? row*2.2 : -row*2.2); z=0;
}
const bleacher=new THREE.Mesh(new THREE.BoxGeometry(w,d,h),mat);
bleacher.position.set(x,y,z);scene.add(bleacher);
// crowd on this row
const count= side<2? 28:28;
for(let i=0;i<count;i++){
const cx = side<2 ? -54 + i*4 + (Math.random()-.5)*1.2 : x + (Math.random()-.5)*1;
const cz = side<2 ? z + (Math.random()-.5)*0.8 : -54 + i*4 + (Math.random()-.5)*1.2;
const col=crowdColors[Math.floor(Math.random()*crowdColors.length)];
const man=new THREE.Mesh(new THREE.CapsuleGeometry(0.35,0.7,4,6),new THREE.MeshStandardMaterial({color:col}));
man.position.set(cx,y+0.9,cz);
man.scale.set(1,1,1);
// little head
const head=new THREE.Mesh(new THREE.SphereGeometry(0.28,6,6),new THREE.MeshStandardMaterial({color:0xffdbac}));
head.position.y=0.55;man.add(head);
// random cheer pose
man.rotation.y=Math.random()*Math.PI;
man.rotation.z=(Math.random()-.5)*0.3;
scene.add(man);
}
}
}
}
stands();
// obstacles - 3 distinct types
const obstacles=[];
function addRamp(x,z,rot){
const g=new THREE.Group();
const base=new THREE.Mesh(new THREE.BoxGeometry(10,1.2,6),new THREE.MeshStandardMaterial({color:0xd9a441}));
base.position.y=0.6;g.add(base);
const wedge=new THREE.Mesh(new THREE.BoxGeometry(10,1.5,6),new THREE.MeshStandardMaterial({color:0xff3b30}));
wedge.position.set(0,1.6,0);wedge.rotation.z=Math.PI*0.12;wedge.castShadow=true;g.add(wedge);
g.position.set(x,0,z);g.rotation.y=rot;scene.add(g);
obstacles.push({x,z,r:5.5,type:'ramp',mesh:g});
}
function addBoulders(x,z){
const g=new THREE.Group();
for(let i=0;i<4;i++){
const r=0.9+Math.random()*0.7;
const m=new THREE.Mesh(new THREE.DodecahedronGeometry(r,0),new THREE.MeshStandardMaterial({color:0x6b6b6b,flatShading:true}));
m.position.set((Math.random()-.5)*4, r, (Math.random()-.5)*4);m.castShadow=true;g.add(m);
}
g.position.set(x,0,z);scene.add(g);
obstacles.push({x,z,r:4.2,type:'boulder',mesh:g});
}
function addTires(x,z){
const g=new THREE.Group();
for(let i=0;i<3;i++)for(let j=0;j<2;j++){
const m=new THREE.Mesh(new THREE.TorusGeometry(1.1,0.35,8,14),new THREE.MeshStandardMaterial({color:0x111111}));
m.position.set(i*2.1-2.1,0.7+j*1.15,0);m.rotation.x=Math.PI/2;g.add(m);
}
const plank=new THREE.Mesh(new THREE.BoxGeometry(7,0.4,1.2),new THREE.MeshStandardMaterial({color:0x8b5a2b}));
plank.position.y=2.9;g.add(plank);
g.position.set(x,0,z);scene.add(g);
obstacles.push({x,z,r:4.5,type:'tires',mesh:g});
}
addRamp(-18,12,0.6);addRamp(20,-14,-0.9);addRamp(0,22,1.2);
addBoulders(-12,-18);addBoulders(16,16);addBoulders(-26,0);
addTires(26,6);addTires(-22,20);addTires(8,-24);
// trucks
function makeTruck(color, isPlayer){
const g=new THREE.Group();
// body - cybertruck angular
const body=new THREE.Mesh(new THREE.BoxGeometry(3.6,1.1,6.2),new THREE.MeshStandardMaterial({color,metalness:.35,roughness:.5}));
body.position.y=1.35;body.castShadow=true;g.add(body);
const cabin=new THREE.Mesh(new THREE.BoxGeometry(3.2,0.9,3.0),new THREE.MeshStandardMaterial({color:0x0f1720,metalness:.6,roughness:.3}));
cabin.position.set(0,2.15,-0.6);cabin.castShadow=true;g.add(cabin);
const windshield=new THREE.Mesh(new THREE.BoxGeometry(3.0,0.05,1.6),new THREE.MeshStandardMaterial({color:0x00e5ff,transparent:true,opacity:.85}));
windshield.position.set(0,2.05,0.9);windshield.rotation.x=0.9;g.add(windshield);
// light bar
const bar=new THREE.Mesh(new THREE.BoxGeometry(3.4,0.15,0.2),new THREE.MeshStandardMaterial({color:0xffffff,emissive:0xffffff,emissiveIntensity:.6}));
bar.position.set(0,1.6,3.05);g.add(bar);
// wheels
const wheelGeo=new THREE.CylinderGeometry(0.85,0.85,0.7,14);
const wheelMat=new THREE.MeshStandardMaterial({color:0x0a0a0a});
const wPos=[[-1.9,0.85,1.9],[1.9,0.85,1.9],[-1.9,0.85,-1.9],[1.9,0.85,-1.9]];
wPos.forEach(p=>{const w=new THREE.Mesh(wheelGeo,wheelMat);w.rotation.z=Math.PI/2;w.position.set(...p);w.castShadow=true;g.add(w);});
// flag for player
if(isPlayer){
const f=new THREE.Mesh(new THREE.BoxGeometry(0.1,1.2,0.7),new THREE.MeshStandardMaterial({color:0x00e5ff}));
f.position.set(0,2.9,-2.6);g.add(f);
}
scene.add(g);
return g;
}
const colors=[0xe8e8e8,0xff3b30,0x00e5ff,0xffd400,0x00ff88];
const trucks=[];
for(let i=0;i<5;i++){
const isPlayer=i===0;
const mesh=makeTruck(colors[i],isPlayer);
const ang=(i/5)*Math.PI*2;
const rad=18;
trucks.push({
mesh, isPlayer,
x: Math.cos(ang)*rad, z: Math.sin(ang)*rad,
vx:0, vz:0, ang: -ang+Math.PI/2,
speed:0, cooldown:0, wreck:0, targetAng:0,
aiPhase: Math.random()*Math.PI*2,
aiTarget:{x:0,z:0}, aiTimer:0
});
}
function updateTruckMesh(t){
t.mesh.position.set(t.x,0,t.z);
t.mesh.rotation.y=t.ang;
if(t.wreck>0){
t.mesh.rotation.z=Math.sin(t.wreck*12)*0.25*t.wreck;
t.mesh.position.y=Math.abs(Math.sin(t.wreck*10))*0.6*t.wreck;
} else t.mesh.position.y=0;
}
// input
const keys={};
addEventListener('keydown',e=>{
const k=e.key.toLowerCase();
keys[k]=true;
if(k==='p'){
photoPaused=!photoPaused;
photoEl.style.display=photoPaused?'flex':'none';
if(photoPaused) photoScore.textContent=score|0;
e.preventDefault();
}
});
addEventListener('keyup',e=>keys[e.key.toLowerCase()]=false);
// audio - simple WebAudio blip
let audioCtx=null;
function blip(f=220,d=0.12,v=0.2){
try{
if(!audioCtx) audioCtx=new (window.AudioContext||window.webkitAudioContext)();
if(audioCtx.state==='suspended') audioCtx.resume();
const o=audioCtx.createOscillator(),g=audioCtx.createGain();
o.type='square';o.frequency.value=f;g.gain.value=v;
o.connect(g);g.connect(audioCtx.destination);
o.start();g.gain.exponentialRampToValueAtTime(0.0001,audioCtx.currentTime+d);o.stop(audioCtx.currentTime+d);
}catch(e){}
}
// game loop
let last=performance.now();
let camYaw=0;
function showMsg(t){
msgEl.textContent=t;msgEl.style.display='block';
setTimeout(()=>msgEl.style.display='none',1800);
}
function update(dt){
if(gameOver) return;
dt=Math.min(dt,0.033);
timeRemaining-=dt;
if(timeRemaining<=0){timeRemaining=0;gameOver=true;showMsg('FINISH! Final Score: '+(score|0)+' — Refresh to restart');}
clockEl.textContent=Math.ceil(timeRemaining);
scoreEl.textContent=score|0;
// player control
const p=trucks[0];
const accel=22, turn=1.9, drag=0.98, maxS=19;
let thrust=0, steer=0;
if(keys['w']||keys['arrowup']) thrust+=1;
if(keys['s']||keys['arrowdown']) thrust-=0.7;
if(keys['a']||keys['arrowleft']) steer+=1;
if(keys['d']||keys['arrowright']) steer-=1;
// physics for player
const forwardX=Math.sin(p.ang), forwardZ=Math.cos(p.ang);
const curSpeed=Math.hypot(p.vx,p.vz);
if(thrust!==0){
p.vx+=forwardX*accel*thrust*dt;
p.vz+=forwardZ*accel*thrust*dt;
}
// steering only when moving
if(Math.abs(curSpeed)>0.6) p.ang+=steer*turn*dt * (curSpeed>0?1:-1) * Math.min(1,curSpeed/6);
// drag
p.vx*=drag; p.vz*=drag;
// clamp speed
let sp=Math.hypot(p.vx,p.vz);
if(sp>maxS){p.vx*=maxS/sp; p.vz*=maxS/sp;}
p.x+=p.vx*dt; p.z+=p.vz*dt;
// AI
for(let i=1;i<5;i++){
const t=trucks[i];
t.aiTimer-=dt;
if(t.aiTimer<=0){
t.aiTimer=1.2+Math.random()*1.8;
// 40% chase player, else random point, with separation bias
if(Math.random()<0.4){
t.aiTarget.x=p.x + (Math.random()-.5)*10;
t.aiTarget.z=p.z + (Math.random()-.5)*10;
} else {
t.aiTarget.x=(Math.random()-.5)*36;
t.aiTarget.z=(Math.random()-.5)*36;
}
}
// separation vector to avoid clumping
let sepX=0,sepZ=0;
for(let j=1;j<5;j++) if(j!==i){
const o=trucks[j];
const dx=t.x-o.x, dz=t.z-o.z, d=Math.hypot(dx,dz);
if(d<9 && d>0.1){ const f=(9-d)/9; sepX+=dx/d*f*3; sepZ+=dz/d*f*3; }
}
// also separate from player a bit
const dxp=t.x-p.x, dzp=t.z-p.z, dp=Math.hypot(dxp,dzp);
if(dp<7){ sepX+=dxp/dp*1.2; sepZ+=dzp/dp*1.2; }
const tx=t.aiTarget.x+sepX*2, tz=t.aiTarget.z+sepZ*2;
const want=Math.atan2(tx - t.x, tz - t.z);
let diff=want - t.ang;
while(diff>Math.PI) diff-=Math.PI*2;
while(diff<-Math.PI) diff+=Math.PI*2;
// different aggressiveness per truck
const turnRate=1.4 + i*0.15;
t.ang+=diff*turnRate*dt;
// speed varies per truck to break wall
const targetSpeed= 9 + i*1.6 + Math.sin(performance.now()*0.001 + t.aiPhase)*2;
const fX=Math.sin(t.ang), fZ=Math.cos(t.ang);
t.vx+=fX*14*dt;
t.vz+=fZ*14*dt;
t.vx*=0.985; t.vz*=0.985;
let s=Math.hypot(t.vx,t.vz);
if(s>targetSpeed){t.vx*=targetSpeed/s; t.vz*=targetSpeed/s;}
// add slight wobble
t.x+=t.vx*dt; t.z+=t.vz*dt;
// keep inside
if(t.cooldown>0) t.cooldown-=dt;
if(t.wreck>0) t.wreck-=dt;
}
if(p.cooldown>0) p.cooldown-=dt;
if(p.wreck>0) p.wreck-=dt;
// wall bounce
trucks.forEach(t=>{
if(t.x>52){t.x=52; t.vx*=-0.6; t.wreck=0.5;}
if(t.x<-52){t.x=-52; t.vx*=-0.6; t.wreck=0.5;}
if(t.z>52){t.z=52; t.vz*=-0.6; t.wreck=0.5;}
if(t.z<-52){t.z=-52; t.vz*=-0.6; t.wreck=0.5;}
});
// obstacle collisions
trucks.forEach(t=>{
obstacles.forEach(o=>{
const dx=t.x-o.x, dz=t.z-o.z, d=Math.hypot(dx,dz);
const rad=2.2+o.r*0.55;
if(d<rad){
const nx=dx/(d||1), nz=dz/(d||1);
const overlap=rad-d;
t.x+=nx*overlap; t.z+=nz*overlap;
const dot=t.vx*nx + t.vz*nz;
if(dot<0){ t.vx-=nx*dot*1.6; t.vz-=nz*dot*1.6; }
if(o.type==='ramp'){
t.vx+=nx*2; t.vz+=nz*2;
if(t.isPlayer && Math.abs(dot)>4) {score+=50; blip(500,0.08,0.15);}
} else {
t.wreck=0.4;
if(t.isPlayer && t.cooldown<=0){score+=25; t.cooldown=0.2; blip(180,0.12,0.2);}
}
}
});
});
// truck-truck collisions (circle)
for(let i=0;i<5;i++) for(let j=i+1;j<5;j++){
const a=trucks[i], b=trucks[j];
const dx=a.x-b.x, dz=a.z-b.z, d=Math.hypot(dx,dz);
const minD=4.4;
if(d<minD && d>0.01){
const nx=dx/d, nz=dz/d;
const overlap=(minD-d)/2;
a.x+=nx*overlap; a.z+=nz*overlap;
b.x-=nx*overlap; b.z-=nz*overlap;
// impulse
const rvx=a.vx-b.vx, rvz=a.vz-b.vz;
const velAlong=rvx*nx + rvz*nz;
if(velAlong<0){
const imp= -velAlong*0.9;
const speedImp=Math.abs(velAlong);
a.vx+=nx*imp*0.5; a.vz+=nz*imp*0.5;
b.vx-=nx*imp*0.5; b.vz-=nz*imp*0.5;
// scoring / wreck
const isPlayerInvolved=a.isPlayer||b.isPlayer;
if(isPlayerInvolved && speedImp>5){
const playerIsAttacker = a.isPlayer ? (velAlong<0 && (a.vx*nx+a.vz*nz) <0 ? false : true) : true;
// simpler: if player speed high, reward
const pSpeed=Math.hypot(p.vx,p.vz);
if(pSpeed>6){
score+= Math.floor(100 + speedImp*12);
blip(300+speedImp*20,0.18,0.25);
// wreck the other
const victim = a.isPlayer? b : a;
victim.wreck=0.7; victim.cooldown=0.5;
showMsg('SLAM! +'+Math.floor(100+speedImp*12));
} else {
p.wreck=0.5; blip(120,0.2,0.2);
}
} else if(speedImp>4){
a.wreck=0.35; b.wreck=0.35;
}
}
}
}
trucks.forEach(updateTruckMesh);
// camera chase player
const camDist=18, camH=11;
const targetX=p.x - Math.sin(p.ang)*camDist;
const targetZ=p.z - Math.cos(p.ang)*camDist;
camera.position.x += (targetX - camera.position.x)*0.06;
camera.position.z += (targetZ - camera.position.z)*0.06;
camera.position.y += (camH - camera.position.y)*0.06;
camera.lookAt(p.x,1.2,p.z);
}
function animate(now){
requestAnimationFrame(animate);
if(photoPaused){
renderer.render(scene,camera);
return;
}
const dt=(now-last)/1000; last=now;
if(!gameOver) update(dt);
renderer.render(scene,camera);
}
resize();
trucks.forEach(updateTruckMesh);
scoreEl.textContent=score|0;
clockEl.textContent=Math.ceil(timeRemaining);
last=performance.now();
animate(last);
})();
</script>
</body>
</html>
if(location.hash==="#demo"){score=5000;timeRemaining=20;} mutates the real score and timeRemaining variables before the loop starts, so the HUD, physics and win condition all run on the demo values — not a CSS overlay.P toggles photoPaused; when true the animate loop still calls renderer.render but returns before update(dt), so the physics step, AI steering and clock are fully stopped while the frozen frame stays visible until P again.d = hypot(dx,dz), if d < rA+rB I push apart by overlap, compute velAlong = (rv·n) along the contact normal n, and if velAlong < 0 apply an impulse imp = -velAlong*0.9 split between the pair, adding score/wreck when the player’s speed exceeds the threshold.