gitflarePublicPartly agent-ready40
neon-drift
Real-time multiplayer arcade racer on Cloudflare Workers and Durable Objects.
- LicenseApache-2.0
- LanguageJavaScript
- Last landed
3efe3daOct 23, 2026
Add the Apache-2.0 licence
3efe3daimport test from 'node:test';import assert from 'node:assert/strict';import { cameraTarget, createFx } from '../public/fx.js';import { createAudio } from '../public/audio.js'; test('camera look-ahead and zoom', () => { const o = {}; cameraTarget({ x: 0, y: 0, heading: 0, boost: 0 }, { warn: 0 }, 'playing', 1, o); assert.equal(Math.round(o.x), 120); const z0 = o.zoom; cameraTarget({ x: 0, y: 0, heading: 0, boost: 1 }, { warn: 1 }, 'playing', 1, o); assert.ok(o.zoom >= z0 * 0.85 - 1e-9 && o.zoom < z0); cameraTarget({ x: 0, y: 0, heading: 0, boost: 0 }, { warn: 0 }, 'countdown', 1, o); assert.ok(o.zoom > z0);});test('fx pool and rings', () => { const f = createFx(); assert.ok(f.count >= 800); f.burst(0, 0, 10, 80, 300); f.ring(0, 0, 10, 100, 0.5); f.update(0.1); assert.ok(f.rl[0] > 0); f.update(1); assert.ok(f.rl[0] <= 0);});test('audio mute without context is safe', () => { const a = createAudio(); a.setMuted(true); assert.equal(a.muted, true); a.play('crash'); a.engine(1);});