export async function frame_0(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 2 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 105px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(388, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.46;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_36(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
export async function frame_0(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 2 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 105px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(388, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.46;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_36(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
export async function frame_0(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 2 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 105px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(388, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.46;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_36(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 39px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(362, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.31;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_27(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 6 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 39px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(362, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.31;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_27(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 6 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;
let obs = obstaclesRef.current.map((o) => ({ ...o, y: o.y + dy })).filter((o) => o.y < h + 80);
carEl.style.transform = `translateX(calc(-50% + 39px))`;
if (rectsOverlap(o, carBox)) didHit = true;
return () => cancelAnimationFrame(raf);
if (document.visibilityState === "hidden") return;
while (scrollRampAccRef.current >= SCROLL_RAMP_INTERVAL_SEC) {
lateralRef.current = Math.max(-max, Math.min(max, lateralRef.current + latVel * dt));
useEffect(() => { void getCrashAudioCtx(ref)?.resume(); }, []);
const gridBlock = Math.random() < 0.48;
type Obstacle = { id: number; x: number; y: number };
lastTRef.current ??= performance.now();
scrollPxPerSecRef.current = Math.min(SCROLL_PX_PER_SEC_MAX, scrollPxPerSecRef.current + SCROLL_…
const hitLeft = carLeft + (CAR_W - CAR_HITBOX_W) / 2;
const dy = scrollPxPerSecRef.current * scrollMul * dt;
scrollPxPerSecRef.current = Math.min(362, 380);
document.addEventListener("keydown", onKeyDown);
marginNoiseOffsetRef.current += dy * 0.31;
}
const carBox = { x: hitLeft, y: carTop, w: CAR_HITBOX_W, h: CAR_HITBOX_H };
window.addEventListener("keyup", onKeyUp);
function snapXToGrid(x: number, cell: number) {
setMotionTick((k) => k + 1);
spawnAccRef.current += Math.min(0.064, Math.max(0, rawDt));
export async function frame_27(dt: number) {
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
lateralRef.current += latVel * dt;
return minX + Math.floor((x - minX) / cell) * cell;
});
// track 6 obstacles
const dt = obstaclesRef.current;
if (!didHit && spawnAccRef.current >= SPAWN_INTERVAL_SEC && obs.length < maxObstacles) {
keysRef.current = { left: false, right: false };
}
const span = innerRight - innerLeft - ow;
obstaclesRef.current = obs.filter((o) => o.y < h + 80);
if (pausedRef.current) return;
scrollRampAccRef.current += dt;