Skip to content

gitflarePublicPartly agent-ready40

orbit-duel

Real-time two-player orbital combat game on Cloudflare Workers and Durable Objects.

main
Add the Apache-2.0 licence0413e56
JavaScript16 lines723 B
import test from 'node:test';import assert from 'node:assert';import { createFx } from '../public/fx.js';import { createAudio } from '../public/audio.js';test('explode sets shake, hit-stop and flash for local', () => {  const fx = createFx(); fx.explode(0, 0, 20, true, 1);  assert.ok(fx.shake > 0); assert.equal(fx.hitStop, 2); assert.equal(fx.flash, 1);  fx.update(0.016); fx.update(0.016);});test('non-local explosion has no hit-stop', () => {  const fx = createFx(); fx.explode(0, 0, 20, false, 0.5); assert.equal(fx.hitStop, 0);});test('audio mute toggle works without context', () => {  const a = createAudio(); a.setMuted(true); assert.equal(a.isMuted(), true); a.play('fire'); a.thrust(true, 0.5);});