Skip to content

3D engine that AI agents drive

1001 B
Raw Blame
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Crucible netcode sample</title>
<style>
  body { margin: 0; background: #0c0d10; display: grid; place-items: center; min-height: 100vh; }
  canvas { background: #14161a; }
</style>
</head>
<body>
<canvas id="game" width="480" height="480"></canvas>
<script type="module">
  import { startSample } from './netcode-sample.js';

  const query = new URLSearchParams(location.search);
  window.sampleReady = startSample({
    role: query.get('role') ?? 'host',
    transport: query.get('transport') ?? 'broadcast',
    relayPort: query.get('relayPort') ?? undefined,
    delayMilliseconds: Number(query.get('delay') ?? 0),
    snapshotEveryTicks: query.has('snap') ? Number(query.get('snap')) : undefined,
    interpolationDelaySeconds: query.has('interp') ? Number(query.get('interp')) : undefined,
    canvas: document.getElementById('game'),
  }).then(sample => { window.sample = sample; return sample; });
</script>
</body>
</html>