prototype-server-vision: status bar shows identity (player A/B, gm) derived from hello.tokens
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,9 @@ const R = 20; // token radius, world px
|
||||
const s = newState();
|
||||
const bar = document.getElementById('bar')!;
|
||||
let conn = 'connecting';
|
||||
const status = () => (bar.textContent = `role=${s.role ?? '?'} conn=${conn} gseq=${s.gseq}${s.lastError ? ' err=' + s.lastError : ''}`);
|
||||
// identity from hello.tokens: a player owns only the token whose id is their slot ("A"/"B")
|
||||
const who = () => (s.role === 'player' ? `player ${s.owned[0] ?? '?'}` : s.role ?? '?');
|
||||
const status = () => (bar.textContent = `${who()} conn=${conn} gseq=${s.gseq}${s.lastError ? ' err=' + s.lastError : ''}`);
|
||||
|
||||
const app = new Application();
|
||||
await app.init({ resizeTo: window, background: 0x000000, antialias: true });
|
||||
|
||||
Reference in New Issue
Block a user