Skip to content

gitflarePublicPartly agent-ready40

orbit-duel

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

Add the Apache-2.0 licence0413e56
JavaScript15 lines437 B
/** @param {number} seed */export function createRng(seed) {  return {    state: seed >>> 0,    next() {      let t = (this.state = (this.state + 0x6d2b79f5) >>> 0);      t = Math.imul(t ^ (t >>> 15), t | 1);      t ^= t + Math.imul(t ^ (t >>> 7), t | 61);      return ((t ^ (t >>> 14)) >>> 0) / 4294967296;    },    int(n) { return Math.floor(this.next() * n); },    range(a, b) { return a + this.next() * (b - a); },  };}