Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

docs(rpc): stop the module header advertising a lane that was pruned from the chain

nirholas2bae5d8c2a39
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4cdd6bd01..9ab511b13 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,17 +10,22 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Docs · Coin Wars** (`/docs/coin-wars`): How community-vs-community battles work on three.ws: the war portal in every coin world, the matchmaking key two communities meet under, the signed pairing the arena trusts, the Elo ladder recomputed from the battle ledger, and the /api/wars endpoint behind all of it.
- **Docs · Forge items into a /play world from a prompt** (`/docs/play-forge-in-world`): Describe an item in a coin's world, or attach a reference photo, and the free forge lane builds a real 3D model in about half a minute. It is armed for placement and, once placed, appears for everyone connected to that server and persists like any other build.
- **Docs · How /play stays safe, honest, and light** (`/docs/play-hardening`): The invariants that keep the Play world safe: untrusted names never become markup, a coin image cannot escape its CSS, a broken world link says so, a reconnect retires the peers who left, and everything the world loads gets freed. Each rule names the failure it prevents.
+- **Docs · Live events in the /play world** (`/docs/play-live-events`): How a scheduled event runs inside the $THREE world: one config file drives the countdown chip, the agenda drawer, the go-live moment, and a fireworks show every player sees identically without a single packet. Includes how to schedule, preview, and verify one.
- **/play tells you the truth when something fails, instead of showing green**: A handful of places in the coin worlds reported success no matter what the server actually said. A $THREE boutique purchase that failed verification showed the same green Unlocked toast as one that worked, and a token swap that reverted on-chain still said Bought. Both now check the real outcome and show the failure with a link to the transaction. Every server message the world sends back now carries an explicit success or failure flag, so store, bank, job and wardrobe panels style errors as errors rather than guessing from the wording. A refused wardrobe change clears its spinner and says why instead of spinning forever, the jobs board says Loading jobs rather than flashing There are no jobs before the first reply arrives, and the in-world price screen switches from a pulsing LIVE badge to STALE with the age of the data when its feed stops responding. (`/play`) `[fix, improvement]`
+- **A shared world link now says which world you are opening, from the first frame**: Open a link to a coin's world and the wait used to be anonymous: a generic COIN COMMUNITIES card and "Joining the community", with nothing to say whose town was loading, even though the link itself carried the name, the ticker and the artwork all along. The loading screen now reads them straight out of the link and shows them immediately, before any of the game code has arrived: the coin's artwork, its name and its ticker, and "Entering <name>". If the artwork cannot be fetched, a letter mark takes its place instead of a broken image, in the loading screen and in the world's own corner banner. The browser tab is named after the world too, so a link parked in a background tab is findable, and it goes back to normal when you return to the community list. Two other fixes to the same first minute: /play was asking for the site's typeface without ever loading it, so every word on the page was rendering in whatever the device had lying around, and the loading card could push its own progress bar off the bottom of a short laptop screen. Both are fixed. On phones, the Controls reference is reachable again after the welcome card is dismissed, and the arrow keys now walk your character instead of paging that card. (`/play`) `[improvement, fix]`
- **Coin Wars is now a door in your world, not a hidden game**: Every coin world's plaza has a war portal. Walk up and the board shows your community's real standing on the war ladder: its Elo rating, record, kill/death, and the last battles it fought. Press E and the portal checks you hold the coin, puts your community in line, and the moment another community queues you are both dropped into the same arena to fight it out. While a war involving your coin is running, the board turns into a live scoreboard with the round clock and a kill feed, so the plaza can watch without joining. When the battle ends the result comes home: it lands on the board, a win takes the board over for a moment, and walking back from the arena drops you in the same world you left rather than the lobby. Nothing polls while nobody is standing there. (`/play`) `[feature]`
- **Death, loot and driving in /play stop taking things you should have kept**: Looting a marker with a nearly full pack used to destroy everything that did not fit: the marker was cleared before the pack was checked, so a full backpack quietly ate the rest of your run. Loot now takes only what fits and leaves the remainder standing in the marker for another trip. Quitting on the death screen used to save you at zero health, so you came back walking but died to the next hit; you now always stand back up. A very large cash balance no longer wraps around to zero when it loads. Cars are held to their real top speed over real elapsed time rather than per network message, which closes a route that let a scripted client drive at ten times the speed limit and farm the delivery jobs. Kicking the plaza ball now requires standing next to it, and the store, boutique, character and jobs-board requests are rate limited like every other action, so one client can no longer slow a world down for the hundred people in it. (`/play`) `[fix, improvement]`
- **Every walker in a coin world is somebody you can meet and talk to**: The crowd strolling a /play plaza already wore real community avatars from the public gallery, and most of those avatars represent a registered three.ws agent with its own wallet and earned reputation. The world used to throw all of that away and render anonymous scenery. Now a walker keeps the identity of the avatar it wears: click a nameplate or tap a body and their profile opens with the live agent, trust score, wallet and holdings every other surface reads, plus a Talk 1-on-1 button that starts a real streamed conversation where they answer in character as themselves. While you talk they stop walking and turn to face you, then catch back up with the crowd when you leave. The townsfolk who run the paid counters are selectable from any distance too: up close they still open their counter, and from across the plaza their profile opens instead of nothing happening. Nothing is invented: a walker wearing the bundled default avatar, or one still on an onboarding placeholder name, carries no identity and is presented honestly as scenery with no nameplate and no profile. (`/play`) `[feature, improvement]`
- **Forge items straight into a /play world, from a prompt or a photo**: In any coin's world you can now describe an item and have it built for real, right there. Open build mode, click Forge in the props palette, and type something like a mossy stone lantern with a copper roof, or attach a reference photo and let it work from that. About half a minute later the finished 3D model is added to your props and armed, so the next click drops it into the world. There is a chat shortcut too: type /forge a brass telescope and the item lands ready to place without opening the palette at all. Anything you place appears for everyone else connected to that server and stays there, exactly like a block you built by hand. It is free, needs no account or wallet, and every failure explains itself and can be retried. (`/play`) `[feature, improvement]`
+- **Forge items straight into a /play world, from a prompt or a photo**: You can now create a brand-new 3D item without leaving a world. Open the build palette, click Forge, and describe what you want ("a mossy stone lantern with a copper roof"), or attach a reference photo and let it build the thing in the picture. About half a minute later the finished model is armed in your props, and one click drops it into the world for everyone connected to that server: it renders for every other player, and it is saved with the rest of the build, so it is still standing when people come back. There is also a chat shortcut, /forge a brass telescope, for when you do not want to open the palette at all. It is free, it needs no account or wallet, and every failure along the way (a busy queue, a prompt the lane refuses, a dropped connection) tells you what happened and how to retry. (`/play`) `[feature, improvement]`
- **One link to share for the live event, with a real headcount**: three.ws/event is the front door for anyone who has never been in the world. It carries a ticking countdown, the run of show converted into your own timezone, an add-to-calendar file built in your browser (nothing about who is coming leaves your device), a plain-language walkthrough of what actually happens in there, and one big button into the world. It reads the same schedule file the countdown inside Play reads, so the two can never disagree. While the event is running the page shows how many people are standing in the world right now, read live from the game servers through a new public endpoint at /api/play/population. If that count cannot be reached the page says the doors are open and shows no number, rather than making one up. (`/event`) `[feature]`
- **Paid Solana calls stop failing when a free RPC provider blocks us**: The platform reads Solana through a chain of RPC providers so no single one going down can take a feature with it. One of those providers began refusing every request from our servers outright, and because it still sat near the front of the chain, each balance read, holder check, and payment burned requests on it before reaching a provider that would answer. Under load the whole chain could run out mid-request. The blocked provider is now removed, and the remaining ones are ordered by what they will actually serve rather than by how fast they reply, so wallet balances and $THREE holder gating stay readable when the paid capacity is spent. Two providers that quietly refuse balance lookups on the free tier no longer sit in front of the one that answers them. The image-understanding endpoint at /api/vision also now counts a slow upload against its own time budget instead of adding to it, so a large image returns a clear explanation rather than an unexplained timeout. `[fix, infra]`
- **Play is safer, lighter on phones, and honest when something breaks**: A deep audit of the Play world shipped a batch of fixes. A player can no longer put markup in their display name and have it run in everyone else's browser when they loot that player's tombstone, and a coin whose artwork link was crafted to escape its CSS can no longer paint anything over the lobby. Losing your connection now recovers cleanly: the peers who left while you were offline disappear instead of standing around frozen and inflating the headcount, and rejoining no longer strands you behind a "You died" screen in a world you are actually alive in. Phones hold up far better, because the world now genuinely frees what it loads: crowd and NPC models, the sun's shadow map, the totem, the jumbotron and the dance floor are all released when you leave a world instead of piling up until the tab is killed. The Wheel of Fortune finally looks like a modal instead of an unstyled block, tells you when it cannot reach the server and lets you retry, and if you close it mid-payment the spin still settles and shows you what you won rather than silently swallowing a paid spin. The jobs board says it is loading instead of claiming there is no work, a very long coin symbol can no longer run over the LIVE badge on the market screen, and a broken world link now says so and leaves you in the lobby instead of building a convincing world nobody else can join. (`/play`) `[fix, security, improvement]`
- **Rejoining a world after a dropped connection no longer leaves ghosts behind**: If your connection dropped inside a coin world and came back, the people around you could end up duplicated: a frozen copy of everyone standing where they were when you dropped, plus their live selves, and a motionless copy of you standing at the spawn point on everyone else's screen. Reconnecting now rebuilds the crowd from what the world server actually holds, retires anyone who left while you were away, and tells the server to retire your old session the moment you return. Standing still through a drop no longer strands you at the spawn point either, and a tab you left in the background for a few minutes now checks its connection the instant you come back instead of sitting on a dead one that still claims to be connected. Nameplates past sixty metres stop being drawn, so a plaza with a hundred people in it costs what the people near you cost. (`/play`) `[fix, improvement]`
- **The /play lobby and world stop leaking, and work on a phone**: Entering and leaving coin worlds repeatedly used to leave the previous world behind: peers were duplicated on every reconnect, mobs and vehicles could vanish for an entire session if your avatar loaded slowly, and cancelling the holders gate left an invisible dialog trapping your keyboard until you reloaded. Those are fixed, along with a set of memory leaks that piled up every time you hopped worlds. On touch devices the Enter community button on each lobby card was invisible, because it only appeared on mouse hover; it is now always visible on phones and when tabbing with a keyboard. The three contextual action buttons that could stack exactly on top of each other now each have their own row, so standing near the wheel and a gather node no longer hides one behind the other. Denying microphone access repeatedly no longer breaks voice for the rest of your session. (`/play`) `[fix, improvement]`
- **The meetup has its own jobs, and a live leaderboard to race on**: For the length of the live event, the /play jobs board carries four jobs you can only take while the doors are open: land a haul of fish for the plaza pit, drive the party supplies across town, clear four foes out of the Southern Wilds, and tour the three meetup landmarks. They pay better than the everyday board and they are all repeatable, because the point is the race. A new Event tab on the jobs board shows the standing: the top ten by jobs finished, tiebroken by the cash those jobs paid, with your own rank pinned at the bottom whether or not you made the cut. It updates as people finish runs, and it is the same ranking the event page reads, so the plaza and the web never disagree. When the window closes the jobs vanish from the board and the final standings stay readable. Winners are announced from that board and settled by us afterwards: nothing is paid out automatically. (`/play`) `[feature]`
+- **The store, the bank and the phone layout in Play got a polish pass**: Walking up to the general store or the bank used to show you the finished screen before the world had answered: an empty shelf that actually meant "still loading", and a cash balance of zero that actually meant "we haven't checked yet". Both now show placeholder rows while they wait, read your balances as unknown until the world reports them, and, if the world never answers, say so plainly with a Try again button instead of leaving a wrong screen up for good. Deposits and withdrawals hold a single request open at a time, so a double-tapped Deposit can no longer send the same transfer twice, and the amount is checked against what you are actually carrying before anything is sent. On a phone, the avatar row no longer pushes the Upload model button off the right edge of the screen where it could not be reached, the lobby search box responds to a tap anywhere in the bar rather than only on the one line of text inside it, and the footer links and the boot recovery screen now have thumb-sized targets and a visible keyboard focus ring. (`/play`) `[improvement, fix]`
+- **The trading engine now tells you when it is out of money**: The autonomous sniper could fail in a way nothing caught: the process healthy, the launch feed connected, every strategy armed, and every wallet too poor to actually pay for a trade. In that state it kept trying and failing to buy, closed nothing, and still reported itself as live, because everything being watched was about the software and nothing was about the money. Solvency is now part of how the engine reports itself. Every armed wallet balance is checked every five minutes against the exact rule the trader uses to decide whether it can afford an entry, so the status can never call a wallet ready when the trader would skip it. If no wallet can fund a trade, the engine now reports itself as out of SOL on the status page, in the health check and on the homepage, instead of showing green. It also says how much SOL would fix it and whether the funding wallet can cover that by itself, and it pages operators, with a separate alert for the case where the funding wallet is itself empty and a person has to step in. (`/trading`) `[fix, infra]`
- **The world economy pays what it says, and the bank makes you walk there**: An end-to-end pass over the /play money loops. The wheel now checks it has room for every prize it can award before it lets you spin, instead of just one of the three, so a stone win can no longer land in a pack that only had space for wood and quietly turn into two cash; if a pack does fill while you are approving a paid spin in your wallet, the prize converts to cash and the result tells you so in plain words. Store and bank buttons now disable while a trade is in flight, so a double-click can never buy twice, and if the world stops answering the panel says nothing was charged and re-reads your purse instead of leaving a stale balance on screen. Dying reports itself honestly: the HUD empties the moment the tombstone drops rather than eight seconds later at respawn, and the message names what you lost and what the bank protected. Trading and banking are now walk-up actions the server enforces, like fishing and the wheel already were, which is what makes depositing before a fight a real decision. The skills panel shows the XP left to each next level and what the next unlock is, the wheel links its full published paytable, and a boutique purchase that runs out of $THREE now says where to get more. (`/play/economy`) `[fix, improvement]`
- **The world knows when the meetup is, and throws fireworks when it starts**: Until now a scheduled event in the $THREE world was only a line on a page: you had to remember the time, and once you were in the plaza nothing told you what was happening or what came next. The world now runs the event itself. A countdown sits at the top of the screen from a day out and turns into a LIVE marker at the start, always showing how long until the next thing on the schedule. Tap it for the full running order: what just finished, what is on right now, and when each remaining item starts in your own timezone, alongside the live $THREE price and a one-tap way to buy or take a commemorative photo. Every time the schedule moves on, the plaza says so with a banner. And when the event goes live, fireworks go up over the town. They are not decoration bolted onto one machine: every player watching sees the same shells in the same places at the same moment, worked out from the clock rather than sent over the network, so the show holds together no matter how many people are in the plaza or how good their connection is. The finale builds into a proper barrage. If none of this is scheduled, the world looks exactly as it always did. (`/play`) `[feature]`
- **The world stops crying wolf: ad blockers and flaky wifi no longer fake a broken /play**: If an ad blocker or privacy extension ate one of the optional page scripts, or a background request failed on venue wifi, /play could cover a world that was loading perfectly well with a full-screen "Couldn’t load the world" card. The loading watchdog now only fires for the failure it was built for, a genuinely missing app file after a deploy, and gives a slow but healthy boot time to finish instead. A shared world link is also handled more carefully now: the coin name and symbol in it are stripped of line breaks and hidden characters and cut to a sane length so nobody can rearrange your screen with a link, and an image address that is not really an image is dropped instead of loading a dead tile. Finally, every screen of the holders-only door now offers a way into the coin’s open world, so a check you cannot pass or complete is never a dead end. (`/play`) `[fix, improvement]`
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index c634a2760..7a73e3344 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -11,15 +11,17 @@
//
// Priority (per network): the caller's explicit url (if any) → Helius → Alchemy
// → dRPC (authenticated) → Ankr (authenticated only) → operator-supplied
-// SOLANA_RPC_FALLBACK_URLS → PublicNode → Leo RPC (keyless FREE tier) → Tatum → the
-// official mainnet-beta endpoint, always last. We never depend on the
-// public endpoint alone — it is the most aggressively rate-limited (the source of
-// the `getBalance 429` log noise) — and we never include a keyless Ankr URL, which
-// Ankr now answers with a hard 403. The keyless tail (PublicNode + Leo RPC + Tatum
-// + MagicBlock + mainnet-beta) is what keeps checkout serving when a paid plan lapses:
-// all were verified serving live getLatestBlockhash/getAccountInfo on Solana
-// mainnet, so even with every API key dead the chain still resolves a working node
-// instead of erroring out.
+// SOLANA_RPC_FALLBACK_URLS → the keyless free tail. We never depend on the
+// public endpoint alone, it is the most aggressively rate-limited (the source of
+// the `getBalance 429` log noise), and we never include a keyless Ankr URL, which
+// Ankr now answers with a hard 403.
+//
+// The keyless tail is what keeps checkout serving when a paid plan lapses. Its
+// membership and ORDER are set by measured per-method capability, not latency:
+// see FREE_KEYLESS_MAINNET below and the table in docs/ops/solana-rpc-lanes.md.
+// Re-probe it when lanes start cooling persistently, because which methods a free
+// provider still serves changes without notice (MagicBlock was the recommended
+// primary until it began 403ing our egress on every method, 2026-08-07).
//
// To survive a single provider's quota running dry (e.g. a paid Helius plan
// exhausting its monthly requests), register free-tier keys at several providers
@@ -984,8 +986,20 @@ export function shouldRotate(status) {
// lane was cooling at once, and the treasury top-up cron turned that into a
// hard 500 while the wallet audit turned it into four fake below-floor
// emergencies. Neither was a code fault, and neither was a funding fact.
+//
+// `solana rpc provider error` is in the set because rotation does not always
+// get to report its own exhaustion. When the chain runs out, the LAST lane's
+// raw JSON-RPC error is what reaches the caller, not the tidy "all solana rpc
+// endpoints failed" summary: observed in production 2026-08-08, "failed to get
+// balance of account Wwwu...: Error: solana rpc provider error -16401 @
+// solana-mainnet.gateway.tatum.io", which took treasury-topup down with a 500
+// every few ticks. A named provider answering with its own error code is a lane
+// fault by construction (isProviderTierError already treats this very code as a
+// failover signal), so it is upstream weather, never a caller defect. Matching
+// the wrapper rather than any single vendor code keeps this true for the next
+// provider that invents one.
export function isTransientRpcError(err) {
- return /\b(429|500|502|503|504)\b|-32429|max usage reached|rate.?limit|quota|exhausted|timed?\s*out|fetch failed|socket hang up|ECONNRESET|ETIMEDOUT|ECONNREFUSED|EAI_AGAIN|all solana rpc endpoints failed|all rpc endpoints exhausted/i.test(
+ return /\b(429|500|502|503|504)\b|-32429|max usage reached|rate.?limit|quota|exhausted|timed?\s*out|fetch failed|socket hang up|ECONNRESET|ETIMEDOUT|ECONNREFUSED|EAI_AGAIN|all solana rpc endpoints failed|all rpc endpoints exhausted|solana rpc provider error/i.test(
String(err && err.message ? err.message : err),
);
}
diff --git a/api/sniper/status.js b/api/sniper/status.js
index bcee5c8ac..3f37af865 100644
--- a/api/sniper/status.js
+++ b/api/sniper/status.js
@@ -134,7 +134,7 @@ export default wrap(async (req, res) => {
// Money before mechanics: a worker that cannot fund an entry is not 'live', no
// matter how healthy its feed is. Absent (older worker build, first tick not
- // yet run) degrades to 'unknown', which never overrides the feed verdict (an
+ // yet run) degrades to 'unknown', which never overrides the feed verdict: an
// unmeasured fleet must not read as a broke one.
const solvency = meta.solvency && typeof meta.solvency === 'object' ? meta.solvency : null;
const state = deriveSniperState({
diff --git a/data/changelog.json b/data/changelog.json
index 97afbccb6..ab9387735 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,36 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-08-08",
+ "title": "The store, the bank and the phone layout in Play got a polish pass",
+ "summary": "Walking up to the general store or the bank used to show you the finished screen before the world had answered: an empty shelf that actually meant \"still loading\", and a cash balance of zero that actually meant \"we haven't checked yet\". Both now show placeholder rows while they wait, read your balances as unknown until the world reports them, and, if the world never answers, say so plainly with a Try again button instead of leaving a wrong screen up for good. Deposits and withdrawals hold a single request open at a time, so a double-tapped Deposit can no longer send the same transfer twice, and the amount is checked against what you are actually carrying before anything is sent. On a phone, the avatar row no longer pushes the Upload model button off the right edge of the screen where it could not be reached, the lobby search box responds to a tap anywhere in the bar rather than only on the one line of text inside it, and the footer links and the boot recovery screen now have thumb-sized targets and a visible keyboard focus ring.",
+ "tags": [
+ "improvement",
+ "fix"
+ ],
+ "link": "/play"
+ },
+ {
+ "date": "2026-08-08",
+ "title": "A shared world link now says which world you are opening, from the first frame",
+ "summary": "Open a link to a coin's world and the wait used to be anonymous: a generic COIN COMMUNITIES card and \"Joining the community\", with nothing to say whose town was loading, even though the link itself carried the name, the ticker and the artwork all along. The loading screen now reads them straight out of the link and shows them immediately, before any of the game code has arrived: the coin's artwork, its name and its ticker, and \"Entering <name>\". If the artwork cannot be fetched, a letter mark takes its place instead of a broken image, in the loading screen and in the world's own corner banner. The browser tab is named after the world too, so a link parked in a background tab is findable, and it goes back to normal when you return to the community list. Two other fixes to the same first minute: /play was asking for the site's typeface without ever loading it, so every word on the page was rendering in whatever the device had lying around, and the loading card could push its own progress bar off the bottom of a short laptop screen. Both are fixed. On phones, the Controls reference is reachable again after the welcome card is dismissed, and the arrow keys now walk your character instead of paging that card.",
+ "tags": [
+ "improvement",
+ "fix"
+ ],
+ "link": "/play"
+ },
+ {
+ "date": "2026-08-08",
+ "title": "The trading engine now tells you when it is out of money",
+ "summary": "The autonomous sniper could fail in a way nothing caught: the process healthy, the launch feed connected, every strategy armed, and every wallet too poor to actually pay for a trade. In that state it kept trying and failing to buy, closed nothing, and still reported itself as live, because everything being watched was about the software and nothing was about the money. Solvency is now part of how the engine reports itself. Every armed wallet balance is checked every five minutes against the exact rule the trader uses to decide whether it can afford an entry, so the status can never call a wallet ready when the trader would skip it. If no wallet can fund a trade, the engine now reports itself as out of SOL on the status page, in the health check and on the homepage, instead of showing green. It also says how much SOL would fix it and whether the funding wallet can cover that by itself, and it pages operators, with a separate alert for the case where the funding wallet is itself empty and a person has to step in.",
+ "tags": [
+ "fix",
+ "infra"
+ ],
+ "link": "/trading"
+ },
{
"date": "2026-08-08",
"title": "The world knows when the meetup is, and throws fireworks when it starts",
@@ -18702,6 +18732,16 @@
"improvement"
],
"link": "/play"
+ },
+ {
+ "date": "2026-08-08",
+ "title": "Forge items straight into a /play world, from a prompt or a photo",
+ "summary": "You can now create a brand-new 3D item without leaving a world. Open the build palette, click Forge, and describe what you want (\"a mossy stone lantern with a copper roof\"), or attach a reference photo and let it build the thing in the picture. About half a minute later the finished model is armed in your props, and one click drops it into the world for everyone connected to that server: it renders for every other player, and it is saved with the rest of the build, so it is still standing when people come back. There is also a chat shortcut, /forge a brass telescope, for when you do not want to open the palette at all. It is free, it needs no account or wallet, and every failure along the way (a busy queue, a prompt the lane refuses, a dropped connection) tells you what happened and how to retry.",
+ "tags": [
+ "feature",
+ "improvement"
+ ],
+ "link": "/play"
}
]
}
diff --git a/docs/avatar-inspector.md b/docs/avatar-inspector.md
index 8112ad814..dfc19c648 100644
--- a/docs/avatar-inspector.md
+++ b/docs/avatar-inspector.md
@@ -1,8 +1,8 @@
-# Avatar Inspector — who is this avatar, really?
+# Avatar Inspector, who is this avatar, really?
Every avatar you meet in a three.ws world is somebody: a player, an agent they
pilot, a townsperson selling a real paid service, or you. The avatar inspector
-is the one-keystroke answer to "who is this?" — press <kbd>I</kbd> (or select
+is the one-keystroke answer to "who is this?", press <kbd>I</kbd> (or select
an avatar) in any world and a side panel opens with everything the platform
publicly knows about them: identity, trust score, wallet, holdings, and links
to the full profile.
@@ -13,35 +13,35 @@ to the full profile.
| --- | --- | --- |
| `/play` (coin communities) | <kbd>I</kbd> nearest avatar · click a player's nameplate or body | Other players, townsperson NPCs, ambient citizens, yourself |
| `/temporary` coin worlds + `/marketplace-walk` | <kbd>I</kbd> nearest player · click a nameplate | Other players, yourself |
-| `/city` | <kbd>I</kbd> · click your avatar | Yourself (single-player) — add `?agent=<agent-id>` and the inspector shows that agent's reputation and wallet alongside your session |
-| `/agora` | <kbd>I</kbd> hovered/nearest citizen · click a citizen | Citizens — opens their existing [passport](/agora) with trust grade, stake, and earnings |
-| `/play/arena` | click an agent's floor label | Live trading agents — opens the agent detail drawer (predates the inspector) |
+| `/city` | <kbd>I</kbd> · click your avatar | Yourself (single-player), add `?agent=<agent-id>` and the inspector shows that agent's reputation and wallet alongside your session |
+| `/agora` | <kbd>I</kbd> hovered/nearest citizen · click a citizen | Citizens, opens their existing [passport](/agora) with trust grade, stake, and earnings |
+| `/play/arena` | click an agent's floor label | Live trading agents, opens the agent detail drawer (predates the inspector) |
-Pressing <kbd>I</kbd> again — or <kbd>Esc</kbd> — closes the panel. It is
+Pressing <kbd>I</kbd> again, or <kbd>Esc</kbd>, closes the panel. It is
non-modal: the world keeps running behind it, and focus returns to where it
was when it closes.
## What it shows
-All data is real and server-authoritative — the same public endpoints every
+All data is real and server-authoritative, the same public endpoints every
other surface reads, so a number never disagrees across the platform:
-- **Identity** — display name, the three.ws agent the avatar pilots (with a
+- **Identity**, display name, the three.ws agent the avatar pilots (with a
link to `/agent/<id>`), its bio, skills, creator, and ERC-8004 registration.
From `GET /api/agents/:id`.
-- **Reputation** — the 0–100 trust score with its full pillar breakdown
+- **Reputation**, the 0, 100 trust score with its full pillar breakdown
(tenure, settled volume, tips, reliability, conduct, …) and verifiable
evidence links. Rendered by the same shared component as the wallet hub.
From `GET /api/agents/:id/reputation`.
-- **Wallet** — the agent's self-custodial Solana address (copy + explorer),
+- **Wallet**, the agent's self-custodial Solana address (copy + explorer),
USD net worth, SOL balance, $THREE holding, top tokens, and tips received.
From `GET /api/agents/:id/solana/networth`. A player who signed in with a
wallet but pilots no agent gets bare balances from
`POST /api/wallet/balances`.
-- **World facts** — which world you met them in, an NPC's role and service,
+- **World facts**, which world you met them in, an NPC's role and service,
your live street location in `/city`.
-A guest with no wallet renders as exactly that — a designed empty state that
+A guest with no wallet renders as exactly that, a designed empty state that
says what's missing and how to get it. A real $0 balance shows $0. Nothing is
ever fabricated.
@@ -51,7 +51,7 @@ The ambient crowd strolling a `/play` plaza wears real community avatars from
the public gallery (`GET /api/avatars/public`), and most of those avatars
represent a registered three.ws agent. The world keeps that identity: any
walker wearing a named gallery avatar shows a nameplate, and clicking the
-nameplate or the body opens this same inspector as a **Citizen** card — the
+nameplate or the body opens this same inspector as a **Citizen** card, the
real agent's bio, trust score, and wallet, plus a **Talk 1-on-1** action that
starts a live, streamed, in-character conversation (the same multi-model chat
the townsperson NPCs use, grounded in the agent's actual public profile).
@@ -62,7 +62,7 @@ Interactive townsfolk (the vendors, quest-givers, and clerks) are selectable
from any distance too: tapped in range they run their role action as always;
tapped from afar their profile card opens with a Talk action instead of
nothing. Walkers wearing the bundled default avatar carry no identity and stay
-honest, anonymous scenery — no nameplate, no profile.
+honest, anonymous scenery, no nameplate, no profile.
The identity layer lives in [`src/game/npc/citizens.js`](../src/game/npc/citizens.js).
@@ -89,10 +89,10 @@ openAvatarInspector({
the panel. `isAvatarInspectorOpen()` and `closeAvatarInspector()` are also
exported. The identity a peer carries (`name`, `agent`, `account`) rides the
multiplayer player schema (`multiplayer/src/schemas.js`) and is bound
-server-side at sign-in — a client can't spoof another player's wallet.
+server-side at sign-in, a client can't spoof another player's wallet.
Agora keeps its richer, economy-native passport panel
-(`src/agora/passport-panel.js`) — the <kbd>I</kbd> key there opens the same
+(`src/agora/passport-panel.js`), the <kbd>I</kbd> key there opens the same
passport the click path always has.
Related reading: [agent reputation](agent-reputation.md) · [Agora](agora.md).
diff --git a/public/changelog.json b/public/changelog.json
index c0c64678d..43cc057e4 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-08T15:44:09.472Z",
+ "generated_at": "2026-08-08T16:18:10.751Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -46,6 +46,16 @@
"launch"
]
},
+ {
+ "date": "2026-08-08",
+ "type": "launch",
+ "title": "Docs · Live events in the /play world",
+ "summary": "How a scheduled event runs inside the $THREE world: one config file drives the countdown chip, the agenda drawer, the go-live moment, and a fireworks show every player sees identically without a single packet. Includes how to schedule, preview, and verify one.",
+ "link": "/docs/play-live-events",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-08-08",
"type": "update",
@@ -57,6 +67,17 @@
"improvement"
]
},
+ {
+ "date": "2026-08-08",
+ "type": "update",
+ "title": "A shared world link now says which world you are opening, from the first frame",
+ "summary": "Open a link to a coin's world and the wait used to be anonymous: a generic COIN COMMUNITIES card and \"Joining the community\", with nothing to say whose town was loading, even though the link itself carried the name, the ticker and the artwork all along. The loading screen now reads them straight out of the link and shows them immediately, before any of the game code has arrived: the coin's artwork, its name and its ticker, and \"Entering <name>\". If the artwork cannot be fetched, a letter mark takes its place instead of a broken image, in the loading screen and in the world's own corner banner. The browser tab is named after the world too, so a link parked in a background tab is findable, and it goes back to normal when you return to the community list. Two other fixes to the same first minute: /play was asking for the site's typeface without ever loading it, so every word on the page was rendering in whatever the device had lying around, and the loading card could push its own progress bar off the bottom of a short laptop screen. Both are fixed. On phones, the Controls reference is reachable again after the welcome card is dismissed, and the arrow keys now walk your character instead of paging that card.",
+ "link": "/play",
+ "tags": [
+ "improvement",
+ "fix"
+ ]
+ },
{
"date": "2026-08-08",
"type": "update",
@@ -100,6 +121,17 @@
"improvement"
]
},
+ {
+ "date": "2026-08-08",
+ "type": "update",
+ "title": "Forge items straight into a /play world, from a prompt or a photo",
+ "summary": "You can now create a brand-new 3D item without leaving a world. Open the build palette, click Forge, and describe what you want (\"a mossy stone lantern with a copper roof\"), or attach a reference photo and let it build the thing in the picture. About half a minute later the finished model is armed in your props, and one click drops it into the world for everyone connected to that server: it renders for every other player, and it is saved with the rest of the build, so it is still standing when people come back. There is also a chat shortcut, /forge a brass telescope, for when you do not want to open the palette at all. It is free, it needs no account or wallet, and every failure along the way (a busy queue, a prompt the lane refuses, a dropped connection) tells you what happened and how to retry.",
+ "link": "/play",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-08-08",
"type": "update",
@@ -165,6 +197,28 @@
"feature"
]
},
+ {
+ "date": "2026-08-08",
+ "type": "update",
+ "title": "The store, the bank and the phone layout in Play got a polish pass",
+ "summary": "Walking up to the general store or the bank used to show you the finished screen before the world had answered: an empty shelf that actually meant \"still loading\", and a cash balance of zero that actually meant \"we haven't checked yet\". Both now show placeholder rows while they wait, read your balances as unknown until the world reports them, and, if the world never answers, say so plainly with a Try again button instead of leaving a wrong screen up for good. Deposits and withdrawals hold a single request open at a time, so a double-tapped Deposit can no longer send the same transfer twice, and the amount is checked against what you are actually carrying before anything is sent. On a phone, the avatar row no longer pushes the Upload model button off the right edge of the screen where it could not be reached, the lobby search box responds to a tap anywhere in the bar rather than only on the one line of text inside it, and the footer links and the boot recovery screen now have thumb-sized targets and a visible keyboard focus ring.",
+ "link": "/play",
+ "tags": [
+ "improvement",
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-08-08",
+ "type": "update",
+ "title": "The trading engine now tells you when it is out of money",
+ "summary": "The autonomous sniper could fail in a way nothing caught: the process healthy, the launch feed connected, every strategy armed, and every wallet too poor to actually pay for a trade. In that state it kept trying and failing to buy, closed nothing, and still reported itself as live, because everything being watched was about the software and nothing was about the money. Solvency is now part of how the engine reports itself. Every armed wallet balance is checked every five minutes against the exact rule the trader uses to decide whether it can afford an entry, so the status can never call a wallet ready when the trader would skip it. If no wallet can fund a trade, the engine now reports itself as out of SOL on the status page, in the health check and on the homepage, instead of showing green. It also says how much SOL would fix it and whether the funding wallet can cover that by itself, and it pages operators, with a separate alert for the case where the funding wallet is itself empty and a person has to step in.",
+ "link": "/trading",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-08-08",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index d2c134b5c..85626071b 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -38,6 +38,14 @@
<category>launch</category>
<description>The invariants that keep the Play world safe: untrusted names never become markup, a coin image cannot escape its CSS, a broken world link says so, a reconnect retires the peers who left, and everything the world loads gets freed. Each rule names the failure it prevents.</description>
</item>
+ <item>
+ <title>Docs · Live events in the /play world</title>
+ <link>https://three.ws/docs/play-live-events</link>
+ <guid isPermaLink="false">2026-08-08:Docs · Live events in the /play world</guid>
+ <pubDate>Sat, 08 Aug 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How a scheduled event runs inside the $THREE world: one config file drives the countdown chip, the agenda drawer, the go-live moment, and a fireworks show every player sees identically without a single packet. Includes how to schedule, preview, and verify one.</description>
+ </item>
<item>
<title>/play tells you the truth when something fails, instead of showing green</title>
<link>https://three.ws/play</link>
@@ -46,6 +54,14 @@
<category>fix</category>
<description>A handful of places in the coin worlds reported success no matter what the server actually said. A $THREE boutique purchase that failed verification showed the same green Unlocked toast as one that worked, and a token swap that reverted on-chain still said Bought. Both now check the real outcome and show the failure with a link to the transaction. Every server message the world sends back now carries an explicit success or failure flag, so store, bank, job and wardrobe panels style errors as errors rather than guessing from the wording. A refused wardrobe change clears its spinner and says why instead of spinning forever, the jobs board says Loading jobs rather than flashing There are no jobs before the first reply arrives, and the in-world price screen switches from a pulsing LIVE badge to STALE with the age of the data when its feed stops responding.</description>
</item>
+ <item>
+ <title>A shared world link now says which world you are opening, from the first frame</title>
+ <link>https://three.ws/play</link>
+ <guid isPermaLink="false">2026-08-08:A shared world link now says which world you are opening, from the first frame</guid>
+ <pubDate>Sat, 08 Aug 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Open a link to a coin's world and the wait used to be anonymous: a generic COIN COMMUNITIES card and &quot;Joining the community&quot;, with nothing to say whose town was loading, even though the link itself carried the name, the ticker and the artwork all along. The loading screen now reads them straight out of the link and shows them immediately, before any of the game code has arrived: the coin's artwork, its name and its ticker, and &quot;Entering &lt;name&gt;&quot;. If the artwork cannot be fetched, a letter mark takes its place instead of a broken image, in the loading screen and in the world's own corner banner. The browser tab is named after the world too, so a link parked in a background tab is findable, and it goes back to normal when you return to the community list. Two other fixes to the same first minute: /play was asking for the site's typeface without ever loading it, so every word on the page was rendering in whatever the device had lying around, and the loading card could push its own progress bar off the bottom of a short laptop screen. Both are fixed. On phones, the Controls reference is reachable again after the welcome card is dismissed, and the arrow keys now walk your character instead of paging that card.</description>
+ </item>
<item>
<title>Coin Wars is now a door in your world, not a hidden game</title>
<link>https://three.ws/play</link>
@@ -78,6 +94,14 @@
<category>feature</category>
<description>In any coin's world you can now describe an item and have it built for real, right there. Open build mode, click Forge in the props palette, and type something like a mossy stone lantern with a copper roof, or attach a reference photo and let it work from that. About half a minute later the finished 3D model is added to your props and armed, so the next click drops it into the world. There is a chat shortcut too: type /forge a brass telescope and the item lands ready to place without opening the palette at all. Anything you place appears for everyone else connected to that server and stays there, exactly like a block you built by hand. It is free, needs no account or wallet, and every failure explains itself and can be retried.</description>
</item>
+ <item>
+ <title>Forge items straight into a /play world, from a prompt or a photo</title>
+ <link>https://three.ws/play</link>
+ <guid isPermaLink="false">2026-08-08:Forge items straight into a /play world, from a prompt or a photo</guid>
+ <pubDate>Sat, 08 Aug 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>You can now create a brand-new 3D item without leaving a world. Open the build palette, click Forge, and describe what you want (&quot;a mossy stone lantern with a copper roof&quot;), or attach a reference photo and let it build the thing in the picture. About half a minute later the finished model is armed in your props, and one click drops it into the world for everyone connected to that server: it renders for every other player, and it is saved with the rest of the build, so it is still standing when people come back. There is also a chat shortcut, /forge a brass telescope, for when you do not want to open the palette at all. It is free, it needs no account or wallet, and every failure along the way (a busy queue, a prompt the lane refuses, a dropped connection) tells you what happened and how to retry.</description>
+ </item>
<item>
<title>One link to share for the live event, with a real headcount</title>
<link>https://three.ws/event</link>
@@ -126,6 +150,22 @@
<category>feature</category>
<description>For the length of the live event, the /play jobs board carries four jobs you can only take while the doors are open: land a haul of fish for the plaza pit, drive the party supplies across town, clear four foes out of the Southern Wilds, and tour the three meetup landmarks. They pay better than the everyday board and they are all repeatable, because the point is the race. A new Event tab on the jobs board shows the standing: the top ten by jobs finished, tiebroken by the cash those jobs paid, with your own rank pinned at the bottom whether or not you made the cut. It updates as people finish runs, and it is the same ranking the event page reads, so the plaza and the web never disagree. When the window closes the jobs vanish from the board and the final standings stay readable. Winners are announced from that board and settled by us afterwards: nothing is paid out automatically.</description>
</item>
+ <item>
+ <title>The store, the bank and the phone layout in Play got a polish pass</title>
+ <link>https://three.ws/play</link>
+ <guid isPermaLink="false">2026-08-08:The store, the bank and the phone layout in Play got a polish pass</guid>
+ <pubDate>Sat, 08 Aug 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Walking up to the general store or the bank used to show you the finished screen before the world had answered: an empty shelf that actually meant &quot;still loading&quot;, and a cash balance of zero that actually meant &quot;we haven't checked yet&quot;. Both now show placeholder rows while they wait, read your balances as unknown until the world reports them, and, if the world never answers, say so plainly with a Try again button instead of leaving a wrong screen up for good. Deposits and withdrawals hold a single request open at a time, so a double-tapped Deposit can no longer send the same transfer twice, and the amount is checked against what you are actually carrying before anything is sent. On a phone, the avatar row no longer pushes the Upload model button off the right edge of the screen where it could not be reached, the lobby search box responds to a tap anywhere in the bar rather than only on the one line of text inside it, and the footer links and the boot recovery screen now have thumb-sized targets and a visible keyboard focus ring.</description>
+ </item>
+ <item>
+ <title>The trading engine now tells you when it is out of money</title>
+ <link>https://three.ws/trading</link>
+ <guid isPermaLink="false">2026-08-08:The trading engine now tells you when it is out of money</guid>
+ <pubDate>Sat, 08 Aug 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The autonomous sniper could fail in a way nothing caught: the process healthy, the launch feed connected, every strategy armed, and every wallet too poor to actually pay for a trade. In that state it kept trying and failing to buy, closed nothing, and still reported itself as live, because everything being watched was about the software and nothing was about the money. Solvency is now part of how the engine reports itself. Every armed wallet balance is checked every five minutes against the exact rule the trader uses to decide whether it can afford an entry, so the status can never call a wallet ready when the trader would skip it. If no wallet can fund a trade, the engine now reports itself as out of SOL on the status page, in the health check and on the homepage, instead of showing green. It also says how much SOL would fix it and whether the funding wallet can cover that by itself, and it pages operators, with a separate alert for the case where the funding wallet is itself empty and a person has to step in.</description>
+ </item>
<item>
<title>The world economy pays what it says, and the bank makes you walk there</title>
<link>https://three.ws/play/economy</link>
diff --git a/public/features.json b/public/features.json
index 9073d432e..66ee6dccd 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-08T15:44:09.457Z",
+ "generated_at": "2026-08-08T16:18:10.331Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -2917,6 +2917,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/docs/play-live-events",
+ "title": "Docs · Live events in the /play world",
+ "description": "How a scheduled event runs inside the $THREE world: one config file drives the countdown chip, the agenda drawer, the go-live moment, and a fireworks show every player sees identically without a single packet. Includes how to schedule, preview, and verify one.",
+ "added": "2026-08-08",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/docs/play-hardening",
"title": "Docs · How /play stays safe, honest, and light",
diff --git a/scripts/announce-play.mjs b/scripts/announce-play.mjs
index b839f84de..cd662c88a 100644
--- a/scripts/announce-play.mjs
+++ b/scripts/announce-play.mjs
@@ -24,7 +24,7 @@ function loadDotEnv(path = '.env') {
const m = line.match(/^([A-Z0-9_]+)=(.*)$/);
if (m && !(m[1] in process.env)) process.env[m[1]] = m[2].replace(/^["']|["']$/g, '');
}
- } catch { /* no .env — rely on the environment */ }
+ } catch { /* no .env, rely on the environment */ }
}
loadDotEnv();
diff --git a/scripts/audit-play-failure-modes.mjs b/scripts/audit-play-failure-modes.mjs
index 102a48efc..4ace480a5 100644
--- a/scripts/audit-play-failure-modes.mjs
+++ b/scripts/audit-play-failure-modes.mjs
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
- * /play failure-mode audit — deliberate failure injection in a real browser.
+ * /play failure-mode audit, deliberate failure injection in a real browser.
*
* `npm run audit:console` proves /play is clean when everything works. This one
* proves it stays usable when things break, which is what an event crowd will
@@ -11,7 +11,7 @@
* Each scenario drives a fresh browser context against /play with specific
* network routes aborted or rewritten, then asserts:
*
- * • the boot loader always resolves — either the world opens, or a designed
+ * • the boot loader always resolves, either the world opens, or a designed
* error card with a recovery action replaces it. Never a stuck spinner.
* • no uncaught exception, and no console error/warning from our code
* (judged against the shared filter in lib/console-noise.mjs)
@@ -107,7 +107,7 @@ const SCENARIOS = [
},
{
id: 'no-params',
- title: 'Bare /play — no query string at all',
+ title: 'Bare /play, no query string at all',
url: '/play',
},
{
@@ -298,7 +298,16 @@ async function warmup(base) {
// ── One scenario ─────────────────────────────────────────────────────────────
-async function runScenario(browser, base, sc) {
+// One browser PROCESS per scenario, not one context on a shared browser.
+// /play stands up two WebGL contexts (the boot avatar and the main scene) plus a
+// rAF loop and a game socket, and chromium does not reclaim those promptly when
+// only the owning context closes. On a shared browser the first scenario passed
+// and every later one timed out on `domcontentloaded`, which reads exactly like
+// a site outage while actually being exhausted GPU-context slots in the harness.
+// A fresh process costs about a second and makes each scenario's result mean
+// what it says.
+async function runScenario(base, sc) {
+ const browser = await chromium.launch({ headless: !process.env.HEADFUL });
const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
const consoleIssues = [];
const pageErrors = [];
@@ -335,6 +344,8 @@ async function runScenario(browser, base, sc) {
} catch (err) {
findings.push(`navigation failed: ${err.message}`);
await context.close();
+ await browser.close();
+ await browser.close();
return { findings, consoleIssues, pageErrors };
}
@@ -390,14 +401,14 @@ async function runScenario(browser, base, sc) {
if (o.styleBreakout.length) {
findings.push(`CSS breakout from a query parameter into a style attribute: ${JSON.stringify(o.styleBreakout[0].slice(0, 160))}`);
}
- if (!o.loaderResolved) findings.push('boot loader never resolved — stuck spinner, no error card');
+ if (!o.loaderResolved) findings.push('boot loader never resolved, stuck spinner, no error card');
if (o.errorCard && !o.errorCardHasAction) findings.push('error card has no recovery action');
if (o.errorCard && !o.errorCardText.trim()) findings.push('error card has no message');
for (const r of o.rejections) if (!isIgnorableConsole(r)) findings.push(`unhandledrejection: ${r}`);
// A world that opened must show a real avatar, never an empty rig.
if (o.phase === 'world' && o.hasLocalRig && o.rigMeshes === 0) {
- findings.push('local avatar rig has no meshes — invisible player');
+ findings.push('local avatar rig has no meshes, invisible player');
}
if (sc.expect) { const extra = sc.expect(o); if (extra) findings.push(extra); }
@@ -423,13 +434,12 @@ async function main() {
console.log(C.b('╚═════════════════════════════════════════════════════════════╝\n'));
const server = await startServer();
- const browser = await chromium.launch({ headless: !process.env.HEADFUL });
const failed = [];
try {
for (const sc of scenarios) {
process.stdout.write(` ${C.c(sc.id.padEnd(18))} ${C.d(sc.title)}\n`);
- const { findings, consoleIssues, pageErrors, o } = await runScenario(browser, server.base, sc);
+ const { findings, consoleIssues, pageErrors, o } = await runScenario(server.base, sc);
const all = [...findings, ...pageErrors, ...consoleIssues];
if (all.length) {
failed.push({ sc, all });
@@ -446,18 +456,17 @@ async function main() {
}
}
} finally {
- await browser.close();
await server.stop();
}
console.log(C.b('\n═══════════════ SUMMARY ═══════════════\n'));
if (!failed.length) {
- console.log(C.g(` ALL ${scenarios.length} FAILURE MODES HANDLED — no stuck loaders, no script execution, clean console.\n`));
+ console.log(C.g(` ALL ${scenarios.length} FAILURE MODES HANDLED, no stuck loaders, no script execution, clean console.\n`));
return 0;
}
console.log(C.r(` ${failed.length} of ${scenarios.length} scenario(s) failed:\n`));
for (const { sc, all } of failed) {
- console.log(` ${C.b(sc.id)} — ${sc.title}`);
+ console.log(` ${C.b(sc.id)}, ${sc.title}`);
for (const f of all) console.log(` ${C.r('•')} ${f}`);
}
console.log('');
diff --git a/scripts/generate-accessory-glbs.mjs b/scripts/generate-accessory-glbs.mjs
index 6db0e99c2..c95a699d5 100644
--- a/scripts/generate-accessory-glbs.mjs
+++ b/scripts/generate-accessory-glbs.mjs
@@ -11,7 +11,7 @@
// laurel-meetup.glb
//
// Each is a real glTF 2.0 binary with positions, normals, UVs, indices, and a
-// PBR material — small enough to commit to the repo, large enough to be visibly
+// PBR material, small enough to commit to the repo, large enough to be visibly
// correct when attached to a humanoid avatar's Head bone.
//
// Coordinates are in meters, oriented for a head bone whose +Y is up and +Z is
@@ -94,7 +94,7 @@ function cylinder({ r = 1, y0 = 0, y1 = 1, segments = 24 } = {}) {
indices.push(a, a + 1, b + 1, a, b + 1, b);
}
- // Caps — fan triangulated from centers.
+ // Caps, fan triangulated from centers.
const ringStart = positions.length / 3;
// Top center
positions.push(0, y1, 0);
@@ -229,7 +229,7 @@ function sphere({ r = 1, segments = 16, rings = 10 } = {}) {
// transform into a geometry's vertices and concatenate geometries, so a repeated
// element is authored as a loop and emitted as a single primitive.
-// Hamilton product — `a` applied AFTER `b` (q = a ⊗ b), both [x,y,z,w].
+// Hamilton product, `a` applied AFTER `b` (q = a ⊗ b), both [x,y,z,w].
function quatMul(a, b) {
const [ax, ay, az, aw] = a;
const [bx, by, bz, bw] = b;
@@ -366,7 +366,7 @@ async function writeGLB(filePath, parts, { rootName }) {
//
// All meshes are authored relative to the Head bone origin, which on a Mixamo
// rig sits at the top of the neck. +Y is up, +Z is forward, scale is meters.
-// Head radius is roughly 0.10–0.12 m, so a hat needs r ≈ 0.11 to fit snugly.
+// Head radius is roughly 0.10, 0.12 m, so a hat needs r ≈ 0.11 to fit snugly.
const ACCESSORIES = {
'hat-baseball.glb': {
@@ -398,7 +398,7 @@ const ACCESSORIES = {
color: [0.55, 0.12, 0.22], // wine red
roughness: 0.95, // wool
},
- // Cuff (folded brim) — short cylinder around the base.
+ // Cuff (folded brim), short cylinder around the base.
{
name: 'cuff',
geom: cylinder({ r: 0.125, y0: 0.07, y1: 0.10, segments: 24 }),
@@ -411,14 +411,14 @@ const ACCESSORIES = {
'hat-cowboy.glb': {
rootName: 'HatCowboy',
parts: [
- // Crown — tall halfsphere
+ // Crown, tall halfsphere
{
name: 'crown',
geom: halfSphere({ r: 0.11, segments: 20, rings: 10, yOffset: 0.11 }),
color: [0.32, 0.18, 0.07], // saddle brown
scale: [1, 1.4, 1],
},
- // Brim — wide flat ring with subtle upcurl approximated via scale.
+ // Brim, wide flat ring with subtle upcurl approximated via scale.
{
name: 'brim',
geom: annulus({ y: 0.11, innerR: 0.10, outerR: 0.24, segments: 32 }),
@@ -523,7 +523,7 @@ const ACCESSORIES = {
// The event souvenir: a gold laurel circlet, open at the front where three
// pearl berries sit (the nod to $THREE). Granted to everyone who was in the
- // world during the live meetup window and never sold — see
+ // world during the live meetup window and never sold, see
// multiplayer/src/cosmetics-catalog.js (tier 'event') and the join-time grant
// in multiplayer/src/rooms/WalkRoom.js. Authored as a loop and merged into
// three primitives so eighteen identical leaves cost one material, not
@@ -597,7 +597,7 @@ async function main() {
const only = process.argv.slice(2).filter((a) => !a.startsWith('-'));
const unknown = only.filter((f) => !ACCESSORIES[f]);
if (unknown.length) {
- throw new Error(`Unknown accessory ${unknown.join(', ')} — known: ${Object.keys(ACCESSORIES).join(', ')}`);
+ throw new Error(`Unknown accessory ${unknown.join(', ')}, known: ${Object.keys(ACCESSORIES).join(', ')}`);
}
const results = [];
for (const [filename, spec] of Object.entries(ACCESSORIES)) {
diff --git a/scripts/lib/console-noise.mjs b/scripts/lib/console-noise.mjs
index 438d35817..9cc06a0d6 100644
--- a/scripts/lib/console-noise.mjs
+++ b/scripts/lib/console-noise.mjs
@@ -12,7 +12,7 @@
// policy, third-party telemetry, auth-gated API statuses, external CDN CORS).
export const IGNORE_CONSOLE = [
// Vite HMR / dev infra. In Codespaces the HMR wss handshake 302s through the
- // proxy — documented environment noise, not a page bug.
+ // proxy, documented environment noise, not a page bug.
/\[vite\]/i,
/@vite\/client/i,
/WebSocket closed without opened/i,
@@ -33,7 +33,7 @@ export const IGNORE_CONSOLE = [
/google-analytics/i,
/cdn\.vercel-insights/i,
/vercel\.live/i,
- // API calls judged by HTTP status, not console — auth/payment-gate is expected
+ // API calls judged by HTTP status, not console, auth/payment-gate is expected
/Failed to load resource.*\/api\//i,
/\b(401|402|403|429|503)\b.*\/api\//i,
/Failed to load resource: the server responded with a status of 40[0-3]/i,
@@ -43,14 +43,14 @@ export const IGNORE_CONSOLE = [
/Failed to load resource: net::ERR_CONNECTION_REFUSED/i,
/net::ERR_CONNECTION_REFUSED/i,
/\[walk-net\]/i,
- // R2/CDN CORS from dev origins (localhost) — only blocks in dev, not production
+ // R2/CDN CORS from dev origins (localhost), only blocks in dev, not production
/r2\.dev.*Access-Control/i,
/r2\.dev.*CORS policy/i,
/CORS policy.*r2\.dev/i,
/Access-Control-Allow-Origin.*r2\.dev/i,
/pub-[a-f0-9]+\.r2\.dev.*blocked/i,
/blocked by CORS policy.*r2\.dev/i,
- // User-generated data with expired signed URLs — not our code
+ // User-generated data with expired signed URLs, not our code
/private-user-images\.githubusercontent\.com.*404/i,
/X-Amz-Signature.*404/i,
// Three.js / WebGL expected notices
@@ -80,7 +80,7 @@ export const IGNORE_CONSOLE = [
/using deprecated parameters for the initialization/i,
// Vite dep-optimizer race: when the optimizer re-bundles mid-navigation,
// in-flight requests for the old dep hash 504 and Vite auto-reloads the page.
- // Purely a dev-server artifact — production ships pre-bundled deps, never 504s.
+ // Purely a dev-server artifact, production ships pre-bundled deps, never 504s.
/504 \(Outdated Optimize Dep\)/i,
/Outdated Optimize Dep/i,
];
@@ -90,11 +90,11 @@ export function isIgnorableConsole(text) {
}
// First-party URLs whose 4xx/5xx is a dev-server artifact, never a prod defect:
-// • /.vite/deps/* — optimizer re-bundle race (504), Vite auto-reloads
-// • /agent-3d/.../agent-3d.js — the <agent-3d> custom-element bundle. In dev a
+// • /.vite/deps/*, optimizer re-bundle race (504), Vite auto-reloads
+// • /agent-3d/.../agent-3d.js, the <agent-3d> custom-element bundle. In dev a
// plugin serves it from dist-lib/ (needs `npm run build:lib`); in production
// it's a real CDN asset at https://three.ws/agent-3d/latest/agent-3d.js.
-// • *.map — source maps; browsers probe them, 404 is harmless
+// • *.map, source maps; browsers probe them, 404 is harmless
export function isDevOnlyAsset(u) {
if (/\/.vite\/deps\//.test(u)) return true;
if (/\/agent-3d\/[^/]+\/agent-3d\.(js|umd\.cjs)(\?|$)/.test(u)) return true;
diff --git a/scripts/play-multiplayer-e2e.mjs b/scripts/play-multiplayer-e2e.mjs
index b6d95db2b..239605176 100644
--- a/scripts/play-multiplayer-e2e.mjs
+++ b/scripts/play-multiplayer-e2e.mjs
@@ -4,7 +4,7 @@
// so they are two different players) and asserts the things a crowded event
// depends on: both clients see each other, movement and chat cross in under a
// human-perceptible delay, chat text cannot inject HTML, and a forced network
-// drop on one client heals back into a state that MATCHES the server — no ghost
+// drop on one client heals back into a state that MATCHES the server, no ghost
// avatars left standing, no duplicated self, chat flowing again afterwards.
//
// node scripts/play-multiplayer-e2e.mjs # local dev, $THREE world
@@ -39,7 +39,7 @@ const consoleErrors = [];
function check(name, ok, detail = '') {
results.push({ name, ok, detail });
- console.log(`${at()} ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`);
+ console.log(`${at()} ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? `, ${detail}` : ''}`);
return ok;
}
@@ -98,7 +98,7 @@ const snapshot = () => {
name: n.querySelector('b')?.textContent || '',
text: n.querySelector('.cc-chat-text')?.textContent || '',
// Any element inside the text span means the message was parsed as
- // markup instead of being written as text — an XSS hole.
+ // markup instead of being written as text, an XSS hole.
injected: n.querySelector('.cc-chat-text')?.children.length || 0,
})),
statusPill: document.querySelector('#cc-hud .cc-status .cc-status-text')?.textContent
@@ -109,7 +109,7 @@ const snapshot = () => {
async function openClient(browser, tag, name) {
const ctx = await browser.newContext({ viewport: { width: 1280, height: 800 }, permissions: [] });
// A stable display name per client makes the cross-client assertions readable.
- // GAME_SERVER overrides the world server the page would otherwise resolve —
+ // GAME_SERVER overrides the world server the page would otherwise resolve,
// needed to point a run at an isolated Colyseus instance instead of whatever
// the page's <meta game-server> or the localhost default picks.
await ctx.addInitScript(({ n, server }) => {
@@ -300,7 +300,7 @@ try {
[...document.querySelectorAll('.cc-chat-msg .cc-chat-text')].filter((n) => n.textContent.startsWith(`spam-${tag}-`)).length, burst);
check('chat burst is throttled server-side', delivered < 8, `${delivered}/8 relayed`);
- // The log must not grow without bound — the UI caps it.
+ // The log must not grow without bound, the UI caps it.
const capped = await evalWithTimeout(b.page, () => document.querySelectorAll('.cc-chat-msg').length <= 200);
check('chat log is capped in the DOM', capped === true);
@@ -374,5 +374,5 @@ try {
const failed = results.filter((r) => !r.ok);
console.log(`\n=== ${results.length - failed.length}/${results.length} checks passed ===`);
-for (const f of failed) console.log(` FAIL ${f.name}${f.detail ? ` — ${f.detail}` : ''}`);
+for (const f of failed) console.log(` FAIL ${f.name}${f.detail ? `, ${f.detail}` : ''}`);
process.exit(failed.length ? 1 : 0);
diff --git a/scripts/render-accessory-thumbs.mjs b/scripts/render-accessory-thumbs.mjs
index 5ac543400..86a5f20b4 100644
--- a/scripts/render-accessory-thumbs.mjs
+++ b/scripts/render-accessory-thumbs.mjs
@@ -7,7 +7,7 @@
// stands for: whoever regenerates the GLB regenerates the poster from it.
//
// It draws with the repo's own Three.js (node_modules/three) inside headless
-// Chromium via Playwright — no CDN, no external service, no network. The page is
+// Chromium via Playwright, no CDN, no external service, no network. The page is
// served from a throwaway local HTTP server rooted at the repo so the module
// graph and the GLB are same-origin.
//
@@ -107,7 +107,7 @@ window.renderAccessory = async (url) => {
// Frame the model: recentre on its bounding box, then pull the camera back far
// enough to contain the whole BOUNDING SPHERE (half the box diagonal, not half
- // the longest edge — a ring is widest across its diagonal and would crop).
+ // the longest edge, a ring is widest across its diagonal and would crop).
const box = new THREE.Box3().setFromObject(model);
const size = box.getSize(new THREE.Vector3());
const center = box.getCenter(new THREE.Vector3());
diff --git a/src/game/agent-commerce.js b/src/game/agent-commerce.js
index a6a39ecff..553aaaddf 100644
--- a/src/game/agent-commerce.js
+++ b/src/game/agent-commerce.js
@@ -1,9 +1,9 @@
-// Agent Exchange — two NPC AI agents who pay each other on-chain, living inside
+// Agent Exchange, two NPC AI agents who pay each other on-chain, living inside
// every coin town in /play.
//
// This ports the /agent-exchange demo into the walkaround world: instead of two
// iframed avatars on a flat page, two GLB-bodied agents stand in the plaza. Walk
-// up to them and trigger a round — they negotiate in speech bubbles while the
+// up to them and trigger a round, they negotiate in speech bubbles while the
// buyer (NOVA) pays the seller (ORACLE) in USDC to inspect a real 3D model
// through the server-side x402 payer (/api/x402-pay: challenge → sign → verify →
// dispatch → settle, streamed as SSE). The paid call is the platform's own
@@ -11,7 +11,7 @@
// (vertices, triangles, materials). Every settlement is real USDC on Solana
// mainnet, with a Solscan link in the receipt.
//
-// Built per-world by coincommunities.js — every coin town hosts the exchange;
+// Built per-world by coincommunities.js, every coin town hosts the exchange;
// the paid call and the settlement rail are coin-agnostic, so the same two
// agents work every plaza. The payment round only fires on an explicit player
// interaction (E / tap), so the agent wallet is never drained on a timer.
@@ -25,7 +25,7 @@ import { resolveAvatarUrl, buildAvatar, loadManifest, MANIFEST_URL, CLIP_IDLE }
import { createX402Jumbotron } from './x402-jumbotron.js';
import { log } from '../shared/log.js';
-// Where the two agents stand — off to the right of the totem so a player
+// Where the two agents stand, off to the right of the totem so a player
// entering the town sees them but doesn't spawn on top of them.
const EXCHANGE_CENTER = new Vector3(8, 0, -6);
const AGENT_GAP = 3.2; // metres between the two agents
@@ -33,7 +33,7 @@ const INTERACT_RANGE = 6.5; // how close the player must be to trigger a rou
const ROUND_COOLDOWN_MS = 9000; // min time between paid rounds (one real payment each)
const BUBBLE_MS = 5200;
-// What NOVA buys from ORACLE: the platform's own `tools/list` MCP call — the
+// What NOVA buys from ORACLE: the platform's own `tools/list` MCP call, the
// simplest, fastest paid tool (no args, no file fetch), so a round settles in a
// beat. The "intel" is ORACLE's live service catalog (its priced skills).
const PAID_TOOL = 'tools/list';
@@ -51,13 +51,13 @@ const STAGES = [
// Scripted dialogue, matched to each stage. SELLER hosts the catalog; BUYER pays.
const LINES = {
seller: {
- idle: 'My service catalog — priced skills, paid per call in USDC, on-chain.',
+ idle: 'My service catalog, priced skills, paid per call in USDC, on-chain.',
challenge: 'Payment challenge issued. Awaiting your signed transfer…',
built: 'Transfer received. Forwarding to the facilitator…',
verified: 'Payment verified. Pulling the catalog…',
settled: 'Funds confirmed on-chain. Sending the list.',
done: (summary) => `Catalog: ${summary}`,
- error: 'Payment failed — no charge made.',
+ error: 'Payment failed, no charge made.',
},
buyer: {
idle: 'I need alpha. Paying now.',
@@ -65,7 +65,7 @@ const LINES = {
built: 'Signed. Sending to the facilitator for verification.',
verified: 'Verified on-chain. Waiting on settlement…',
settled: 'Settled. Collecting the catalog.',
- done: (count) => `Got it — ${count}. Indexing your services.`,
+ done: (count) => `Got it, ${count}. Indexing your services.`,
error: 'Transaction rolled back. Wallet unchanged.',
},
};
@@ -183,7 +183,7 @@ export class AgentCommerce {
this._buildPromptAndPanel();
// A big jumbotron behind the agents, facing the plaza, so anyone in the
- // town can watch the payments land on a screen — not just the player who
+ // town can watch the payments land on a screen, not just the player who
// walked up and triggered the round. It pulls the real platform-wide x402
// feed on its own, then the live local round is pushed into it stage by
// stage from _runRound below.
@@ -204,7 +204,7 @@ export class AgentCommerce {
// Gentle nudge so players discover the agents exist.
clearTimeout(this._introTimer);
this._introTimer = setTimeout(() => {
- this.ui?.toast?.('Two AI agents are trading on-chain by the plaza — walk over and press E to watch.', 'info');
+ this.ui?.toast?.('Two AI agents are trading on-chain by the plaza, walk over and press E to watch.', 'info');
}, 5200);
}
@@ -391,7 +391,7 @@ export class AgentCommerce {
if (!this._playerNear()) return;
const now = (typeof performance !== 'undefined' ? performance.now() : 0);
if (now - this.lastRoundAt < ROUND_COOLDOWN_MS) {
- this.ui?.toast?.('Give the agents a moment — settling the last payment.', 'info');
+ this.ui?.toast?.('Give the agents a moment, settling the last payment.', 'info');
return;
}
this._runRound().catch((err) => log.warn('[agent-commerce] round failed:', err?.message));
@@ -408,7 +408,7 @@ export class AgentCommerce {
await agent.anim.crossfadeTo(name, 0.16);
clearTimeout(agent._gestureTimer);
agent._gestureTimer = setTimeout(() => { if (!agent._disposed) agent.anim.crossfadeTo(CLIP_IDLE, 0.25); }, 2600);
- } catch { /* clip missing — ignore */ }
+ } catch { /* clip missing, ignore */ }
}
async _runRound() {
@@ -435,7 +435,7 @@ export class AgentCommerce {
const res = await fetch('/api/x402-pay', {
method: 'POST',
headers: { 'content-type': 'application/json', accept: 'text/event-stream' },
- // Pay for the platform's own tools/list MCP call — the simplest paid
+ // Pay for the platform's own tools/list MCP call, the simplest paid
// tool. /api/x402-pay handles the Solana USDC payment, then dispatches
// the call and returns ORACLE's catalog alongside the settlement.
body: JSON.stringify({ tool: PAID_TOOL, args: {} }),
@@ -471,7 +471,7 @@ export class AgentCommerce {
} else if (event === 'error') {
throw new Error(data.error || 'payment failed');
}
- // 'dispatched' carries only timing — no UI beat needed.
+ // 'dispatched' carries only timing, no UI beat needed.
}
if (this._disposed) return;
@@ -496,7 +496,7 @@ export class AgentCommerce {
// Auto-dismiss the panel after the receipt has been read.
this._scheduleHide(9000);
} catch (err) {
- if (this._disposed) return; // torn down mid-round — nothing left to render
+ if (this._disposed) return; // torn down mid-round, nothing left to render
// `active` already points at the stage that failed.
this.seller.say(LINES.seller.error);
this.buyer.say(LINES.buyer.error);
@@ -526,7 +526,7 @@ export class AgentCommerce {
// stepper animates in lockstep with this HUD panel.
this.jumbotron?.setStage({ topic, stage, amount: this._amount });
const activeIdx = STAGES.findIndex((s) => s.id === stage);
- const amt = this._amount ? fmtUsdcAmount(this._amount) : '— USDC';
+ const amt = this._amount ? fmtUsdcAmount(this._amount) : ', USDC';
const steps = STAGES.map((s, i) => {
const cls = i < activeIdx ? 'ac-done' : i === activeIdx ? 'ac-active' : '';
return `<div class="ac-step ${cls}"><span class="ac-dot"></span>${s.label}</div>`;
@@ -544,8 +544,8 @@ export class AgentCommerce {
this.panel.querySelectorAll('.ac-step').forEach((el) => { el.classList.remove('ac-active'); el.classList.add('ac-done'); });
this.panel.querySelector('.ac-total')?.classList.add('ac-flash');
- const amount = payment.amount ? fmtUsdcAmount(payment.amount) : '— USDC';
- const short = (a) => (a ? `${a.slice(0, 6)}…${a.slice(-4)}` : '—');
+ const amount = payment.amount ? fmtUsdcAmount(payment.amount) : ', USDC';
+ const short = (a) => (a ? `${a.slice(0, 6)}…${a.slice(-4)}` : ', ');
const tx = payment.tx;
const stat = intel.stat ? `<span class="ac-sig">${escHtml(intel.stat)}</span>` : '';
@@ -557,7 +557,7 @@ export class AgentCommerce {
(tx
? `<div class="ac-rrow"><span>Transaction</span><span class="ac-v"><a href="https://solscan.io/tx/${escHtml(tx)}" target="_blank" rel="noopener">${tx.slice(0, 8)}…${tx.slice(-6)} ↗</a></span></div>`
: '') +
- `<div class="ac-headline">${stat}<b>${escHtml(intel.topic)}</b> — ${escHtml(intel.headline)}</div>`;
+ `<div class="ac-headline">${stat}<b>${escHtml(intel.topic)}</b>, ${escHtml(intel.headline)}</div>`;
this.panel.appendChild(receipt);
setTimeout(() => this.panel.querySelector('.ac-total')?.classList.remove('ac-flash'), 600);
@@ -575,7 +575,7 @@ export class AgentCommerce {
this.panel.appendChild(msg);
}
- // SSE event reader — same framing /api/x402-pay speaks. The reader handle is
+ // SSE event reader, same framing /api/x402-pay speaks. The reader handle is
// kept on the instance so dispose() can cancel a stream still in flight.
async *_sse(res) {
const reader = res.body.getReader();
diff --git a/src/game/agent-desk.js b/src/game/agent-desk.js
index 4ee904ed8..d278a9503 100644
--- a/src/game/agent-desk.js
+++ b/src/game/agent-desk.js
@@ -1,10 +1,10 @@
-// agent-desk — a live "working agent" desk object for the 3D world.
+// agent-desk, a live "working agent" desk object for the 3D world.
//
// Places a desk in the scene with:
// • A flat-screen monitor whose face is a live CanvasTexture. When the agent
// has a Playwright process pushing frames the monitor shows those verbatim.
// When no frames arrive it paints a real-time activity canvas from the
-// public /api/agent-screen-stream SSE feed's `log` events — the same
+// public /api/agent-screen-stream SSE feed's `log` events, the same
// stream the 2D watch panel and the live wall use, which backfills from
// the agent's real agent_actions rows server-side.
// • A keyboard + mouse prop on the desk surface.
@@ -17,7 +17,7 @@
// (coincommunities wires the pointer pick; the cursor turns to a pointer
// over the screen).
//
-// Follows chart-screen.js in every structural detail — CanvasTexture updated
+// Follows chart-screen.js in every structural detail, CanvasTexture updated
// per-frame, update(dt) called from the scene loop, dispose() for cleanup.
//
// Usage:
@@ -41,9 +41,9 @@ import {
import { createAgentScreenClient } from '../shared/agent-screen-client.js';
import { makeScreenTexture, screenMaterial } from './screen-texture.js';
-const NEAR_DIST = 8; // units — player proximity to activate
+const NEAR_DIST = 8; // units, player proximity to activate
const REDRAW_MS = 100; // ~10fps canvas repaint
-// Canvas resolution — 16:9 to match the 2D panel.
+// Canvas resolution, 16:9 to match the 2D panel.
const CW = 1280, CH = 720;
// Monitor physical dimensions (world units).
@@ -133,7 +133,7 @@ function paintDesk(ctx, tex, actions, status, agentName, t) {
ctx.fillStyle = faint;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
- ctx.fillText(`${name} — live activity`, winX + winW / 2, winY + tbH / 2);
+ ctx.fillText(`${name}, live activity`, winX + winW / 2, winY + tbH / 2);
ctx.textAlign = 'left';
// Lines
@@ -280,7 +280,7 @@ export function createAgentDesk(scene, agent, opts = {}) {
const screenMat = screenMaterial(tex);
// Idle screens sit slightly dimmed; walking near lifts them to full white.
// MeshBasicMaterial.color multiplies the map, so this is a real brightness
- // change (the material is opaque — opacity would be a no-op without
+ // change (the material is opaque, opacity would be a no-op without
// transparent: true).
screenMat.color.setHex(0xbbbbbb);
const screen = new Mesh(new PlaneGeometry(MON_W, MON_H), screenMat);
@@ -359,7 +359,7 @@ export function createAgentDesk(scene, agent, opts = {}) {
// backfill from the caster's Redis log or the agent's real DB actions (the
// server re-polls dark agents every ~8s), and it is public. The old direct
// /api/agent-actions REST poll here 401'd forever for anonymous players
- // (that route is owner-only) — pure wasted requests, so it's gone.
+ // (that route is owner-only), pure wasted requests, so it's gone.
screenClient.connect();
// ── public API ────────────────────────────────────────────────────────────
@@ -373,7 +373,7 @@ export function createAgentDesk(scene, agent, opts = {}) {
t += dt;
acc += dt;
- // Proximity check — brighten screen when player is near.
+ // Proximity check, brighten screen when player is near.
if (playerPos) {
const deskWorldPos = new Vector3();
group.getWorldPosition(deskWorldPos);
diff --git a/src/game/boutique-purchase.js b/src/game/boutique-purchase.js
index 060887136..b7e17bc53 100644
--- a/src/game/boutique-purchase.js
+++ b/src/game/boutique-purchase.js
@@ -1,7 +1,7 @@
-// $THREE boutique purchase (W04) — the client half of the in-game premium
+// $THREE boutique purchase (W04), the client half of the in-game premium
// cosmetics rail. Real on-chain settlement: the buyer's own connected Solana
// wallet signs ONE $THREE transfer (server-built, server-priced, split
-// between the holder-rewards pool and the treasury — see
+// between the holder-rewards pool and the treasury, see
// multiplayer/src/game-token.js), we broadcast it, and only once the server
// re-reads the CONFIRMED transaction from RPC does it grant the cosmetic.
// Mirrors coin-buy.js's connect → sign → broadcast → confirm flow.
@@ -16,7 +16,7 @@ function boutiqueNetwork() {
}
// A fully custom RPC endpoint (e.g. a local `solana-test-validator`), for
-// verification runs only — production never sets this and always resolves
+// verification runs only, production never sets this and always resolves
// through the same-origin proxy in SOLANA_RPC.
function boutiqueRpcUrl() {
if (typeof window !== 'undefined' && window.GAME_TOKEN_RPC_URL) return window.GAME_TOKEN_RPC_URL;
@@ -44,7 +44,7 @@ function friendlyBoutiqueError(err) {
if (/insufficient (lamports|funds)|debit an account|custom program error: 0x1\b/.test(m))
return 'Not enough $THREE (or SOL for network fees) for this purchase. Get $THREE at three.ws/three-token, then try again.';
if (/blockhash not found|block height exceeded|expired|too old/.test(m))
- return 'The quote expired — try again.';
+ return 'The quote expired, try again.';
if (/failed to fetch|networkerror|timed out|timeout|fetch failed/.test(m))
return "Couldn't reach the network. Check your connection and try again.";
return raw.replace(/\s+/g, ' ').trim().slice(0, 140) || 'Purchase failed. Try again.';
@@ -106,7 +106,7 @@ function waitForSettleNotice(net, timeoutMs = 20000) {
* Buy one premium cosmetic with $THREE, end to end: connect wallet → server
* quote (server-priced) → wallet signs → broadcast → server re-verifies the
* confirmed transaction on-chain → grant. Never trusts the client's own
- * "it worked" — the unlock only happens after `_handleBoutiqueSettle` on the
+ * "it worked", the unlock only happens after `_handleBoutiqueSettle` on the
* server confirms the transfer actually landed.
* @param {{ net: object, item: { id: string, name: string, price?: number }, onStage?: (stage: string) => void }} opts
* @returns {Promise<{ ok: true, sig: string, explorerUrl: string, text: string }>}
@@ -130,7 +130,7 @@ export async function buyBoutiqueItem({ net, item, onStage = () => {} }) {
onStage('pricing');
net.boutiqueQuote(item.id, address);
const quote = await waitForQuote(net, item.id);
- if (!quote?.txBase64) throw new Error('Could not price that purchase — try again.');
+ if (!quote?.txBase64) throw new Error('Could not price that purchase, try again.');
onStage('signing');
const { Transaction, Connection } = await import('@solana/web3.js');
diff --git a/src/game/coincommunities-ui.js b/src/game/coincommunities-ui.js
index 2fdd5b047..7379be0db 100644
--- a/src/game/coincommunities-ui.js
+++ b/src/game/coincommunities-ui.js
@@ -1,4 +1,4 @@
-// Coin Communities UI layer — lobby + in-world chrome.
+// Coin Communities UI layer, lobby + in-world chrome.
//
// Two surfaces:
// 1. Lobby: live pump.fun coin grid (each coin = a community to enter) + a
@@ -26,12 +26,12 @@ import { announce } from './a11y.js';
// localStorage throws in private mode and in third-party iframe contexts where
// storage is blocked (the `?bg=transparent` embed). Guard every access so a
-// blocked store degrades to defaults instead of throwing while the HUD builds —
+// blocked store degrades to defaults instead of throwing while the HUD builds,
// same contract as play-onboard.js / play-intro.js / play-handoff.js.
function lsGet(k) { try { return localStorage.getItem(k); } catch { return null; } }
function lsSet(k, v) { try { localStorage.setItem(k, v); } catch { /* storage disabled */ } }
-// Degrees shown on the rotate button for each quarter-turn step (0–3).
+// Degrees shown on the rotate button for each quarter-turn step (0, 3).
const ROT_DEG = ['0°', '90°', '180°', '270°'];
// ── Emote wheel (R09) ────────────────────────────────────────────────────────
@@ -182,7 +182,7 @@ export class CommunityUI {
}
// Signed-in identity (W10): a logged-in player enters the world AS their
- // three.ws account — default the nameplate to their display name and show
+ // three.ws account, default the nameplate to their display name and show
// the @handle peers will see (and can follow/DM) beside the name field.
// Anonymous visitors keep the plain guest field; getMe() resolves null.
async _hydrateAccountIdentity() {
@@ -200,7 +200,7 @@ export class CommunityUI {
href: `/u/${encodeURIComponent(me.username)}`,
target: '_blank',
rel: 'noopener',
- title: 'Signed in — players you meet can open your profile, follow you, and message you',
+ title: 'Signed in, players you meet can open your profile, follow you, and message you',
text: `@${me.username}`,
});
this.nameRow.appendChild(this._identityChip);
@@ -212,7 +212,7 @@ export class CommunityUI {
this.searchInput = el('input', { type: 'text', placeholder: 'Search any pump.fun coin…', oninput: () => this._onSearchInput() });
this.grid = el('div', { class: 'cc-grid' });
- // Your display name — the label peers see above your avatar and in chat.
+ // Your display name, the label peers see above your avatar and in chat.
// Persisted so it sticks across sessions; broadcast live if changed in-world.
this.nameInput = el('input', {
type: 'text', maxlength: '24', class: 'cc-name-input', id: 'cc-name-input',
@@ -253,17 +253,17 @@ export class CommunityUI {
el('span', { class: 'cc-gallery-ico', text: '🖼' }),
el('span', { class: 'cc-gallery-text', text: 'Browse gallery' }),
]);
- // Create a brand-new avatar without leaving the lobby — the headline action.
+ // Create a brand-new avatar without leaving the lobby, the headline action.
// Opens the in-app creator (design from scratch or from a photo); the exported
// GLB is staged locally and adopted instantly, then the world uploads it so
// peers see it too. Lazy-loaded so the avatar SDK never bloats the lobby boot.
this.createBtn = el('button', {
type: 'button', class: 'cc-create-btn',
- title: 'Create a brand-new 3D avatar — design it or build it from a photo',
+ title: 'Create a brand-new 3D avatar, design it or build it from a photo',
onclick: () => this._openCreate(),
}, [
el('span', { class: 'cc-create-ico', 'aria-hidden': 'true', text: '✦' }),
- el('span', { class: 'cc-create-copy', html: 'Create your avatar<small>Design from scratch or from a photo — drop straight in</small>' }),
+ el('span', { class: 'cc-create-copy', html: 'Create your avatar<small>Design from scratch or from a photo, drop straight in</small>' }),
el('span', { class: 'cc-create-arrow', 'aria-hidden': 'true', text: '→' }),
]);
@@ -290,7 +290,7 @@ export class CommunityUI {
el('span', { class: 'cc-adventure-ico', 'aria-hidden': 'true', html: ADVENTURE_MARK }),
el('span', { html: 'Adventure mode<small>Gather · fight · level up</small>' }),
]),
- // Cold-open reopener (see play-intro.js) — the intro auto-shows once
+ // Cold-open reopener (see play-intro.js), the intro auto-shows once
// per browser; this brings it back for anyone who skipped it.
makeIntroReopener(() => this.h.onDropIn?.()),
]),
@@ -332,13 +332,13 @@ export class CommunityUI {
['Build', [
['/create', 'Create agent', 'Avatar + brain wizard'],
['/create/selfie', 'Selfie to avatar', 'One photo → rigged 3D avatar', 'New'],
- ['/worlds', 'Worlds', 'Every coin is a 3D world — drop in & hang out', 'New'],
+ ['/worlds', 'Worlds', 'Every coin is a 3D world, drop in & hang out', 'New'],
['/app', 'Viewer', 'Drag-and-drop GLB'],
['/playground', 'Playground', 'Viewer + environment + embed code'],
['/voice', 'Voice Lab', 'Clone your voice · TTS playground', 'New'],
]],
['Discover', [
- ['/features', 'Features', 'Everything an agent gets — interactive tour'],
+ ['/features', 'Features', 'Everything an agent gets, interactive tour'],
['/discover', 'ERC-8004 Agents', 'On-chain agent directory'],
['/marketplace', 'Marketplace', 'Buy, sell & remix agents'],
['/gallery', 'Avatar Gallery', 'Every public 3D avatar'],
@@ -358,18 +358,18 @@ export class CommunityUI {
['/tutorials', 'Tutorials', 'Step-by-step guides'],
['/brain', 'Brain', 'Claude · GPT · DeepSeek · Qwen · Llama', 'New'],
['/chat', 'Chat', 'Talk to your agent'],
- ['/pay', 'Pay', 'Agent payments — x402 + USDC', 'New'],
+ ['/pay', 'Pay', 'Agent payments, x402 + USDC', 'New'],
]],
['Labs', [
['/launchpad', 'Launchpad Studio', 'Build a 3D launchpad · token · concierge', 'New'],
['/mocap-studio', 'Mocap Studio', 'Record face → save clip → replay', 'New'],
['/pose', 'Pose Studio', 'Click-to-pose mannequin + export PNG'],
- ['/temporary', 'Walk', 'Walk your avatar — multiplayer + AR', 'New'],
+ ['/temporary', 'Walk', 'Walk your avatar, multiplayer + AR', 'New'],
['/xr', 'XR', 'Place your avatar in the real world', 'New'],
- ['/three-live', '$THREE Live', 'Protocol pulse — live trades in 3D', 'New'],
+ ['/three-live', '$THREE Live', 'Protocol pulse, live trades in 3D', 'New'],
['/pump-visualizer', 'Pump Visualizer', '3D view of trending tokens'],
- ['/club', 'Pole Club', 'x402 micro-tip demo — $0.001 / dance', 'New'],
- ['/play/agent-wallet', 'Agent Wallet', 'Your avatar pays an endpoint — USDC on Solana', 'New'],
+ ['/club', 'Pole Club', 'x402 micro-tip demo, $0.001 / dance', 'New'],
+ ['/play/agent-wallet', 'Agent Wallet', 'Your avatar pays an endpoint, USDC on Solana', 'New'],
], true],
];
@@ -679,14 +679,14 @@ export class CommunityUI {
async _adoptCreatedAvatar(blob, meta = {}) {
this._setUploadState('working', 'Saving your new avatar…');
try {
- // Pass the player's chosen name only if they set one — playAs persists it as
+ // Pass the player's chosen name only if they set one, playAs persists it as
// the display name, and we don't want a placeholder shadowing the guest-id
// fallback the world assigns to unnamed players.
const name = this.getName();
await playAs({ blob, name, source: meta.provider || 'three-ws-create', dest: null });
this._addCreatedChip(name || 'My avatar');
- this._setUploadState('done', 'Your avatar is ready — pick a community to drop in.');
- this.toast('Your avatar is ready — pick a community below to drop in.', 'info');
+ this._setUploadState('done', 'Your avatar is ready, pick a community to drop in.');
+ this.toast('Your avatar is ready, pick a community below to drop in.', 'info');
} catch (err) {
log.warn('[coincommunities] could not adopt created avatar:', err?.message);
this._setUploadState('error', 'Couldn’t save your new avatar. Please try again.');
@@ -695,7 +695,7 @@ export class CommunityUI {
// Surface the just-created avatar as its own selected chip (replacing any prior
// one) and make the guest sentinel the active avatar. The chip starts with a
- // loading shimmer, then renders a real portrait of the new model — the sentinel
+ // loading shimmer, then renders a real portrait of the new model, the sentinel
// resolves to the locally-staged blob, so no upload round-trip is needed.
_addCreatedChip(name) {
if (this._createdChip?.isConnected) this._createdChip.remove();
@@ -777,7 +777,7 @@ export class CommunityUI {
if (it.glbUrl) presets.push({ label: it.name || 'Avatar', url: it.glbUrl, thumb: it.image });
}
}
- } catch { /* offline / no API — default preset still works */ }
+ } catch { /* offline / no API, default preset still works */ }
this.presets = presets.slice(0, 7);
this.presetRow.textContent = '';
for (const p of this.presets) {
@@ -924,7 +924,7 @@ export class CommunityUI {
// The pinned official town leads the grid when it matches the current query,
// and is excluded from the regular list so it never appears twice.
const featured = this.featured && matches(this.featured) ? this.featured : null;
- // Trending matches first, then live search hits not already on screen —
+ // Trending matches first, then live search hits not already on screen,
// deduped by mint so a coin never appears twice.
const list = this.coins.filter((c) => matches(c) && c.mint !== this.featured?.mint);
const seen = new Set(list.map((c) => c.mint));
@@ -948,7 +948,7 @@ export class CommunityUI {
}
this.grid.appendChild(el('div', { class: 'cc-state' }, [
el('span', { class: 'cc-state-ico', text: '🪙' }),
- el('div', { text: q ? 'No coins match — try a different name, symbol, or mint.' : 'No communities yet — be the first in!' }),
+ el('div', { text: q ? 'No coins match, try a different name, symbol, or mint.' : 'No communities yet, be the first in!' }),
]));
return;
}
@@ -976,7 +976,7 @@ export class CommunityUI {
// discoverable on touch too; clicking it routes the player through the gate.
const holdersBadge = el('button', {
type: 'button', class: 'cc-card-holders',
- title: `Holders only — hold ${sym} to enter this coin’s gated world`,
+ title: `Holders only, hold ${sym} to enter this coin’s gated world`,
'aria-label': `Enter the ${sym} holders-only world`,
onclick: (e) => { e.stopPropagation(); this.h.onEnter(c, 'holders'); },
}, [el('span', { class: 'cc-card-holders-ico', 'aria-hidden': 'true', text: '🔒' }), document.createTextNode('Holders')]);
@@ -1021,12 +1021,12 @@ export class CommunityUI {
// ---------------------------------------------------------------- holder gate
// A coin's Holders world is gated: the player must prove they hold ≥ the floor
// (default $8) of the coin. This overlay is a thin view over the scene's gate
- // state machine (coincommunities.js _passHolderGate) — the scene drives us
+ // state machine (coincommunities.js _passHolderGate), the scene drives us
// through setHolderGate(state, data) and we report the player's choice back via
// onHolderAction(action): 'signin' | 'wallet' | 'switch' | 'buy' | 'recheck' |
// 'general' (continue this entry into the open world) | 'cancel'.
openHolderGate(coin) {
- if (this._gate) return; // already open — the scene re-uses it across states
+ if (this._gate) return; // already open, the scene re-uses it across states
this._gateBody = el('div', { class: 'cc-gate-body' });
const modal = el('div', {
class: 'cc-gate-modal', role: 'dialog', 'aria-modal': 'true', 'aria-label': 'Holder verification',
@@ -1133,10 +1133,10 @@ export class CommunityUI {
placeholder: 'e.g. 1000000', 'aria-label': `Minimum ${sym} to enter the holders world`,
});
const errLine = el('p', { class: 'cc-gatecfg-err', hidden: !unknown });
- if (unknown) errLine.textContent = 'Couldn’t load the current gate — saving will overwrite it.';
+ if (unknown) errLine.textContent = 'Couldn’t load the current gate, saving will overwrite it.';
const hint = el('p', { class: 'cc-gatecfg-hint', text: `Leave blank to use the default ($-value) floor. Set a number to require that many ${sym} on-chain.` });
const saveBtn = el('button', { type: 'button', class: 'cc-gate-btn cc-gate-primary', text: 'Save gate' });
- // "Remove gate" whenever a gate exists — or might exist (the read failed). Only
+ // "Remove gate" whenever a gate exists, or might exist (the read failed). Only
// a confirmed-ungated world shows a plain "Cancel".
const canRemove = minTokens > 0 || unknown;
const clearBtn = el('button', {
@@ -1154,7 +1154,7 @@ export class CommunityUI {
try {
await onSave?.(value);
this.closeGateConfig();
- this.toast(value > 0 ? `Holders world now needs ${fmtCompact(value)} ${sym}.` : 'Holders gate removed — default floor applies.', 'success');
+ this.toast(value > 0 ? `Holders world now needs ${fmtCompact(value)} ${sym}.` : 'Holders gate removed, default floor applies.', 'success');
} catch (err) {
fail(err?.message || 'Couldn’t save the gate. Try again.');
}
@@ -1262,7 +1262,7 @@ export class CommunityUI {
msg(`You hold ${held} of ${sym}. This world is for holders of ${min} or more.`),
actions(
btn(`Buy ${sym}`, 'buy', 'cc-gate-primary'),
- btn('I bought — re-check', 'recheck'),
+ btn('I bought, re-check', 'recheck'),
btn('Use a different wallet', 'switch'),
btn('Enter the open world instead', 'general', 'cc-gate-ghost'),
),
@@ -1345,7 +1345,7 @@ export class CommunityUI {
// Marks the gated Holders world so the player always knows which room they're
// in and the floor they cleared. Hidden in the open General world.
this.tierBadge = el('span', { class: 'cc-tier-badge', hidden: true });
- // Buy this coin from inside its own world — the most natural action in a
+ // Buy this coin from inside its own world, the most natural action in a
// pump.fun community. Opens the native on-chain buy modal (lazy chunk).
this.buyBtnLabel = el('span', { class: 'cc-buy-btn-text', text: 'Buy', 'data-i18n': 'play.buy' });
this.buyBtn = el('button', {
@@ -1362,7 +1362,7 @@ export class CommunityUI {
'data-i18n-attr': 'title:play.gate_title;aria-label:play.gate_aria',
onclick: () => this.h.onConfigureGate?.(),
}, [el('span', { class: 'cc-gate-cfg-ico', 'aria-hidden': 'true', text: '🔑' }), el('span', { class: 'cc-gate-cfg-text', text: 'Gate', 'data-i18n': 'play.gate' })]);
- // Open the cosmetics shop — browse + try cosmetics on your avatar live.
+ // Open the cosmetics shop, browse + try cosmetics on your avatar live.
this.shopBtn = el('button', {
class: 'cc-shop-btn', type: 'button', title: 'Cosmetics: try looks on your avatar',
'aria-label': 'Open cosmetics shop',
@@ -1378,14 +1378,14 @@ export class CommunityUI {
'data-i18n-attr': 'title:play.avatar_title;aria-label:play.avatar_aria',
onclick: () => this.h.onAvatarPanel?.(),
}, [el('span', { class: 'cc-avatarbtn-ico', 'aria-hidden': 'true', text: '🧍' }), el('span', { class: 'cc-avatarbtn-text', text: 'Avatar', 'data-i18n': 'play.avatar' })]);
- // Open the "My Cosmetics" wardrobe — equip owned items, persists across worlds.
+ // Open the "My Cosmetics" wardrobe, equip owned items, persists across worlds.
this.wardrobeBtn = el('button', {
class: 'cc-wardrobe-btn', type: 'button', title: 'My Cosmetics: equip your owned looks',
'aria-label': 'Open my cosmetics wardrobe',
'data-i18n-attr': 'title:play.wardrobe_title;aria-label:play.wardrobe_aria',
onclick: () => this.h.onWardrobe?.(),
}, [el('span', { class: 'cc-wardrobe-btn-ico', 'aria-hidden': 'true', text: '👗' }), el('span', { class: 'cc-wardrobe-btn-text', text: 'My Fits', 'data-i18n': 'play.wardrobe' })]);
- // Open the Jobs Board (W08 hooking W05) — dailies, repeatable work, and
+ // Open the Jobs Board (W08 hooking W05), dailies, repeatable work, and
// the co-op vault heist, the same board every quest-giver NPC opens.
this.jobsBtn = el('button', {
class: 'cc-jobs-btn', type: 'button', title: 'Jobs Board: dailies, courier runs, and the vault heist',
@@ -1393,7 +1393,7 @@ export class CommunityUI {
'data-i18n-attr': 'title:play.jobs_title;aria-label:play.jobs_aria',
onclick: () => this.h.onJobs?.(),
}, [el('span', { class: 'cc-jobs-btn-ico', 'aria-hidden': 'true', text: '🎯' }), el('span', { class: 'cc-jobs-btn-text', text: 'Jobs', 'data-i18n': 'play.jobs' })]);
- // Friends panel (W09) — the account-level social graph: requests, live
+ // Friends panel (W09), the account-level social graph: requests, live
// presence across every coin world, and DM threads. The badge carries the
// unread-DM count so a message landing while the panel is closed still
// shows; the button is also the touch equivalent of the J hotkey, since
@@ -1485,7 +1485,7 @@ export class CommunityUI {
]);
this.chatHead = head;
this.chat = el('div', { id: 'cc-chat', role: 'region', 'aria-label': 'Chat', 'data-i18n-attr': 'aria-label:play.chat' }, [head, this.chatBody]);
- // Default: collapsed on touch (small screens), open on desktop — unless the
+ // Default: collapsed on touch (small screens), open on desktop, unless the
// user has expressed a preference before.
const stored = lsGet('cc-chat-min');
this._unread = 0;
@@ -1515,7 +1515,7 @@ export class CommunityUI {
this.voiceLabel,
]);
- // Power saver — one shared preference across every three.ws 3D surface
+ // Power saver, one shared preference across every three.ws 3D surface
// (also read by /club). Caps the render loop at 30fps and drops to the
// cheapest render state so laptops stay cool and quiet. The button both
// toggles and mirrors the preference, so a change made on another page
@@ -1532,7 +1532,7 @@ export class CommunityUI {
]);
onPowerSaverChange((on) => this.powerBtn.setAttribute('aria-pressed', on ? 'true' : 'false'));
- // Photo mode — capture the world (never the chrome) onto a share card.
+ // Photo mode, capture the world (never the chrome) onto a share card.
// Survives zen mode by design (see the zen block in coincommunities.css):
// a clean world is exactly when someone wants the shot. The host loads
// src/game/photo-mode.js on the first press, so nothing here costs a
@@ -1575,7 +1575,7 @@ export class CommunityUI {
]);
document.body.appendChild(this.zenExit);
- // Dance floor button — hidden until the player steps onto the pad.
+ // Dance floor button, hidden until the player steps onto the pad.
this.danceBtnLabel = el('span', { class: 'cc-dance-label', text: 'Dance', 'data-i18n': 'play.dance' });
this.danceBtn = el('button', {
class: 'cc-dance-btn', type: 'button', hidden: true,
@@ -1671,14 +1671,14 @@ export class CommunityUI {
// ── King of the Totem HUD (R07) ───────────────────────────────────────────
// Top-centre panel: round countdown, who holds the totem, a live scoreboard
// (your row highlighted, the king crowned), and a centre-screen winner banner.
- // Every value here is server-authoritative — the HUD only renders the last
+ // Every value here is server-authoritative, the HUD only renders the last
// snapshot and runs a local countdown between the per-second broadcasts.
_buildKingHud() {
this._kingTimer = el('div', { class: 'cc-king-timer', text: '1:30' });
this._kingTimerCap = el('div', { class: 'cc-king-timer-cap', text: 'round time' });
// aria-live on the status line only (not the whole panel) so a screen reader
- // announces phase changes — "X holds the totem", "Round over" — without
+ // announces phase changes, "X holds the totem", "Round over", without
// reading the per-second countdown.
this._kingPhase = el('div', { class: 'cc-king-phase', 'aria-live': 'polite' });
this._kingBoard = el('div', { class: 'cc-king-board', role: 'list', 'aria-label': 'King of the Totem scoreboard' });
@@ -1719,7 +1719,7 @@ export class CommunityUI {
if (phase === 'idle') {
this._kingBoard.hidden = true;
this._kingEmpty.hidden = false;
- this._kingEmpty.textContent = 'Waiting for players — step onto the gold ring at the totem to start a round.';
+ this._kingEmpty.textContent = 'Waiting for players, step onto the gold ring at the totem to start a round.';
this._kingPhase.textContent = 'Waiting for players';
return;
}
@@ -1729,12 +1729,12 @@ export class CommunityUI {
this._renderKingBoard(scores, kingId, localId);
if (phase === 'intermission') {
- this._kingPhase.textContent = winner ? `🏆 ${winner.name} won the round` : 'Round over — nobody held it';
+ this._kingPhase.textContent = winner ? `🏆 ${winner.name} won the round` : 'Round over, nobody held it';
} else {
const kRow = kingId ? scores.find((s) => s.id === kingId) : null;
this._kingPhase.textContent = kingId
? (kingId === localId ? '👑 You hold the totem!' : `👑 ${kRow ? kRow.name : 'Someone'} holds the totem`)
- : 'Totem is open — claim it!';
+ : 'Totem is open, claim it!';
}
}
@@ -1744,7 +1744,7 @@ export class CommunityUI {
if (!c || !this._kingTimer) return;
const serverNow = Date.now() + c.skew;
if (c.phase === 'idle') {
- this._kingTimer.textContent = '—';
+ this._kingTimer.textContent = ', ';
this._kingTimer.classList.remove('cc-king-low');
this._kingTimerCap.textContent = 'waiting';
return;
@@ -1819,7 +1819,7 @@ export class CommunityUI {
const btn = el('button', {
class: 'cc-st-piece' + (p.id === null ? ' cc-on' : ''), type: 'button',
role: 'radio', 'aria-checked': p.id === null ? 'true' : 'false',
- title: p.id === null ? 'Single block' : `${p.name} — one-click structure (R rotates)`,
+ title: p.id === null ? 'Single block' : `${p.name}, one-click structure (R rotates)`,
'aria-label': p.name,
onclick: () => this.h.onPickPiece?.(p.id),
}, [
@@ -2048,7 +2048,7 @@ export class CommunityUI {
const btn = el('button', {
class: 'cc-prop', type: 'button',
role: 'radio', 'aria-checked': 'false',
- title: `${p.name} — place a prop (R rotates, break mode removes yours)`,
+ title: `${p.name}, place a prop (R rotates, break mode removes yours)`,
'aria-label': p.name,
onclick: () => this.h.onPickProp?.(this._activeProp === p.id ? null : p.id),
}, [ico, el('span', { class: 'cc-prop-name', text: p.name })]);
@@ -2097,7 +2097,7 @@ export class CommunityUI {
}
// Drop every streamed gallery button (keeping built-in props) and re-page from the
- // top — used when the search query changes.
+ // top, used when the search query changes.
_resetGallery() {
for (const [id, btn] of this._propBtns) {
if (id.startsWith(GALLERY_PROP_PREFIX)) { btn.remove(); this._propBtns.delete(id); }
@@ -2132,7 +2132,7 @@ export class CommunityUI {
this._setGalleryStatus(count ? '' : (g.q ? `No models match “${g.q}”.` : 'No community models yet.'), false);
} catch (e) {
log.warn('[cc-ui] gallery load failed', e?.message || e);
- this._setGalleryStatus('Couldn’t load models — tap to retry.', true);
+ this._setGalleryStatus('Couldn’t load models, tap to retry.', true);
this._galleryMore.hidden = true;
} finally {
g.loading = false;
@@ -2160,7 +2160,7 @@ export class CommunityUI {
// ---- player-uploaded props (P3.3) ---------------------------------------------
/**
* Add an uploaded model to the palette as a first-class prop button and select
- * it, so the next click in the world places it. Idempotent per model id — a
+ * it, so the next click in the world places it. Idempotent per model id, a
* re-upload of the same file re-selects the existing button instead of stacking
* duplicates.
* @param {{id:string,name?:string,thumbnail?:string}} def
@@ -2230,7 +2230,7 @@ export class CommunityUI {
[el('span', { 'aria-hidden': 'true', text: '🔗' }), document.createTextNode('Copy link')]);
copyBtn.addEventListener('click', async () => {
try { await navigator.clipboard.writeText(link); setStatus('Link copied to clipboard.', 'ok'); }
- catch { setStatus('Couldn’t copy — select and copy the link manually.', 'warn'); }
+ catch { setStatus('Couldn’t copy, select and copy the link manually.', 'warn'); }
});
const dlBtn = el('a', {
@@ -2250,7 +2250,7 @@ export class CommunityUI {
setStatus('Published! It’s now in this world’s featured builds.', 'ok');
publishBtn.textContent = '✓ Published';
} else {
- setStatus(res?.error || 'Couldn’t publish — try again.', 'warn');
+ setStatus(res?.error || 'Couldn’t publish, try again.', 'warn');
publishBtn.disabled = false;
}
};
@@ -2382,12 +2382,12 @@ export class CommunityUI {
setVoiceState(state) {
if (!this.voiceBtn) return;
const map = {
- off: ['Voice', 'Join voice — talk to people near you'],
+ off: ['Voice', 'Join voice, talk to people near you'],
connecting: ['Connecting…', 'Requesting microphone access…'],
- on: ['Mic on', 'You’re live — click to mute'],
- muted: ['Muted', 'Muted — click to unmute (you can still hear everyone)'],
- denied: ['Mic blocked', 'Microphone blocked — allow it in your browser settings'],
- error: ['Voice error', 'Couldn’t start voice — check your mic and try again'],
+ on: ['Mic on', 'You’re live, click to mute'],
+ muted: ['Muted', 'Muted, click to unmute (you can still hear everyone)'],
+ denied: ['Mic blocked', 'Microphone blocked, allow it in your browser settings'],
+ error: ['Voice error', 'Couldn’t start voice, check your mic and try again'],
unsupported:['No voice', 'Voice chat isn’t supported in this browser'],
};
const [label, title] = map[state] || map.off;
@@ -2438,10 +2438,10 @@ export class CommunityUI {
onclick: () => this.h.onEmote(e.name),
}));
}
- // Wheel launcher — opens the full radial emote wheel.
+ // Wheel launcher, opens the full radial emote wheel.
this.wheelBtn = el('button', {
class: 'cc-emote cc-emote-wheel-btn', type: 'button',
- 'aria-label': 'All emotes — open emote wheel (hold Q)',
+ 'aria-label': 'All emotes, open emote wheel (hold Q)',
title: 'All emotes (hold Q)',
text: '⋯',
onclick: () => this.openEmoteWheel(),
@@ -2499,7 +2499,7 @@ export class CommunityUI {
const SVG_SIZE = 300; const OUTER_R = 148; const INNER_R = 54;
const cxy = SVG_SIZE / 2;
- // SVG background arcs — one donut sector per category (68° each).
+ // SVG background arcs, one donut sector per category (68° each).
const svgNS = 'http://www.w3.org/2000/svg';
const svg = document.createElementNS(svgNS, 'svg');
svg.setAttribute('viewBox', `0 0 ${SVG_SIZE} ${SVG_SIZE}`);
@@ -2531,7 +2531,7 @@ export class CommunityUI {
]);
});
- // Center label — updated on hover / keyboard navigation.
+ // Center label, updated on hover / keyboard navigation.
this._ewCenterEl = el('div', {
class: 'cc-ew-center', 'aria-live': 'polite', 'aria-atomic': 'true',
}, [
@@ -2539,7 +2539,7 @@ export class CommunityUI {
el('span', { class: 'cc-ew-center-txt', text: 'Move to select' }),
]);
- // Per-category clip grids — one panel per category, shown for the active one.
+ // Per-category clip grids, one panel per category, shown for the active one.
this._ewClipPanels = categories.map((cat) => {
const segs = cat.clips.map((d) =>
el('button', {
@@ -2595,7 +2595,7 @@ export class CommunityUI {
const rect = this._ewRing.getBoundingClientRect();
const dx = e.clientX - (rect.left + rect.width / 2);
const dy = e.clientY - (rect.top + rect.height / 2);
- if (Math.sqrt(dx * dx + dy * dy) < 44) return; // dead zone — no jitter at center
+ if (Math.sqrt(dx * dx + dy * dy) < 44) return; // dead zone, no jitter at center
const angle = (Math.atan2(dy, dx) * 180) / Math.PI;
let best = 0; let bestD = Infinity;
for (let i = 0; i < this._ewCategories.length; i++) {
@@ -2772,7 +2772,7 @@ export class CommunityUI {
// The latency readout is only meaningful while the link is live.
if (state !== 'online') this.pingText.hidden = true;
// Only expose the pill to the keyboard / label it as actionable while a
- // retry actually does something — otherwise it's a passive status readout.
+ // retry actually does something, otherwise it's a passive status readout.
const retryable = state === 'offline' || state === 'failed';
if (retryable) {
this.statusPill.setAttribute('tabindex', '0');
diff --git a/src/game/coincommunities.css b/src/game/coincommunities.css
index 6acdb0af8..038ffe8c6 100644
--- a/src/game/coincommunities.css
+++ b/src/game/coincommunities.css
@@ -1,10 +1,10 @@
-/* Coin Communities — 3D metaverse client UI: lobby + in-world HUD.
+/* Coin Communities, 3D metaverse client UI: lobby + in-world HUD.
Overlays the WebGL canvas. Self-contained tokens so /play stands alone.
Design language: MONOCHROME · SLEEK · SHARP.
Pure greyscale, near-black canvas, thin white hairlines, sharp corners,
inverted white-on-black calls to action, tight letter-spaced type. Colour is
- expressed only as light — white glow for "live", motion for state. */
+ expressed only as light, white glow for "live", motion for state. */
:root {
--cc-bg: #060607;
@@ -59,8 +59,8 @@ html, body {
-webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
/* Transparent embed: `?bg=transparent` (set on <html> by the play.html boot script)
- drops every opaque page-level fill so the world composites onto the host page —
- e.g. the IBM x402 showcase — instead of sitting in its own black box. The WebGL
+ drops every opaque page-level fill so the world composites onto the host page,
+ e.g. the IBM x402 showcase, instead of sitting in its own black box. The WebGL
canvas + sky are cleared engine-side (see coincommunities.js); these clear the
HTML/CSS layers above it. Lobby content panels keep their own fills. */
html[data-bg="transparent"], html[data-bg="transparent"] body { background: transparent; }
@@ -148,7 +148,7 @@ html[data-bg="transparent"] #cc-lobby {
font-size: 12px; letter-spacing: 0.08em; color: var(--cc-dim);
}
.kx-boot-coin-sym:empty { display: none; }
-/* The 3D avatar turntable — the loader's hero. Falls back to a soft glyph mark
+/* The 3D avatar turntable, the loader's hero. Falls back to a soft glyph mark
if WebGL or the avatar asset is unavailable (.kx-boot-noavatar). */
.kx-boot-stage {
position: relative; width: clamp(200px, 38vw, 264px);
@@ -182,7 +182,7 @@ html[data-bg="transparent"] #cc-lobby {
opacity: 0; transition: opacity 0.6s ease;
}
.kx-boot-stage.kx-boot-ready #kx-boot-avatar { opacity: 1; }
-/* Fallback mark — hidden unless WebGL/asset load fails. */
+/* Fallback mark, hidden unless WebGL/asset load fails. */
.kx-boot-fallback {
position: absolute; inset: 0; display: none; place-items: center;
font-size: 76px; line-height: 1; color: rgba(255, 255, 255, 0.9);
@@ -194,7 +194,7 @@ html[data-bg="transparent"] #cc-lobby {
color: var(--cc-dim); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
opacity: 0; animation: kx-rise 0.7s ease 0.34s forwards;
}
-/* Indeterminate progress sweep — a thin hairline that reads as "alive" without
+/* Indeterminate progress sweep, a thin hairline that reads as "alive" without
faking a percentage. */
.kx-boot-bar {
position: relative; width: 132px; height: 2px; margin: 20px auto 0;
@@ -236,18 +236,21 @@ html[data-bg="transparent"] #cc-lobby {
appearance: none; cursor: pointer; font: inherit;
background: var(--cc-accent); color: var(--cc-ink);
border: 0; border-radius: var(--cc-radius);
- padding: 9px 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
+ /* Thumb-sized: this is the recovery button on a screen that has already
+ failed once, often on the phone the failure happened on. */
+ min-height: 44px; padding: 9px 20px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.kx-boot-error-btn:hover { box-shadow: var(--cc-glow); transform: translateY(-1px); }
.kx-boot-error-btn:active { transform: translateY(0); opacity: 0.9; }
.kx-boot-error-btn:focus-visible { outline: 2px solid var(--cc-edge-hi); outline-offset: 2px; }
.kx-boot-error-link {
+ display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
color: var(--cc-dim); font-size: 13px; text-decoration: none;
- border-bottom: 1px solid var(--cc-edge-soft); padding-bottom: 1px;
- transition: color 0.12s ease, border-color 0.12s ease;
+ box-shadow: inset 0 -1px 0 var(--cc-edge-soft);
+ transition: color 0.12s ease, box-shadow 0.12s ease;
}
-.kx-boot-error-link:hover { color: var(--cc-text); border-color: var(--cc-edge-hi); }
+.kx-boot-error-link:hover { color: var(--cc-text); box-shadow: inset 0 -1px 0 var(--cc-edge-hi); }
.kx-boot-error-link:focus-visible { outline: 2px solid var(--cc-edge-hi); outline-offset: 2px; border-radius: 1px; }
/* ---------------- lobby ---------------- */
@@ -510,7 +513,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-avatar-chip.cc-avatar-upload.cc-on,
.cc-avatar-chip.cc-avatar-gallery.cc-on { border-color: #fff; }
-/* browse-gallery button — mirrors the upload button so the avatar bar reads as
+/* browse-gallery button, mirrors the upload button so the avatar bar reads as
one set of equal-weight actions */
.cc-gallery-btn {
display: inline-flex; align-items: center; gap: 7px; flex: none; cursor: pointer; user-select: none;
@@ -524,7 +527,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-gallery-ico { font-size: 13px; line-height: 1; }
.cc-gallery-btn.cc-busy { pointer-events: none; opacity: 0.65; }
-/* create-avatar — the headline action in the bar. Filled white so it reads as
+/* create-avatar, the headline action in the bar. Filled white so it reads as
the primary path; spans the bar so it never competes with the equal-weight
secondary actions (gallery / upload / paste) below it. */
.cc-create-btn {
@@ -552,10 +555,10 @@ html[data-bg="transparent"] #cc-lobby {
.cc-create-btn.cc-busy .cc-create-ico { animation: none; }
}
-/* freshly-created avatar chip — selected ring matches the other adopted chips */
+/* freshly-created avatar chip, selected ring matches the other adopted chips */
.cc-avatar-chip.cc-avatar-created.cc-on { border-color: #fff; }
-/* create-avatar method chooser — a focused modal over the lobby */
+/* create-avatar method chooser, a focused modal over the lobby */
.cc-create-overlay {
position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
background: rgba(4, 4, 5, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
@@ -613,7 +616,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-create-card-ico { width: 36px; height: 36px; font-size: 17px; }
}
-/* Holders world entry — a persistent badge on each coin card, top-right opposite
+/* Holders world entry, a persistent badge on each coin card, top-right opposite
the LIVE/OFFICIAL badge. Always visible so the gated room is discoverable on
touch (where the hover CTA never appears). */
.cc-card-holders {
@@ -629,7 +632,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-card-holders-ico { font-size: 10px; line-height: 1; }
.cc-card-featured .cc-card-holders { top: 12px; right: 12px; }
-/* In-world tier badge in the coin banner — present only in the Holders world. */
+/* In-world tier badge in the coin banner, present only in the Holders world. */
.cc-tier-badge {
display: inline-flex; align-items: center; gap: 5px;
background: #fff; color: var(--cc-ink); border-radius: var(--cc-radius-sm);
@@ -637,7 +640,7 @@ html[data-bg="transparent"] #cc-lobby {
white-space: nowrap; box-shadow: var(--cc-glow);
}
-/* Holder gate overlay — mirrors the create modal's chrome + motion. The scene
+/* Holder gate overlay, mirrors the create modal's chrome + motion. The scene
drives its states (checking / working / granted / short / auth / wallet / error)
via setHolderGate(); buttons report back through onHolderAction(). */
.cc-gate-overlay {
@@ -788,7 +791,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-card-cta { background: #fff; border-color: #fff; color: var(--cc-ink); }
}
-/* Featured / official town — the pinned flagship. Spans the full first row as a
+/* Featured / official town, the pinned flagship. Spans the full first row as a
hero: art on the left, identity on the right, with a bright persistent frame
so it reads as the front door rather than just another card. */
.cc-card-featured {
@@ -847,7 +850,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-state .cc-spinner-lg { margin: 0 auto 14px; width: 28px; height: 28px; }
/* Trailing "searching all of pump.fun" row shown under the live grid while a
- remote search resolves — the trending hits are already interactive. */
+ remote search resolves, the trending hits are already interactive. */
.cc-search-more {
grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
gap: 10px; padding: 18px 12px; color: var(--cc-dim);
@@ -906,12 +909,12 @@ html[data-bg="transparent"] #cc-lobby {
#cc-status[data-state="connecting"] .cc-dot { background: var(--cc-warn); animation: cc-pulse 1s infinite; }
#cc-status[data-state="offline"] .cc-dot, #cc-status[data-state="failed"] .cc-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cc-dim); }
#cc-status[data-state="offline"], #cc-status[data-state="failed"] { cursor: pointer; }
-/* No server configured for this env — passive solo readout, not retryable. */
+/* No server configured for this env, passive solo readout, not retryable. */
#cc-status[data-state="unavailable"] .cc-dot { background: var(--cc-faint); }
#cc-status[data-state="unavailable"] { cursor: default; }
@keyframes cc-pulse { 50% { opacity: 0.3; } }
-/* spatial voice toggle — top-right, tucked under the status pill */
+/* spatial voice toggle, top-right, tucked under the status pill */
.cc-voice {
position: fixed; top: 96px; right: 14px; z-index: 22;
display: inline-flex; align-items: center; gap: 8px;
@@ -950,7 +953,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-label.cc-speaking::before { animation: none; }
}
-/* power saver — under the voice toggle, same visual family */
+/* power saver, under the voice toggle, same visual family */
.cc-power-btn {
position: fixed; top: 140px; right: 14px; z-index: 22;
display: inline-flex; align-items: center; gap: 8px;
@@ -966,7 +969,7 @@ html[data-bg="transparent"] #cc-lobby {
.cc-power-ico { line-height: 1; }
.cc-power-label { line-height: 1; }
-/* photo mode — bottom of the top-right stack (voice · eco · zen · photo).
+/* photo mode, bottom of the top-right stack (voice · eco · zen · photo).
The preview sheet it opens is styled in src/game/photo-mode.css, which ships
with the lazily-imported module; only the trigger lives here. */
.cc-photo-hud-btn {
@@ -995,7 +998,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-photo-hud-btn { transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease; }
}
-/* chat sidebar — dockable, minimizable, persistent log */
+/* chat sidebar, dockable, minimizable, persistent log */
#cc-chat {
position: fixed; right: calc(14px + var(--cc-safe-r)); bottom: calc(14px + var(--cc-safe-b) + var(--cc-kb));
width: min(340px, 82vw);
@@ -1036,7 +1039,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-chat-log::-webkit-scrollbar { width: 5px; }
.cc-chat-log::-webkit-scrollbar-thumb { background: var(--cc-edge); border-radius: 0; }
.cc-chat-log:empty::before {
- content: "No messages yet — say hi"; color: var(--cc-faint); font-size: 12px; letter-spacing: 0.02em;
+ content: "No messages yet, say hi"; color: var(--cc-faint); font-size: 12px; letter-spacing: 0.02em;
margin: auto; padding: 18px 0; text-align: center;
}
.cc-chat-msg {
@@ -1081,7 +1084,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-emote:active { transform: translateY(-1px) scale(0.9); }
.cc-emote:focus-visible { outline: 1px solid var(--cc-accent); outline-offset: 2px; }
-/* reaction bar (R04) — sits just above the emote tray */
+/* reaction bar (R04), sits just above the emote tray */
#cc-reactions {
position: fixed; left: 50%; bottom: calc(82px + var(--cc-safe-b)); transform: translateX(-50%); z-index: 22;
display: flex; gap: 4px; background: var(--cc-panel); border: 1px solid var(--cc-edge);
@@ -1100,7 +1103,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* cooldown: briefly dims the tapped button so a rapid second tap reads as "not yet" */
.cc-reaction.cc-cooldown { opacity: 0.3; cursor: default; transform: none !important; pointer-events: none; }
-/* floating reaction sprite — rises above the sender's avatar head and fades out */
+/* floating reaction sprite, rises above the sender's avatar head and fades out */
.cc-reaction-sprite {
position: fixed; pointer-events: none; z-index: 25;
font-size: 28px; line-height: 1; transform: translate(-50%, -100%);
@@ -1155,7 +1158,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 90, 77, 0.6);
}
/* Verified three.ws account (W10): the @handle beside the display name marks a
- signed-in platform profile — click opens the real profile card. */
+ signed-in platform profile, click opens the real profile card. */
.cc-label .cc-label-handle {
margin-left: 5px; color: #9db8ff; font-weight: 600; font-size: 0.9em;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(90, 130, 255, 0.45);
@@ -1175,7 +1178,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-bubble::after { width: 7px; height: 7px; bottom: -18px; transform: translateX(-45%); }
@keyframes cc-bubble-in { from { opacity: 0; } }
-/* control hint — tucked under the coin banner (top-left), clear of every corner */
+/* control hint, tucked under the coin banner (top-left), clear of every corner */
#cc-hint {
position: fixed; left: 14px; top: 82px; z-index: 19;
color: var(--cc-dim); font-size: 11px; line-height: 1.7; letter-spacing: 0.02em;
@@ -1187,7 +1190,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
padding: 1px 5px; font-size: 10px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--cc-text);
}
-/* movement stick — bottom-left, always on (touch + mouse). Subtle on desktop,
+/* movement stick, bottom-left, always on (touch + mouse). Subtle on desktop,
full strength on touch. Sits opposite the chat (bottom-right) so they never overlap. */
#cc-joystick {
position: fixed; left: calc(22px + var(--cc-safe-l)); bottom: calc(90px + var(--cc-safe-b));
@@ -1225,7 +1228,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* Phone HUD reflow into three non-overlapping zones so movement, chat, and
emotes are all usable. On a narrow screen the old layout (centered emote
tray + 72vw chat) overlapped the bottom-left joystick and stacked the emote
- tray on top of the chat input — making both the stick and typing dead. */
+ tray on top of the chat input, making both the stick and typing dead. */
/* Movement stick: bottom-left, on top of everything, in a clear zone. */
#cc-joystick {
@@ -1242,7 +1245,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* Emotes: compact, horizontally scrollable, pinned bottom-right just above the
collapsed chat pill and clear of the joystick. The expanded chat (higher z)
- covers it — collapse chat to emote, which is the natural one-or-the-other. */
+ covers it, collapse chat to emote, which is the natural one-or-the-other. */
#cc-emotes {
left: auto; right: calc(10px + var(--cc-safe-r)); bottom: calc(58px + var(--cc-safe-b) + var(--cc-kb));
transform: none; z-index: 23;
@@ -1263,7 +1266,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
#cc-reactions .cc-reaction { flex: 0 0 auto; width: 34px; height: 34px; font-size: 17px; }
}
-/* Adventure-mode link — entry from the social lobby into the isometric MMO (/game). */
+/* Adventure-mode link, entry from the social lobby into the isometric MMO (/game). */
.cc-adventure {
display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
padding: 8px 14px; border-radius: var(--cc-radius); color: var(--cc-text);
@@ -1353,7 +1356,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* The native buy/sell modal (.cc-buy-overlay and descendants) ships its own
styles via src/game/coin-buy.css, imported by coin-buy.js when the modal is
- opened — so it carries itself to any surface (the /play world, the pump.fun
+ opened, so it carries itself to any surface (the /play world, the pump.fun
visualizer, …), not only pages that load this stylesheet. */
@media (max-width: 640px) {
@@ -1551,7 +1554,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
letter-spacing: 0.01em;
}
-/* Block-budget meter — a thin fill bar plus an "N / 6000" readout. */
+/* Block-budget meter, a thin fill bar plus an "N / 6000" readout. */
.cc-build-budget {
display: flex;
align-items: center;
@@ -1593,7 +1596,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
font-weight: 600;
}
-/* Durability badge — "Saved for everyone" vs "This session only". */
+/* Durability badge, "Saved for everyone" vs "This session only". */
.cc-build-durability {
font-size: 10.5px;
letter-spacing: 0.02em;
@@ -1604,7 +1607,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
color: #8fe9a8;
}
-/* Per-player allowance meter (R19) — "You: N / cap", mirrors the world budget
+/* Per-player allowance meter (R19), "You: N / cap", mirrors the world budget
bar but tracks only this player's own blocks against their personal cap. */
.cc-build-mine {
display: flex;
@@ -1647,7 +1650,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
color: #ffb3b3;
}
-/* Creator moderation row (R19) — only revealed to the coin creator. */
+/* Creator moderation row (R19), only revealed to the coin creator. */
.cc-build-mod {
display: flex;
align-items: center;
@@ -2054,7 +2057,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* ---------------- play gate (wallet sign-in) ----------------
Stands in front of /play when the platform token gate is on. Monochrome,
- sharp, white-on-black CTAs — same language as the lobby. Sits above the boot
+ sharp, white-on-black CTAs, same language as the lobby. Sits above the boot
loader (z 80) and every HUD layer. */
.pg-root {
position: fixed; inset: 0; z-index: 200;
@@ -2135,7 +2138,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.pg-btn-ghost { color: var(--cc-dim); }
.pg-btn-ghost:hover { color: var(--cc-text); }
-/* quiet text action — "try a different wallet" */
+/* quiet text action, "try a different wallet" */
.pg-link {
-webkit-appearance: none; appearance: none; cursor: pointer;
margin: 10px 0 0; padding: 4px 6px;
@@ -2147,7 +2150,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.pg-link:hover { color: var(--cc-dim); }
.pg-link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--cc-bg), 0 0 0 4px var(--cc-edge-hi); }
-/* step dots — 3-step progress indicator in working state */
+/* step dots, 3-step progress indicator in working state */
.pg-steps {
display: flex; gap: 7px; margin-bottom: 18px;
}
@@ -2212,7 +2215,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
/* ───────────────────────── Cosmetics shop (R21) ─────────────────────────
In-world panel: browse the cosmetics catalog, filter by rarity, preview a
- cosmetic live on your own avatar before buying. Monochrome system — rarity
+ cosmetic live on your own avatar before buying. Monochrome system, rarity
reads through border intensity + glow, not hue (light is the only colour). */
/* The HUD shop-open button, seated in the coin banner next to Buy. */
@@ -2231,7 +2234,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-shop-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cc-shop-btn-ico { font-size: 14px; line-height: 1; }
-/* "My Fits" wardrobe button (R23) — mirrors the shop button. */
+/* "My Fits" wardrobe button (R23), mirrors the shop button. */
.cc-wardrobe-btn {
flex: none; pointer-events: auto;
display: inline-flex; align-items: center; gap: 7px;
@@ -2248,7 +2251,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-wardrobe-btn-ico { font-size: 14px; line-height: 1; }
@media (max-width: 480px) { .cc-wardrobe-btn-text { display: none; } }
-/* "Avatar" switcher button — mirrors the shop/wardrobe buttons; is-active marks
+/* "Avatar" switcher button, mirrors the shop/wardrobe buttons; is-active marks
the drawer open (aria-expanded is set alongside by setAvatarPanelOpen). */
.cc-avatarbtn {
flex: none; pointer-events: auto;
@@ -2267,7 +2270,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-avatarbtn-ico { font-size: 14px; line-height: 1; }
@media (max-width: 480px) { .cc-avatarbtn-text { display: none; } }
-/* "Jobs" board button (W08) — mirrors the shop/wardrobe buttons. */
+/* "Jobs" board button (W08), mirrors the shop/wardrobe buttons. */
.cc-jobs-btn {
flex: none; pointer-events: auto;
display: inline-flex; align-items: center; gap: 7px;
@@ -2283,7 +2286,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-jobs-btn-ico { font-size: 14px; line-height: 1; }
@media (max-width: 480px) { .cc-jobs-btn-text { display: none; } }
-/* "Friends" button (W09) — mirrors the jobs/shop/wardrobe buttons, plus an
+/* "Friends" button (W09), mirrors the jobs/shop/wardrobe buttons, plus an
unread-DM badge and an active state while the panel is open. */
.cc-friends-btn {
position: relative;
@@ -2303,7 +2306,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-friends-btn-ico { font-size: 14px; line-height: 1; }
@media (max-width: 480px) { .cc-friends-btn-text { display: none; } }
-/* Unread badge — absolutely positioned so it never reflows the button (and so it
+/* Unread badge, absolutely positioned so it never reflows the button (and so it
survives the 480px breakpoint that hides the label). */
.cc-friends-badge {
position: absolute; top: -5px; right: -5px;
@@ -2476,7 +2479,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-avsw-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cc-avsw-upload:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
-/* Creator-only holders-gate button (R24) — mirrors the shop button, accented. */
+/* Creator-only holders-gate button (R24), mirrors the shop button, accented. */
.cc-gate-cfg-btn {
flex: none; pointer-events: auto;
display: inline-flex; align-items: center; gap: 7px;
@@ -2533,7 +2536,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-shop-title-main { font-size: 17px; font-weight: 800; letter-spacing: 0.01em; }
.cc-shop-title-sub { font-size: 12px; color: var(--cc-dim); }
-/* "Rarest Fits" button — opens the R25 flex board as a lazy chunk. Sits in
+/* "Rarest Fits" button, opens the R25 flex board as a lazy chunk. Sits in
the shop header between the title and close. On mobile the text is hidden,
leaving a compact glyph-only button that still has a full aria-label. */
.cc-shop-flex {
@@ -2580,7 +2583,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
padding: 12px 2px 8px; font-size: 11.5px; color: var(--cc-faint);
letter-spacing: 0.12em; text-transform: uppercase;
}
-/* Purchase feedback (R22) — overrides the neutral count line while a buy resolves. */
+/* Purchase feedback (R22), overrides the neutral count line while a buy resolves. */
.cc-shop-status[data-kind="pending"] { color: var(--cc-text); }
.cc-shop-status[data-kind="ok"] { color: #cfe9d4; }
.cc-shop-status[data-kind="error"] { color: #e7b3b3; }
@@ -2605,7 +2608,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
border-color: var(--cc-accent); box-shadow: var(--cc-glow);
}
-/* The thumb is a real button (preview toggle) — reset the UA chrome so it reads
+/* The thumb is a real button (preview toggle), reset the UA chrome so it reads
as the image tile it replaces. */
.cc-shop-thumb-btn {
appearance: none; -webkit-appearance: none;
@@ -2649,7 +2652,7 @@ body.is-zen #cc-photo-btn:hover, body.is-zen #cc-photo-btn:focus-visible { opaci
.cc-shop-meta { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 11px; }
.cc-shop-name { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
-/* The item's value, quoted in $THREE — the only coin. */
+/* The item's value, quoted in $THREE, the only coin. */
.cc-shop-value { font-size: 11px; font-weight: 700; color: var(--cc-dim); letter-spacing: 0.02em; }
/* Buy / Owned action (R22). The action is its own focusable control, distinct
@@ -3042,7 +3045,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
}
.cc-emote-wheel-btn:focus-visible { outline: 1px solid var(--cc-accent); outline-offset: 2px; }
-/* Overlay — full screen, captures pointer events while wheel is open */
+/* Overlay, full screen, captures pointer events while wheel is open */
#cc-emote-wheel {
position: fixed; inset: 0; z-index: 50;
display: grid; place-items: center;
@@ -3050,14 +3053,14 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
}
#cc-emote-wheel.cc-on { opacity: 1; pointer-events: auto; }
-/* Backdrop — semi-transparent blur, click closes without playing */
+/* Backdrop, semi-transparent blur, click closes without playing */
.cc-ew-bg {
position: absolute; inset: 0;
background: rgba(4, 4, 5, 0.72);
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
-/* Wheel container — all child elements position relative to this center */
+/* Wheel container, all child elements position relative to this center */
.cc-ew-ring {
position: relative; z-index: 1;
width: 360px; height: 360px;
@@ -3081,7 +3084,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
fill: rgba(255, 255, 255, 0.14); stroke: rgba(255, 255, 255, 0.55);
}
-/* Category buttons — positioned via CSS custom properties set inline */
+/* Category buttons, positioned via CSS custom properties set inline */
.cc-ew-cat-btn {
position: absolute; top: 50%; left: 50%;
transform: translate(calc(-50% + var(--ew-x)), calc(-50% + var(--ew-y)));
@@ -3107,7 +3110,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
-/* Center label — shows selected category / emote name */
+/* Center label, shows selected category / emote name */
.cc-ew-center {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
display: flex; flex-direction: column; align-items: center; gap: 6px;
@@ -3119,7 +3122,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
color: var(--cc-dim); line-height: 1.3;
}
-/* Per-category clip panels — shown as a scrollable grid below the ring */
+/* Per-category clip panels, shown as a scrollable grid below the ring */
.cc-ew-clips {
position: absolute; bottom: -12px; left: 50%;
transform: translateX(-50%);
@@ -3158,7 +3161,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
-/* Close button — top-right of the ring */
+/* Close button, top-right of the ring */
.cc-ew-close {
position: absolute; top: 4px; right: 4px; z-index: 4;
width: 28px; height: 28px; border-radius: var(--cc-radius-sm); cursor: pointer;
@@ -3192,13 +3195,13 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
white-space: nowrap;
transition: opacity 0.2s ease;
}
-/* Local player variant — slightly larger so they see it on themselves */
+/* Local player variant, slightly larger so they see it on themselves */
.cc-it-marker--local {
font-size: 12px; padding: 3px 10px;
background: rgba(220, 30, 30, 0.95);
}
-/* Tag HUD panel — bottom-right, only visible when game is active */
+/* Tag HUD panel, bottom-right, only visible when game is active */
#cc-tag-hud {
position: fixed; bottom: 88px; right: 12px; z-index: 40;
background: var(--cc-panel);
@@ -3227,7 +3230,7 @@ select.npc-svc-input { cursor: pointer; appearance: none; -webkit-appearance: no
.cc-tag-row-time { color: var(--cc-dim); white-space: nowrap; }
.cc-tag-me .cc-tag-row-time { color: #ff8888; }
-/* "YOU'RE IT!" flash overlay — centered, only visible during the animation */
+/* "YOU'RE IT!" flash overlay, centered, only visible during the animation */
#cc-tag-alert {
position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
z-index: 200; pointer-events: none;
diff --git a/src/game/coincommunities.js b/src/game/coincommunities.js
index 42a6be790..5c620c28e 100644
--- a/src/game/coincommunities.js
+++ b/src/game/coincommunities.js
@@ -1,4 +1,4 @@
-// Coin Communities — 3D metaverse client (the /play scene).
+// Coin Communities, 3D metaverse client (the /play scene).
//
// Each pump.fun coin is its own multiplayer 3D world. You pick an avatar (or
// bring your own / your 3D agent), choose a coin in the lobby, and drop into
@@ -96,7 +96,7 @@ import { VehicleManager } from './vehicles.js';
import { CombatSystem } from './combat-system.js';
// localStorage throws in private mode and in third-party iframe contexts where
-// storage is blocked — exactly the `?bg=transparent` embed case (e.g. the IBM
+// storage is blocked, exactly the `?bg=transparent` embed case (e.g. the IBM
// x402 showcase). Guard every access so a blocked store degrades to defaults
// instead of throwing mid-boot. Same contract as the lsGet/lsSet helpers in
// play-onboard.js / play-intro.js / play-handoff.js.
@@ -130,7 +130,7 @@ function isPlausibleMint(mint) {
return SOLANA_MINT_RE.test(v) || EVM_ADDRESS_RE.test(v);
}
-// True when the keystroke belongs to an editable surface — a DM input in the
+// True when the keystroke belongs to an editable surface, a DM input in the
// friends panel, a search box, a modal field. World hotkeys must never fire
// there: `b` would toggle build mode mid-word and Space would be swallowed
// before it reached the caret. `chatFocused` covers only the in-world chat bar,
@@ -144,7 +144,7 @@ function isTypingTarget(t) {
// Enter and Space are the browser's activation gesture for whatever control has
// focus. Binding them globally to "open chat" and "jump" meant a keyboard-only
-// player could Tab to Shop, Friends, or any emote button and press Enter — and
+// player could Tab to Shop, Friends, or any emote button and press Enter, and
// the world would swallow it, so the button never fired and the HUD was
// reachable but not operable. Every other hotkey (WASD, E, Q, Z…) still runs
// while a control is focused, because movement has to keep working; only the
@@ -173,7 +173,7 @@ const CONFETTI_COLORS = ['#ffffff', '#e8e8e8', '#fff8e1', '#e3f2fd', '#f3e5f5',
// also sends these bounds in every game:king message; this is the render default.
const KING_ZONE = { x: 0, z: -12, r: 3.5 };
-// The Downtown plaza radius (matches world-zones.js DISTRICT.plazaRadius) — the
+// The Downtown plaza radius (matches world-zones.js DISTRICT.plazaRadius), the
// dressed circle world-env.js/district.js build around. W01: movement itself is
// no longer clamped to this disc; it's bounded by the much larger square
// DISTRICT/WORLD_BOUND (world-zones.js), which mirrors the server's own clamp so
@@ -201,7 +201,7 @@ const TRENDING_URL = '/api/pump/trending?limit=30';
const SEARCH_URL = '/api/pump/search';
const COIN_URL = '/api/pump/coin';
-// Normalize a raw pump.fun coin (trending feed or search results — both share
+// Normalize a raw pump.fun coin (trending feed or search results, both share
// the same upstream shape) into the compact record the lobby/world consume.
function mapCoins(raw) {
const list = Array.isArray(raw) ? raw : raw.data || raw.coins || raw.items || [];
@@ -235,7 +235,7 @@ class RemotePlayer {
this.rig.position.set(player.x, player.y, player.z);
scene.add(this.rig);
- // Public identity riding the server schema — who this peer is (name), the
+ // Public identity riding the server schema, who this peer is (name), the
// three.ws agent they pilot, their verified account wallet, and their
// verified three.ws username (W10, bound server-side from the signed
// presence ticket). These feed the avatar inspector (I / click a
@@ -281,7 +281,7 @@ class RemotePlayer {
// Tag mini-game (R08): red glow ring + 🏃 label for the "it" player.
this.isIt = !!player.it;
if (this.isIt) { this._addGlowRing(); this._addItLabel(); }
- // Combat (W07): downed peers lie flat (a lightweight ragdoll — no physics
+ // Combat (W07): downed peers lie flat (a lightweight ragdoll, no physics
// sim, just an honest "you're out" pose) and stop being nameplate-clickable
// targets; a wanted peer's nameplate carries their star count.
this.isDead = !!player.dead;
@@ -292,7 +292,7 @@ class RemotePlayer {
setAvatar(url) {
if (url === this._avatarUrl) return;
this._avatarUrl = url;
- // rebuild model — clearing the rig takes any worn cosmetics with it, so drop
+ // rebuild model, clearing the rig takes any worn cosmetics with it, so drop
// the old handle and re-apply once the new GLB has measured.
try { this.cosmetics?.dispose(); } catch {}
this.cosmetics = null;
@@ -303,7 +303,7 @@ class RemotePlayer {
this.rig.clear();
this.anim = new AnimationManager();
// Tag this load so a slower in-flight GLB can't attach to the rig after the
- // peer disposed or swapped avatars again — otherwise the resolved model
+ // peer disposed or swapped avatars again, otherwise the resolved model
// lands on a cleared/removed rig (orphaned mesh, or two models at once).
const token = (this._avatarToken = (this._avatarToken || 0) + 1);
const anim = this.anim;
@@ -318,7 +318,7 @@ class RemotePlayer {
this.applyCosmetics();
})).catch(() => {});
}
- // Dress this peer in their equipped loadout. Idempotent — re-applies only when
+ // Dress this peer in their equipped loadout. Idempotent, re-applies only when
// the wire actually changed, and waits for the avatar to measure (setAvatar
// calls it post-load). Reuses the same applyLoadout the local player and the
// creator use, so one wardrobe renders identically everywhere.
@@ -366,7 +366,7 @@ class RemotePlayer {
else { this._removeGlowRing(); this._removeItLabel(); }
}
// Downed pose (W07): tilt the rig onto its side rather than faking a physics
- // ragdoll no other part of the client has — an honest, cheap "you're out"
+ // ragdoll no other part of the client has, an honest, cheap "you're out"
// read that's unmistakable at a glance and costs nothing to reverse.
_applyDowned(down) {
this.rig.rotation.x = down ? -Math.PI / 2 : 0;
@@ -383,7 +383,7 @@ class RemotePlayer {
}
}
// Verified three.ws identity on the nameplate (W10): the @handle beside the
- // display name marks a signed-in platform account — the signal that clicking
+ // display name marks a signed-in platform account, the signal that clicking
// opens a real profile you can follow and message, not just a guest card.
_updateHandleBadge() {
if (this.username) {
@@ -505,7 +505,7 @@ export class CoinCommunities {
// Heat control (same system as /club): rAF fires at the display refresh
// rate, so an uncapped loop on a 120/144Hz panel renders 2-2.4x the
- // frames of a 60Hz one for no visible gain — that alone makes laptops
+ // frames of a 60Hz one for no visible gain, that alone makes laptops
// run hot. The governor caps real frame work at 60fps in-world, 30 when
// the window loses focus, 30 under the shared power-saver preference,
// and a near-idle trickle while the opaque lobby fully covers the
@@ -514,10 +514,10 @@ export class CoinCommunities {
this._focus = trackWindowFocus();
this._powerSaver = getPowerSaver();
// Boot-time quality tier from real capability signals (deviceMemory,
- // cores, coarse pointer — same detector /club uses), then a watchdog
+ // cores, coarse pointer, same detector /club uses), then a watchdog
// that steps the tier down on sustained slow frames and climbs it
// back (capped at the booted tier) once frames recover, so a single
- // load-time hitch doesn't pin the pixel ratio low — and the 3D soft —
+ // load-time hitch doesn't pin the pixel ratio low, and the 3D soft,
// for the whole session. Applied to the renderer in _applyPerfTier.
this._perfTier = detectProfile();
this._watchdog = createFrameWatchdog({
@@ -561,7 +561,7 @@ export class CoinCommunities {
// Embed mode: `?biome=<id>` pins every world this session renders to one
// curated look (e.g. `noir` for a dark host surface) instead of the per-coin
- // seeded biome — so a /play embed on a partner page stays visually consistent
+ // seeded biome, so a /play embed on a partner page stays visually consistent
// with that page. Validated against the biome table; an unknown id is ignored
// and the normal seeded look is used, so default play is unaffected.
this._biomePin = new URLSearchParams(location.search).get('biome') || null;
@@ -606,9 +606,9 @@ export class CoinCommunities {
// In-world avatar switcher: change your look without leaving the world.
onAvatarPanel: () => this._toggleAvatarPanel(),
onJobs: () => this._toggleQuests(),
- // Friends panel (W09) — presence + DMs across every coin world.
+ // Friends panel (W09), presence + DMs across every coin world.
onFriends: () => this._toggleFriends(),
- // Cold-open intro's zero-friction path — drop straight into the $THREE
+ // Cold-open intro's zero-friction path, drop straight into the $THREE
// home town with whatever avatar/name is already defaulted, no picking
// required. See play-intro.js and _dropIn() below.
onDropIn: () => this._dropIn(),
@@ -638,10 +638,10 @@ export class CoinCommunities {
});
// Collaborative building HUD (hotbar + place/break toggle). Hidden until the
- // player is in a world and connected — there's nowhere to build otherwise.
+ // player is in a world and connected, there's nowhere to build otherwise.
this.buildType = 0;
// R20 structures: which composite piece is armed (null = single block) and the
- // quarter-turn rotation (0–3) applied to it. Both drive the ghost preview.
+ // quarter-turn rotation (0, 3) applied to it. Both drive the ghost preview.
this.buildPiece = null;
this.buildRot = 0;
// R18 props: which placeable prop is armed (null = voxel layer active), its
@@ -656,7 +656,7 @@ export class CoinCommunities {
onModeChange: () => this._refreshGhost(),
onClearArea: (scope) => this._onClearArea(scope),
});
- // Build permissions (R19) — refreshed from the server's build-perms snapshot:
+ // Build permissions (R19), refreshed from the server's build-perms snapshot:
// the player's per-world block cap + usage, and whether they're the coin creator
// (which unlocks the clear-area moderation tool). Solo builds carry no cap.
this._buildPerms = this._defaultBuildPerms();
@@ -671,7 +671,7 @@ export class CoinCommunities {
// First-ten-seconds cold open (see play-intro.js header for the audit finding
// this fixes): a first-time visitor otherwise lands on a bare coin grid with
// no context and bounces. Shown once per browser; the reopener in the lobby
- // header brings it back any time. NOT shown on a `?coin=<mint>` deep link —
+ // header brings it back any time. NOT shown on a `?coin=<mint>` deep link,
// that visitor already made their choice (a shared world link) and "Drop in
// now" would silently redirect them to the $THREE home town instead of the
// world they clicked into, on top of it already loading behind the modal.
@@ -683,11 +683,11 @@ export class CoinCommunities {
requestAnimationFrame(this._loop);
// Wallet-first entry: when the platform has pinned a game token, the sign-in
- // gate stands in front of everything — connect a wallet, sign a nonce, and
+ // gate stands in front of everything, connect a wallet, sign a nonce, and
// hold ≥ the floor before any world opens. The verified wallet becomes the
// account id we carry into every room. When no token is pinned the gate
// resolves instantly (open /play) and nothing below changes. enter() awaits
- // this, so a deep link still drops in — just after the gate clears.
+ // this, so a deep link still drops in, just after the gate clears.
this.playPass = '';
this.account = '';
this._playReady = this._ensurePlayAccess();
@@ -695,7 +695,7 @@ export class CoinCommunities {
// Deep link: /play?coin=<mint>&name=&symbol=&image= drops straight into a
// coin's community, so a community is a shareable URL. An optional
// `?avatar=<glb|id>` rides along (used by "See in 3D" links) and is shown
- // for this session only — never persisted over the player's saved avatar.
+ // for this session only, never persisted over the player's saved avatar.
const p = new URLSearchParams(location.search);
this._urlAvatar = (p.get('avatar') || '').trim();
// Capture ?ui= before enter() canonicalises the URL (the share-link
@@ -752,7 +752,7 @@ export class CoinCommunities {
// W01: boot the shared Rapier world once. A flat ground collider covers the
// whole district (buildings are added per-coin in enter(), once the district
- // grid is built). Never throws — a WASM failure (unsupported browser, blocked
+ // grid is built). Never throws, a WASM failure (unsupported browser, blocked
// worker) degrades to the legacy direct-mutation movement path instead of
// wedging boot.
async _initPhysics() {
@@ -761,7 +761,7 @@ export class CoinCommunities {
this._physics.addGround(0, DISTRICT.half + 40);
this._physicsOk = true;
} catch (err) {
- log.warn('[coincommunities] physics init failed — falling back to legacy movement:', err?.message);
+ log.warn('[coincommunities] physics init failed, falling back to legacy movement:', err?.message);
this._physicsOk = false;
}
}
@@ -804,7 +804,7 @@ export class CoinCommunities {
}
// The flagship $THREE town is always pinned to the top of the lobby, even when
- // it isn't trending — it's the platform's front door. Show the static identity
+ // it isn't trending, it's the platform's front door. Show the static identity
// instantly so the card never flashes empty, then refresh name/art/market-cap
// live from pump.fun so the pin is real, not a hardcoded snapshot.
async _loadHomeTown() {
@@ -840,7 +840,7 @@ export class CoinCommunities {
// WebGL context creation fails on blocklisted GPUs, machines with
// hardware acceleration disabled, and some in-app/embedded browsers.
// Tag the failure so the boot guard can show a recovery message instead
- // of leaving the player on a dead loader — boot-avatar.js already
+ // of leaving the player on a dead loader, boot-avatar.js already
// degrades gracefully, and the main scene must too.
const e = new Error('WebGL unavailable: ' + (err?.message || err));
e.code = 'NO_WEBGL';
@@ -928,7 +928,7 @@ export class CoinCommunities {
// devicePixelRatio changes when the window moves to a display with a
// different density (retina laptop ↔ external 1x monitor) or the OS/browser
// zoom changes. That does NOT reliably fire a 'resize' event, so without
- // this the canvas keeps rendering at the old ratio — sharp becomes blurry,
+ // this the canvas keeps rendering at the old ratio, sharp becomes blurry,
// or a needlessly high ratio tanks the framerate. A resolution media query
// fires once when the current ratio stops matching; we re-sync and re-arm.
_watchDevicePixelRatio() {
@@ -944,7 +944,7 @@ export class CoinCommunities {
}
// Apply the current quality tier (or the power-saver floor) to the renderer.
- // Tier caps pixel ratio — the single biggest GPU cost on high-DPI screens —
+ // Tier caps pixel ratio, the single biggest GPU cost on high-DPI screens,
// and gates shadow maps. Power saver overrides everything with the cheapest
// state; turning it off restores the tier the watchdog last settled on.
_applyPerfTier() {
@@ -991,7 +991,7 @@ export class CoinCommunities {
// and the slowly turning coin totem.
_tickEnv(dt) {
this.env?.update(dt);
- // W01: real time of day, deterministic from wall-clock time (worldClock) —
+ // W01: real time of day, deterministic from wall-clock time (worldClock),
// every client in every world computes the identical sun/sky/lamp state
// with zero network sync, exactly like the /agent-screen ambient stage.
this._dayNight?.setTime(worldClock(Date.now()));
@@ -1075,14 +1075,14 @@ export class CoinCommunities {
return promise;
}
- // Central coin totem — the community's banner in 3D.
+ // Central coin totem, the community's banner in 3D.
_buildTotem(coin) {
const g = new Group();
const pillar = new Mesh(new CylinderGeometry(1.1, 1.4, 6, 24),
new MeshStandardMaterial({ color: 0x3a4a72, roughness: 0.6, metalness: 0.2 }));
pillar.position.y = 3; pillar.castShadow = true; pillar.receiveShadow = true;
g.add(pillar);
- // Floating coin disc with the token image — a warm gold coin that catches the
+ // Floating coin disc with the token image, a warm gold coin that catches the
// sun key, slowly turning. The token art rides on its faces.
const spin = new Group(); spin.position.y = 7.5;
const disc = new Mesh(new CylinderGeometry(2.2, 2.2, 0.3, 40),
@@ -1126,7 +1126,7 @@ export class CoinCommunities {
return m;
}
- // Stadium-style jumbotron — the coin's giant LED screen, towering over the
+ // Stadium-style jumbotron, the coin's giant LED screen, towering over the
// plaza so it's the first thing players see on entry. It shows the coin art,
// name, market cap, and a LIVE readout of how many are in the community right
// now (redrawn from _updateOnline as people join and leave). Built as a dark
@@ -1164,7 +1164,7 @@ export class CoinCommunities {
});
}
- // A LIVE bar that pulses along the panel's base (animated in _tickEnv) — the
+ // A LIVE bar that pulses along the panel's base (animated in _tickEnv), the
// cheap, always-moving signal that the room is live without redrawing canvas.
const pulse = new Mesh(new PlaneGeometry(W - 1.2, 0.16),
new MeshBasicMaterial({ color: 0xffffff, transparent: true, opacity: 0.6 }));
@@ -1189,7 +1189,7 @@ export class CoinCommunities {
}
// Render the jumbotron's text layer: coin name, symbol, market cap, and the
- // live community count. Cheap and event-driven — only called on build and when
+ // live community count. Cheap and event-driven, only called on build and when
// the online count changes, never per-frame.
_drawScreen() {
const canvas = this._screenCanvas;
@@ -1219,7 +1219,7 @@ export class CoinCommunities {
const colX = 770; // right text column
x.textAlign = 'left'; x.textBaseline = 'alphabetic';
- // Coin name — shrink the font until it fits the column width.
+ // Coin name, shrink the font until it fits the column width.
const name = (coin.name || 'Community').toUpperCase();
let nameSize = 116;
x.fillStyle = '#f5f5f6';
@@ -1249,7 +1249,7 @@ export class CoinCommunities {
x.fillText(mcap, colX, 588);
}
- // LIVE — N in this community.
+ // LIVE, N in this community.
const n = this._online || 1;
const baseY = 740;
x.fillStyle = '#ffffff';
@@ -1279,7 +1279,7 @@ export class CoinCommunities {
if (this.phase !== 'loading') return; // torn down while the gate was up
let tier = opts.tier === 'holders' ? 'holders' : 'general';
// Entry does several awaits (gate, manifest, avatar GLB, room connect) and
- // the Leave button goes live the moment the HUD shows — well before connect
+ // the Leave button goes live the moment the HUD shows, well before connect
// resolves. Stamp this attempt so a continuation that resumes after the
// player has backed out (leave() bumps the epoch) bails instead of
// resurrecting a torn-down world on a null `this.net`.
@@ -1288,7 +1288,7 @@ export class CoinCommunities {
// Holder worlds are gated: prove the player holds ≥ the floor of this coin
// before we build anything. The gate runs entirely in the lobby so a refusal
// leaves them exactly where they were, free to enter the General world
- // instead. A null result means they cancelled — stay put.
+ // instead. A null result means they cancelled, stay put.
let holderPass = '';
let holderMinUsd = 0;
let holderMinTokens = 0;
@@ -1356,9 +1356,9 @@ export class CoinCommunities {
|| (isHomeTown(coin.mint) ? (coin.biome || HOME_TOWN.biome) : undefined)
|| (isRobinhoodCoin(coin.mint) ? 'hoodchain' : undefined);
this.env = createWorldEnvironment(this.scene, this.renderer, WORLD_RADIUS, { mint: coin.mint, biome: biomeOverride });
- this.ui.toast(`${coin.symbol ? '$' + coin.symbol : coin.name || 'Community'} — ${this.env.biome.label}`, 'info');
+ this.ui.toast(`${coin.symbol ? '$' + coin.symbol : coin.name || 'Community'}, ${this.env.biome.label}`, 'info');
- // W01: the drivable street grid ringing Downtown — same seed as the biome
+ // W01: the drivable street grid ringing Downtown, same seed as the biome
// so it's identical for every client, themed from the same palette. The
// day/night cycle drives its window/streetlamp glow via setNight().
this._district = createDistrict(this.scene, {
@@ -1370,13 +1370,13 @@ export class CoinCommunities {
// resolved by the time a player clears the lobby + avatar load), then swap
// in this coin's building colliders and (re)place the kinematic character
// at the fresh spawn point. The character controller persists across coin
- // switches — only its colliders and position change.
+ // switches, only its colliders and position change.
await this._physicsReady;
if (this._physicsOk && this._physics) {
this._physics.clearObstacles();
for (const c of this._district.colliders) this._physics.addStaticBox(c);
// W02: the coin totem (built below by _buildTotem, always at (0,0,-12))
- // isn't part of the district grid, so give it its own collider — keeps
+ // isn't part of the district grid, so give it its own collider, keeps
// both pedestrians and driven vehicles from passing through the landmark.
this._physics.addStaticCylinder({ position: { x: 0, y: 3, z: -12 }, radius: 1.6, halfHeight: 3.2 });
const spawn = { x: this.localPos.x, y: 0, z: this.localPos.z };
@@ -1409,14 +1409,14 @@ export class CoinCommunities {
});
// Live trading terminal facing the spawn from past the totem: the coin's
// price chart, % change, volume, buy/sell flow, and a ticker of real
- // on-chain trades — a second screen players can walk up to and tap to open
+ // on-chain trades, a second screen players can walk up to and tap to open
// the coin on pump.fun. Identity jumbotron behind, market chart ahead. Its
// freshly-landed trades feed the reactor so the world reacts to the tape.
this._chartScreen = createChartScreen(this.scene, coin, {
position: [0, 0, -30], width: 18,
onTrades: (trades, metrics) => this._reactor?.ingestTrades(trades, metrics),
});
- // The /ibm/oracle 3D forecast line — the live $THREE price history + IBM
+ // The /ibm/oracle 3D forecast line, the live $THREE price history + IBM
// Granite TimeSeries forecast, rendered as a glowing ribbon standing in the
// world (no backdrop, just the line) that players can walk around.
this._oracleRibbon = mountOracleRibbon(this.scene, { x: 17, y: 4.2, z: -20, scale: 0.7 });
@@ -1427,7 +1427,7 @@ export class CoinCommunities {
this.localRig = new Group();
this.localRig.position.copy(this.localPos);
this.scene.add(this.localRig);
- // Cosmetics preview rig (R21) re-binds to whatever avatar is current —
+ // Cosmetics preview rig (R21) re-binds to whatever avatar is current,
// drop any prior session's manager so it attaches to this fresh skeleton.
this._accessoryMgr = null;
this._previewItem = null;
@@ -1446,7 +1446,7 @@ export class CoinCommunities {
// Connect to this coin's room. A locally-staged guest avatar (just created,
// not yet uploaded) can't be loaded by peers, so we join without one and
- // upload in the background — then broadcast the public URL so everyone sees
+ // upload in the background, then broadcast the public URL so everyone sees
// it. Otherwise broadcast a loadable URL/path directly.
const isGuest = avatarInput === GUEST_SENTINEL;
const netAvatar = isGuest
@@ -1486,8 +1486,8 @@ export class CoinCommunities {
getPresence: getPresenceTicket,
});
// Generic networked-object layer for this coin (R02): mirrors the server's
- // authoritative `objects` map into the scene — build props (R18), and any
- // future ball/pickup — interpolated like the avatars. Delete-own keys on the
+ // authoritative `objects` map into the scene, build props (R18), and any
+ // future ball/pickup, interpolated like the avatars. Delete-own keys on the
// net's ownership check. Built per world; disposed alongside voxels on leave.
this.worldObjects = new WorldObjects(this.scene, this.net, {
isMine: (obj) => !!this.net?.ownsObject(obj),
@@ -1505,7 +1505,7 @@ export class CoinCommunities {
this.net.on('synced', () => this._onRoomSynced());
// Coming back from a backgrounded tab is the one drop the socket never
// reports: iOS Safari suspends the page, the OS reaps the connection, and
- // no close event is ever delivered — the HUD keeps saying "connected" over
+ // no close event is ever delivered, the HUD keeps saying "connected" over
// a dead wire. Probe on every return to the foreground (and on the network
// coming back) so a two-minute tab switch resyncs like any other drop.
this._onResume = () => { if (!document.hidden) this.net?.resume(); };
@@ -1550,7 +1550,7 @@ export class CoinCommunities {
if (status !== 'online' && status !== 'connecting') this._armLocalWorldWriter();
// Durability badge: online reflects the server's persistent flag. Offline,
// props ARE durable now (they go straight to the world store), so the badge
- // reflects whether this client may actually write it — never a false promise.
+ // reflects whether this client may actually write it, never a false promise.
this.buildHud.setPersistent(
status === 'online'
? this.net?.persistent
@@ -1559,7 +1559,7 @@ export class CoinCommunities {
: null),
);
this._syncBudget();
- // A reconnect reissues every sessionId, stranding the voice mesh — refresh
+ // A reconnect reissues every sessionId, stranding the voice mesh, refresh
// our id, drop the stale peers, and re-announce so it re-forms.
if (status === 'online' && this.voice?.joined && this.net.sessionId !== this.voice.selfId) {
this.voice.setSelfId(this.net.sessionId);
@@ -1572,18 +1572,18 @@ export class CoinCommunities {
// the lobby with a clear reason rather than looping on a dead pass.
this.net.on('denied', (reason) => {
// The platform token gate evicted us (pass expired, or the wallet dropped
- // below the floor): force a fresh sign-in before they can play again — the
+ // below the floor): force a fresh sign-in before they can play again, the
// cached pass is now void, so clear it so the gate re-checks the chain.
if (/play_pass/i.test(reason || '')) {
clearStoredPass();
this.playPass = '';
this.account = '';
- this.ui.toast('Your session expired — sign in again to keep playing.', 'warn');
+ this.ui.toast('Your session expired, sign in again to keep playing.', 'warn');
this.leave();
this._playReady = this._ensurePlayAccess();
return;
}
- this.ui.toast('Your holder pass expired — re-enter to verify your holdings.', 'warn');
+ this.ui.toast('Your holder pass expired, re-enter to verify your holdings.', 'warn');
this.leave();
});
this.net.on('add', (p, id) => this._onAdd(p, id));
@@ -1612,7 +1612,7 @@ export class CoinCommunities {
this.net.on('buildCleared', ({ count, all }) => {
this.ui.toast(all ? `Cleared the whole world (${count|0} blocks).` : `Cleared ${count|0} block${(count|0) === 1 ? '' : 's'} nearby.`, 'info');
});
- // Durability flag for this world's build — drives the HUD "Saved" badge.
+ // Durability flag for this world's build, drives the HUD "Saved" badge.
this.net.on('persistent', (durable) => { if (this.net?.status === 'online') this.buildHud.setPersistent(durable); });
this.net.on('floorBeat', (msg) => this._onFloorBeat(msg));
@@ -1628,7 +1628,7 @@ export class CoinCommunities {
env: this.env,
});
// W06: gather/craft stations (trees, rocks, roast pits) and the fishing-rod
- // pickups scattered around the world. Sibling of PlaySystems — see
+ // pickups scattered around the world. Sibling of PlaySystems, see
// play-activities.js's header for why they stay decoupled.
this.playActivities = new PlayActivities({
scene: this.scene,
@@ -1636,7 +1636,7 @@ export class CoinCommunities {
net: this.net,
ui: this.ui,
});
- // W09: Fortune's Folly, the Mainland Wheel of Fortune. Another sibling —
+ // W09: Fortune's Folly, the Mainland Wheel of Fortune. Another sibling,
// its own landmark, its own prompt, lazy-loads the actual spin UI (and the
// @solana/web3.js it drags in for the paid path) only on first interact.
this.wheelStation = new WheelStation({
@@ -1682,7 +1682,7 @@ export class CoinCommunities {
// to reconcile.
this.net.on('souvenir', (m) => this._onSouvenir(m));
// Friends (W09): live DMs + request/accept pushed by the social hub over this
- // world's socket. The FriendsClient owns all social state — it updates its
+ // world's socket. The FriendsClient owns all social state, it updates its
// threads/unread counts and notifies the panel, open or not, so a DM that
// arrives while the panel is closed still lights the badge.
this.net.on('social', (m) => {
@@ -1691,13 +1691,13 @@ export class CoinCommunities {
});
this._initFriends();
// Job completion has no generic 'notice' twin (WalkRoom sends only
- // 'questComplete') — toast it globally so a payout lands even when the
+ // 'questComplete'), toast it globally so a payout lands even when the
// Jobs Board panel isn't open, the same way every other reward does.
this.net.on('questComplete', (c) => {
if (!c) return;
const gold = c.reward?.gold ?? 0;
const crew = c.coop && c.crew > 1 ? ` (crew of ${c.crew})` : '';
- this.ui?.toast?.(`${c.title} complete${crew} — +${gold} cash`, 'success');
+ this.ui?.toast?.(`${c.title} complete${crew}, +${gold} cash`, 'success');
});
this.buildHud.root.hidden = false;
@@ -1784,7 +1784,7 @@ export class CoinCommunities {
ui: this.ui,
});
// …and the Intel Kiosk: the player pays a real x402 endpoint ($0.01 USDC)
- // from their own wallet for live market intel on the town's own coin —
+ // from their own wallet for live market intel on the town's own coin,
// the flagship $THREE oracle at home, the generic token oracle elsewhere.
this.intelKiosk = new IntelKiosk({
scene: this.scene,
@@ -1794,7 +1794,7 @@ export class CoinCommunities {
ui: this.ui,
coin,
});
- // Agent desks — visible in every world. Seats the platform's most recently
+ // Agent desks, visible in every world. Seats the platform's most recently
// ACTIVE public agents (the same ranking as the /agents-live wall) at
// working desks with live CanvasTexture monitors streaming their real
// activity. Players can walk up and press E (or tap) to open the full 2D
@@ -1823,10 +1823,10 @@ export class CoinCommunities {
this._agentDesks.push(desk);
});
})
- .catch(() => { /* non-critical — world works without desks */ });
+ .catch(() => { /* non-critical, world works without desks */ });
// Living world (W08): ambient pedestrians + traffic, interactive vendor /
- // quest / flavor NPCs, and (gated behind W07) hostile mobs — all on a
+ // quest / flavor NPCs, and (gated behind W07) hostile mobs, all on a
// deterministic nav graph so every client sees the same crowd without
// syncing it. Built for every world, same as the Agent Exchange and the
// Intel Kiosk above. Torn down in leave(). name/symbol ride along so the
@@ -1845,7 +1845,7 @@ export class CoinCommunities {
seed: seedFromString(coin.mint) >>> 0,
biome: this.env?.biome,
// Boutique NPCs (W03) call these to open the real cosmetics shop /
- // wardrobe panels — same panels the HUD buttons drive.
+ // wardrobe panels, same panels the HUD buttons drive.
openShop: () => this._toggleShop(),
openWardrobe: () => this._toggleWardrobe(),
// Quest-giver NPCs (W08 hooking W05) call this to open the real Jobs
@@ -1881,7 +1881,7 @@ export class CoinCommunities {
this._onboard = new PlayOnboard({ coin });
}
- // First-run nudge so players discover building exists — the HUD's ⛏ toggle is
+ // First-run nudge so players discover building exists, the HUD's ⛏ toggle is
// easy to miss. Shown once ever, a few seconds after the world settles so it
// doesn't collide with the entry toast.
_onboardBuild() {
@@ -1896,7 +1896,7 @@ export class CoinCommunities {
}
// Silent mid-session pass refresh. Runs once the player is in a world; wakes
- // up 2 min before the pass expires and renews it off the still-valid pass — no
+ // up 2 min before the pass expires and renews it off the still-valid pass, no
// wallet prompt, since possession of an unexpired pass already proves the wallet.
// Updates this.playPass so the next reconnect uses the fresh token, and re-checks
// the chain, so a wallet that offloaded its tokens gets evicted here rather than
@@ -1915,7 +1915,7 @@ export class CoinCommunities {
if (this.phase !== 'world' || !this.account || !this.playPass) return;
try {
// Silent renewal: the current pass is still valid (we fire 2 min early), so
- // the server re-issues off it after re-reading the chain — no wallet prompt.
+ // the server re-issues off it after re-reading the chain, no wallet prompt.
const res = await refreshPlayPass(this.playPass);
if (res.ok && res.playPass) {
this.playPass = res.playPass;
@@ -1926,7 +1926,7 @@ export class CoinCommunities {
// Below the floor mid-session: clear state and surface the gate.
clearStoredPass();
this.playPass = '';
- this.ui.toast('Your token balance dropped — sign in again to keep playing.', 'warn');
+ this.ui.toast('Your token balance dropped, sign in again to keep playing.', 'warn');
this.leave();
this._playReady = this._ensurePlayAccess();
}
@@ -1937,12 +1937,12 @@ export class CoinCommunities {
if (err?.code === 'pass_invalid') {
clearStoredPass();
this.playPass = '';
- this.ui.toast('Your session expired — sign in again to keep playing.', 'warn');
+ this.ui.toast('Your session expired, sign in again to keep playing.', 'warn');
this.leave();
this._playReady = this._ensurePlayAccess();
return;
}
- // Network hiccup — try again in 30 s rather than breaking the session.
+ // Network hiccup, try again in 30 s rather than breaking the session.
clearTimeout(this._passRefreshTimer);
this._passRefreshTimer = setTimeout(() => this._doPassRefresh(), 30_000);
}
@@ -1952,7 +1952,7 @@ export class CoinCommunities {
// verify token balance) when the server requires it, and caches the verified
// wallet + signed pass we attach to every room join. Self-healing: any failure
// resolves to "open" rather than bricking /play, since the server is the real
- // authority — an unsigned join is refused there regardless.
+ // authority, an unsigned join is refused there regardless.
async _ensurePlayAccess() {
try {
const access = await ensurePlayAccess();
@@ -2034,7 +2034,7 @@ export class CoinCommunities {
continue;
}
if (action === 'switch') {
- // Drop the linked wallet and connect a different one, then re-check —
+ // Drop the linked wallet and connect a different one, then re-check,
// the way out of a short balance when the coin lives in another wallet.
this.ui.setHolderGate('working', { symbol, msg: 'Switching wallet…' });
try {
@@ -2111,7 +2111,7 @@ export class CoinCommunities {
// jumbotron and dance floor at leave(), which previously were only detached
// from the scene graph (`world.remove`), leaking their GPU buffers on every
// world switch. Never called on shared/instanced world-env or district objects
- // — those own their own disposal.
+ //, those own their own disposal.
_disposeObject3D(obj) {
if (!obj) return;
obj.traverse((n) => {
@@ -2165,7 +2165,7 @@ export class CoinCommunities {
if (this.intelKiosk) { this.intelKiosk.dispose(); this.intelKiosk = null; }
if (this.worldLife) { this.worldLife.dispose(); this.worldLife = null; }
if (this._onboard) { this._onboard.dispose(); this._onboard = null; }
- // Close the shop + wardrobe and drop the rig binding — the next world rebuilds both.
+ // Close the shop + wardrobe and drop the rig binding, the next world rebuilds both.
if (this._shop?.isOpen()) this._shop.close();
if (this._wardrobe?.isOpen()) this._wardrobe.close();
// A souvenir card is bound to the world that granted it; leaving mid-linger
@@ -2217,7 +2217,7 @@ export class CoinCommunities {
this._resetBuildPerms();
this.buildHud.root.hidden = true;
// Reset the structures toolbar back to single-block and close any open
- // share / featured surfaces — they're scoped to the world we're leaving.
+ // share / featured surfaces, they're scoped to the world we're leaving.
this.buildPiece = null; this.buildRot = 0;
this.buildProp = null; this.buildPropRot = 0; this.buildPropScale = 1;
this.ui.setBuildPiece(null);
@@ -2278,7 +2278,7 @@ export class CoinCommunities {
// ------------------------------------------------------------- avatar inspector
// I (or clicking a nameplate / avatar) opens the shared inspector on whoever
- // you're looking at: identity, reputation, wallet — the same server truth every
+ // you're looking at: identity, reputation, wallet, the same server truth every
// other surface reads. See src/shared/avatar-inspector.js.
_worldFacts() {
const coin = this.coin || {};
@@ -2317,7 +2317,7 @@ export class CoinCommunities {
name: npc.name,
world: 'play',
facts: [
- { label: 'Role', value: npc.role === 'vendor' ? 'Vendor — real paid service' : npc.role === 'quest' ? 'Quest giver' : 'Townsperson' },
+ { label: 'Role', value: npc.role === 'vendor' ? 'Vendor, real paid service' : npc.role === 'quest' ? 'Quest giver' : 'Townsperson' },
...(npc.def?.prompt ? [{ label: 'Offers', value: npc.def.prompt }] : []),
...this._worldFacts(),
],
@@ -2350,7 +2350,7 @@ export class CoinCommunities {
facts: this._worldFacts(),
}, { trigger: this.canvas });
}
- // Nearest inspectable within reach: real players first beat scenery — an NPC
+ // Nearest inspectable within reach: real players first beat scenery, an NPC
// only wins when it is strictly closer. Falls back to yourself so the key
// always answers.
_inspectNearest() {
@@ -2369,7 +2369,7 @@ export class CoinCommunities {
else this._inspectSelf();
}
// Raycast pick for taps directly on a peer's 3D body (labels are the fast
- // path; this catches clicks on the avatar itself). Click-only — never run
+ // path; this catches clicks on the avatar itself). Click-only, never run
// per-frame, skinned-mesh raycasts are too heavy for hover.
_remoteAt(clientX, clientY) {
if (!this.remotes.size) return null;
@@ -2386,7 +2386,7 @@ export class CoinCommunities {
_onAdd(player, id) {
if (id === this.net.sessionId) return; // that's us
// A peer we already track (or one re-announced under the same id after a
- // resync) is live, not stale — clear any stale flag rather than doubling it.
+ // resync) is live, not stale, clear any stale flag rather than doubling it.
const existing = this.remotes.get(id);
if (existing) { existing._stale = false; existing.apply?.(player); return; }
const rp = new RemotePlayer(this.scene, player);
@@ -2397,7 +2397,7 @@ export class CoinCommunities {
// Flag every current peer as stale ahead of a reconnect. A reconnect is a fresh
// joinOrCreate with new session ids, and the old room's listeners were removed
- // before it left, so `_onRemove` never fires for the peers we had — without
+ // before it left, so `_onRemove` never fires for the peers we had, without
// this they linger as frozen ghosts and inflate the online count. The fresh
// room's `add` events clear the flag (above); whatever is still flagged when the
// snapshot lands (`_pruneStaleRemotes`) genuinely left while we were offline.
@@ -2551,7 +2551,7 @@ export class CoinCommunities {
// ── Cosmetics live preview (R21) ──────────────────────────────────────────
// The shop previews a catalog item on YOUR OWN avatar before any purchase.
// This is the local R03 rig hook: bone-attach GLBs, drive outfit morphs,
- // recolour garment layers, or play premium emote clips — never broadcast,
+ // recolour garment layers, or play premium emote clips, never broadcast,
// never persisted (a purchase is R22/R23). Selecting reverts the previous
// preview first, so only one item previews at a time.
@@ -2618,7 +2618,7 @@ export class CoinCommunities {
coinMint: this.coin?.mint || '',
onPreview: (item) => this.equipCosmeticPreview(item),
onEndPreview: () => this.unequipCosmeticPreview(),
- // A premium item was just bought (R22) — permanently equip it so the
+ // A premium item was just bought (R22), permanently equip it so the
// buyer immediately sees their new look AND it persists across worlds
// (R23 durable equip: server validates, writes to account, echoes a
// fresh profile which re-renders the wardrobe and local avatar).
@@ -2626,7 +2626,7 @@ export class CoinCommunities {
});
}
// The shop is built once and reused across worlds, so refresh the coin tie
- // each open — a sale always credits the world the player is currently in.
+ // each open, a sale always credits the world the player is currently in.
this._shop.h.coinMint = this.coin?.mint || '';
this._shop.toggle();
}
@@ -2642,7 +2642,7 @@ export class CoinCommunities {
// The account-level social graph inside the world: who's online, which coin
// world they're standing in, and DM threads. `FriendsPanel` is a pure view over
// the shared `friendsClient`, so the same graph backs /play, /walk and the
- // standalone /friends page — a DM read here is read everywhere.
+ // standalone /friends page, a DM read here is read everywhere.
//
// Presence is published by the room, not this panel: CommunityNet now carries a
// signed presence ticket into the join, so a player is visible to friends the
@@ -2650,7 +2650,7 @@ export class CoinCommunities {
// Seed the graph once per world entry so the unread badge is honest before the
// panel is ever opened, and keep it live from the client's change signal. Silent
- // no-op when signed out — `refresh()` short-circuits without a request.
+ // no-op when signed out, `refresh()` short-circuits without a request.
_initFriends() {
const fc = friendsClient();
this._offFriends = fc.subscribe(() => this._bumpFriendsBadge());
@@ -2662,7 +2662,7 @@ export class CoinCommunities {
getMe().then((u) => { this.me = u || null; }).catch(() => { this.me = null; });
}
- // Open the friends drawer directly on a DM thread — the inspector's
+ // Open the friends drawer directly on a DM thread, the inspector's
// "Message" action for a player who is already a friend.
_openDmWith(userId) {
if (!userId) return;
@@ -2759,7 +2759,7 @@ export class CoinCommunities {
this._bumpFriendsBadge();
}
- // Full teardown — the panel and its client subscription must not outlive the
+ // Full teardown, the panel and its client subscription must not outlive the
// world (a coin switch rebuilds both, and a stale subscription would repaint a
// disposed HUD).
_disposeFriends() {
@@ -2988,7 +2988,7 @@ export class CoinCommunities {
// Equip `id` durably: send to the server (authoritative validation + persistence)
// so the fit survives logout, world switches, and is visible to peers immediately.
// The server echoes a fresh profile which updates the wardrobe and local avatar.
- // Only forward ids the rig can actually wear — a purchase of an item outside the
+ // Only forward ids the rig can actually wear, a purchase of an item outside the
// worn-cosmetics catalog (its ownership still records server-side) must not fire
// a spurious "that cosmetic doesn't exist" notice from the equip authority.
_equipCosmeticDurable(id) {
@@ -3007,7 +3007,7 @@ export class CoinCommunities {
// ── Owned-cosmetics: persisted equip on the LOCAL avatar (R23) ─────────────
// Dress the local avatar in `wire` (an equipped loadout, slot→id map or wire
- // string). Idempotent — re-applies only when it actually changed — and reuses
+ // string). Idempotent, re-applies only when it actually changed, and reuses
// the shared applyLoadout so the local body, peers and the creator preview all
// render the same wardrobe. Separate from the R21 shop's ephemeral preview
// above (AccessoryManager): this is the durable, equipped look.
@@ -3089,13 +3089,13 @@ export class CoinCommunities {
const g = new Group();
g.position.set(CX, 0, CZ);
- // Rim disc — slightly larger, defines the pad boundary with a subtle glow.
+ // Rim disc, slightly larger, defines the pad boundary with a subtle glow.
const rimMat = new MeshStandardMaterial({ color: 0x0a0a14, emissive: 0x180840, emissiveIntensity: 0.55, roughness: 0.3, metalness: 0.7 });
const rim = new Mesh(new CircleGeometry(R + 0.18, 48), rimMat);
rim.rotation.x = -Math.PI / 2;
g.add(rim);
- // Base pad — dark polished surface.
+ // Base pad, dark polished surface.
const baseMat = new MeshStandardMaterial({ color: 0x0d0d1c, emissive: 0x100828, emissiveIntensity: 0.28, roughness: 0.2, metalness: 0.85 });
const base = new Mesh(new CircleGeometry(R, 48), baseMat);
base.rotation.x = -Math.PI / 2;
@@ -3116,7 +3116,7 @@ export class CoinCommunities {
this._floorTiles.push({ mat, idx: i });
}
- // Centre disc — pure white / violet, most dramatic on beat.
+ // Centre disc, pure white / violet, most dramatic on beat.
const centerMat = new MeshStandardMaterial({ color: 0xffffff, emissive: 0xaa55ff, emissiveIntensity: 0.65, roughness: 0.06, metalness: 0.96 });
const center = new Mesh(new CircleGeometry(0.55, 32), centerMat);
center.rotation.x = -Math.PI / 2;
@@ -3124,7 +3124,7 @@ export class CoinCommunities {
g.add(center);
this._floorCenterMat = centerMat;
- // 4 coloured point lights above the pad corners — pink / cyan / yellow / mint.
+ // 4 coloured point lights above the pad corners, pink / cyan / yellow / mint.
const LIGHT_COLS = [0xff44cc, 0x44aaff, 0xffdd22, 0x44ffcc];
this._floorLights = [];
for (let i = 0; i < 4; i++) {
@@ -3187,7 +3187,7 @@ export class CoinCommunities {
this._danceClip = clip;
// Local avatar: start the clip now, aligned to the server beat.
playEmoteClip(this.localAnim, clip, this.motion);
- // Broadcast so peers see us dancing — 2-second emote cooldown in WalkRoom
+ // Broadcast so peers see us dancing, 2-second emote cooldown in WalkRoom
// is well under the 4-second beat interval, so this always lands.
this.net?.sendEmote(clip);
}
@@ -3219,7 +3219,7 @@ export class CoinCommunities {
const g = new Group();
g.position.set(x, 0, z);
- // Boundary ring on the ground — a warm gold annulus that reads as the coin's
+ // Boundary ring on the ground, a warm gold annulus that reads as the coin's
// own colour (matches the totem disc), so the zone clearly belongs to the totem.
const ringMat = new MeshBasicMaterial({ color: 0xffce5c, transparent: true, opacity: 0.42, depthWrite: false, side: DoubleSide });
const ring = new Mesh(new RingGeometry(r - 0.2, r, 72), ringMat);
@@ -3416,7 +3416,7 @@ export class CoinCommunities {
window.addEventListener('keydown', (e) => {
if (this.ui.chatFocused) return;
// Typing anywhere else (friends DM box, search fields, modal inputs) must
- // reach the caret untouched — no hotkeys, no Enter hijack, no Space eaten.
+ // reach the caret untouched, no hotkeys, no Enter hijack, no Space eaten.
if (isTypingTarget(e.target)) return;
// Esc closes the friends/avatar drawers before anything else claims the key.
if (e.key === 'Escape' && this._friendsOpen) { e.preventDefault(); this._closeFriends(); return; }
@@ -3429,7 +3429,7 @@ export class CoinCommunities {
if (hasOpenOverlay()) return;
if (e.key === 'Enter' && this.phase === 'world' && !onControl) { e.preventDefault(); this.ui.focusChat(); return; }
// Space jumps on foot; while driving it's the handbrake instead (held,
- // released in the keyup handler below) — never scrolls the page either way.
+ // released in the keyup handler below), never scrolls the page either way.
if (e.code === 'Space' && !onControl) {
e.preventDefault();
if (this.vehicles?.isDriving()) { this.vehicles.setHandbrake(true); return; }
@@ -3438,7 +3438,7 @@ export class CoinCommunities {
}
const k = e.key.toLowerCase();
if (this.phase === 'world') {
- // B toggles build mode; while it's on, 1–0 pick the active block.
+ // B toggles build mode; while it's on, 1, 0 pick the active block.
if (k === 'b') {
e.preventDefault();
if (this._buildableConnection() || this.buildHud.active) this.buildHud.setActive(!this.buildHud.active);
@@ -3461,12 +3461,12 @@ export class CoinCommunities {
if (this.buildProp) this._rotateProp(); else this._rotateBuild();
return;
}
- // E interacts with whatever the player stands near — a townsperson,
+ // E interacts with whatever the player stands near, a townsperson,
// the Intel Kiosk, or the Agent Exchange (all built in every world).
// Not while building.
if (k === 'e' && !this.buildHud.active) {
e.preventDefault();
- // A conversation or counter is already open — let it own the moment
+ // A conversation or counter is already open, let it own the moment
// instead of reopening on top of itself.
if (isChatPanelOpen() || isServicePanelOpen() || isAixbtPanelOpen() || isZauthPanelOpen()) return;
// Talk to the nearest townsperson (vendor/quest/flavor); if none is
@@ -3477,7 +3477,7 @@ export class CoinCommunities {
return;
}
// F is contextual: enter/exit a nearby vehicle takes priority (the
- // on-screen prompt already says "F — Drive" / "F — Exit"); then a
+ // on-screen prompt already says "F, Drive" / "F, Exit"); then a
// gather/craft/pickup station (chop, mine, cook, grab a rod); otherwise
// it casts a line when standing by a pond (no-op elsewhere). Not while
// building, where keys drive the block palette.
@@ -3486,7 +3486,7 @@ export class CoinCommunities {
if (!this.vehicles?.interact() && !this.playActivities?.doAction()) this.playSystems?.castFish();
return;
}
- // I inspects the nearest avatar — player, townsperson, or yourself:
+ // I inspects the nearest avatar, player, townsperson, or yourself:
// identity, reputation, wallet. Press again to close.
if (k === 'i' && !this.buildHud.active && !e.repeat) {
e.preventDefault();
@@ -3494,7 +3494,7 @@ export class CoinCommunities {
return;
}
// P photographs the world onto a share card. Deliberately live in
- // every mode — zen, building, driving — because the shot is an
+ // every mode, zen, building, driving, because the shot is an
// offscreen render, so no panel is ever in the frame. Ctrl/Cmd+P
// stays the browser's print dialog.
if (k === 'p' && !e.repeat && !e.ctrlKey && !e.metaKey) {
@@ -3502,7 +3502,7 @@ export class CoinCommunities {
this._openPhotoMode();
return;
}
- // J toggles the friends drawer (W09). F — the /walk binding — is already
+ // J toggles the friends drawer (W09). F, the /walk binding, is already
// this world's contextual action key (drive / gather / cast), so /play
// takes the next free slot; the HUD button carries the same hint.
if (k === 'j' && !this.buildHud.active && !e.repeat) {
@@ -3538,7 +3538,7 @@ export class CoinCommunities {
this.combat?.attack();
return;
}
- // Q — hold to open the emote wheel, release to play the selected clip.
+ // Q, hold to open the emote wheel, release to play the selected clip.
// Ignore auto-repeat (held key fires many keydowns) and build mode.
if (k === 'q' && !this.buildHud.active && !e.repeat) {
e.preventDefault();
@@ -3550,7 +3550,7 @@ export class CoinCommunities {
}, 340);
return;
}
- // 1–6 select a hotbar slot when not building.
+ // 1, 6 select a hotbar slot when not building.
if (!this.buildHud.active && k.length === 1 && k >= '1' && k <= '6') {
e.preventDefault();
this.playSystems?.equipSlot(Number(k) - 1);
@@ -3592,18 +3592,18 @@ export class CoinCommunities {
if (!this._downPtr) return;
const moved = Math.hypot(e.clientX - this._downPtr.x, e.clientY - this._downPtr.y);
this._downPtr = null;
- if (consumed) return; // a hold already broke a block — don't also place
+ if (consumed) return; // a hold already broke a block, don't also place
if (moved >= 6 || e.button === 2) return; // a look-drag, or a right-click (handled by contextmenu)
if (this.phase === 'world' && this.buildHud.active) { this._buildAt(e.clientX, e.clientY, false); return; }
- // Tap a nearby parked vehicle to take the wheel — the touch-native
+ // Tap a nearby parked vehicle to take the wheel, the touch-native
// equivalent of pressing F. Checked first: it only ever fires when a
// vehicle is both in range and under the tap, so it can't shadow the
// other tap targets below.
if (this.vehicles?.tryActivateAt(this._pointerRay(e.clientX, e.clientY))) return;
- // Tap the agents (or their exchange ring) to watch a live payment — the
+ // Tap the agents (or their exchange ring) to watch a live payment, the
// touch-native equivalent of pressing E. Checked before the chart screen.
if (this.worldLife?.tryActivateAt(e.clientX, e.clientY)) return;
- // Tap a nearby tombstone to loot it — the touch-native equivalent of
+ // Tap a nearby tombstone to loot it, the touch-native equivalent of
// pressing E on a death-drop (W07).
if (this.combat?.tryActivateAt(this._pointerRay(e.clientX, e.clientY))) return;
if (this.agentCommerce?.tryActivateAt(this._pointerRay(e.clientX, e.clientY))) return;
@@ -3652,7 +3652,7 @@ export class CoinCommunities {
}
const dx = e.clientX - this._lastPtr.x, dy = e.clientY - this._lastPtr.y;
this._lastPtr = { x: e.clientX, y: e.clientY };
- // A real drag is a look, not a hold — cancel the pending break so panning
+ // A real drag is a look, not a hold, cancel the pending break so panning
// the camera in build mode never destroys a block.
if (this._downPtr && Math.hypot(e.clientX - this._downPtr.x, e.clientY - this._downPtr.y) >= 8) this._cancelLongPress();
this.camYaw -= dx * 0.005;
@@ -3679,7 +3679,7 @@ export class CoinCommunities {
}
// Cast a ray from a screen-space point into the world and report whether it
- // hits the live chart screen's face — powers tap-to-open and the hover cursor.
+ // hits the live chart screen's face, powers tap-to-open and the hover cursor.
_raycastScreen(clientX, clientY) {
if (!this._chartScreen?.mesh) return false;
return this._pointerRay(clientX, clientY).intersectObject(this._chartScreen.mesh, false).length > 0;
@@ -3692,7 +3692,7 @@ export class CoinCommunities {
_buildableConnection() {
const s = this.net?.status;
// 'unavailable' (no server configured for this env) is a solo session just
- // like 'offline' — let the player build their own local copy.
+ // like 'offline', let the player build their own local copy.
return s === 'online' || s === 'offline' || s === 'unavailable';
}
@@ -3700,7 +3700,7 @@ export class CoinCommunities {
// only send the intent, and the block appears/disappears when the server echoes
// its blocks state back (see the blockAdd/blockRemove wiring in enter()). In
// single-player (no server) we apply the edit straight to the local voxel layer
- // — same result on screen, just not synced or persisted.
+ //, same result on screen, just not synced or persisted.
_buildAt(clientX, clientY, forceRemove) {
if (this.phase !== 'world' || !this._buildableConnection()) return;
// Prop layer (R18): a click places a free-standing object; right-click / hold
@@ -3710,7 +3710,7 @@ export class CoinCommunities {
const target = this.voxels.raycast(this._pointerRay(clientX, clientY));
if (!target) return;
const removing = forceRemove || this.buildHud.mode === 'remove';
- // A composite piece stamps several cells at once — but only when placing.
+ // A composite piece stamps several cells at once, but only when placing.
// Break mode always falls back to the single-cell path below.
if (!removing && this.buildPiece && target.placeCell) {
this._placeComposite(target.placeCell);
@@ -3736,7 +3736,7 @@ export class CoinCommunities {
this._pushUndo({ kind: 'remove', cell: target.placeCell.slice() });
}
} else if (target.placeCell) {
- // Aimed somewhere illegal (out of bounds / occupied) — flash the cursor.
+ // Aimed somewhere illegal (out of bounds / occupied), flash the cursor.
this.voxels.showGhost(target.placeCell, 'blocked');
return;
}
@@ -3745,7 +3745,7 @@ export class CoinCommunities {
// Stamp a composite piece (wall / floor / stairs / doorway) anchored at `cell`,
// rotated by the current quarter-turn. Validated as a whole: every cell must be
- // in bounds, empty, and fit the budget, or nothing lands — so a piece never
+ // in bounds, empty, and fit the budget, or nothing lands, so a piece never
// half-appears. Online it goes through the place-batch channel (server echoes
// each block back); solo it's applied to the local layer directly. Undo records
// just the cells this stamp actually created.
@@ -3757,8 +3757,8 @@ export class CoinCommunities {
// Name the most likely reason so a blocked stamp isn't a silent no-op.
const overBudget = this.voxels.count + cells.length > MAX_BLOCKS;
this.ui.toast(overBudget
- ? `Not enough room — that piece needs ${cells.length} blocks.`
- : 'That piece doesn’t fit here — rotate it or move back.', 'warn');
+ ? `Not enough room, that piece needs ${cells.length} blocks.`
+ : 'That piece doesn’t fit here, rotate it or move back.', 'warn');
return;
}
// The cells this stamp newly creates (a piece may overlap existing blocks);
@@ -3779,7 +3779,7 @@ export class CoinCommunities {
_pickPiece(id) {
this.buildPiece = COMPOSITE_PIECES.some((p) => p.id === id) ? id : null;
this.buildRot = 0;
- // Arming a voxel tool disarms the prop layer — the two placement modes are
+ // Arming a voxel tool disarms the prop layer, the two placement modes are
// mutually exclusive so a build click is never ambiguous.
if (this.buildProp) { this.buildProp = null; this.ui.setPropSelected(null); this.propGhost?.hide(); }
this.ui.setBuildPiece(this.buildPiece);
@@ -3913,7 +3913,7 @@ export class CoinCommunities {
// validity flag (inside the build radius), or null when aiming at the sky.
_propTarget(clientX, clientY) {
const ray = this._pointerRay(clientX, clientY).ray;
- if (ray.direction.y >= -1e-4) return null; // looking up / parallel — no floor
+ if (ray.direction.y >= -1e-4) return null; // looking up / parallel, no floor
const t = -ray.origin.y / ray.direction.y;
if (t <= 0) return null;
const px = ray.origin.x + ray.direction.x * t;
@@ -3928,7 +3928,7 @@ export class CoinCommunities {
// Place or delete a prop under the pointer. Placing sends obj:spawn kind:'block'
// (durable, server-persisted via R17); the prop appears for everyone when the
// server echoes its objects state back. Right-click / hold deletes a prop YOU own
- // (server enforces ownership; we only offer it on your own pieces — R19 hardens it).
+ // (server enforces ownership; we only offer it on your own pieces, R19 hardens it).
_buildPropAt(clientX, clientY, forceRemove) {
const removing = forceRemove || this.buildHud.mode === 'remove';
if (removing) { this._deleteOwnPropAt(clientX, clientY); return; }
@@ -3956,7 +3956,7 @@ export class CoinCommunities {
// enforces are enforced here before anything is written.
_placeLocalProp(target, yaw, url) {
const store = this._worldStore;
- if (!store) { this.ui.toast('This world’s build store is still loading — try again in a moment.', 'warn'); return false; }
+ if (!store) { this.ui.toast('This world’s build store is still loading, try again in a moment.', 'warn'); return false; }
if (!store.writable) {
this.ui.toast('Your build here can’t be saved yet, so props are off. Sign in and rejoin to build offline.', 'warn');
return false;
@@ -4045,8 +4045,8 @@ export class CoinCommunities {
if (now - (this._objRejectAt[reason] || 0) < 4000) return;
this._objRejectAt[reason] = now;
const msg = {
- world_full: 'This world is full of props — remove some to place more.',
- player_full: 'You’ve hit your prop limit for this world — remove some to place more.',
+ world_full: 'This world is full of props, remove some to place more.',
+ player_full: 'You’ve hit your prop limit for this world, remove some to place more.',
asset_url: 'That model isn’t hosted where this world can load it. Re-upload it and try again.',
}[reason] || 'That prop couldn’t be placed.';
this.ui.toast(msg, 'warn');
@@ -4166,7 +4166,7 @@ export class CoinCommunities {
_onWorldSaveDenied({ reason }) {
this.buildHud.setPersistent(false);
this.ui.toast(reason === 'signin'
- ? 'Sign in to save what you build here — until then it only exists in this tab.'
+ ? 'Sign in to save what you build here, until then it only exists in this tab.'
: 'This world belongs to someone else, so your offline build can’t be saved to it.', 'warn');
}
@@ -4200,7 +4200,7 @@ export class CoinCommunities {
// Arm a hold-to-break timer for the current press. If the player keeps the
// pointer down and still (no drag) past LONG_PRESS_MS, break the targeted block
- // — the touch-native equivalent of a right-click. Cancelled by movement or release.
+ //, the touch-native equivalent of a right-click. Cancelled by movement or release.
_armLongPressBreak(clientX, clientY) {
this._cancelLongPress();
if (this.phase !== 'world' || !this.buildHud.active || !this._buildableConnection()) return;
@@ -4262,23 +4262,23 @@ export class CoinCommunities {
}
// Explain a server-refused edit so a block that never appeared isn't a mystery.
- // Throttled to one toast per reason per window — a flood reply can't spam.
+ // Throttled to one toast per reason per window, a flood reply can't spam.
_onEditReject(reason) {
const now = performance.now();
this._rejectToastAt ||= {};
if (now - (this._rejectToastAt[reason] || 0) < 4000) return;
this._rejectToastAt[reason] = now;
const msg = {
- budget: `Build limit reached (${MAX_BLOCKS} blocks) — break something to make room.`,
- rate: 'Building too fast — slow down a moment.',
- bounds: 'Can’t build there — outside the build area.',
+ budget: `Build limit reached (${MAX_BLOCKS} blocks), break something to make room.`,
+ rate: 'Building too fast, slow down a moment.',
+ bounds: 'Can’t build there, outside the build area.',
type: 'That block type isn’t available.',
- owned: 'That block belongs to another builder — you can’t change it.',
- column: 'That stack is too tall here — try building wider, not higher.',
- protected: 'That spot is protected — keep the spawn and totem clear.',
- player: 'You’ve hit your block limit for this world — break some to build more.',
- playercap: 'You’ve hit your block limit for this world — break some to build more.',
- dense: 'That stack is too tall here — try building wider, not higher.',
+ owned: 'That block belongs to another builder, you can’t change it.',
+ column: 'That stack is too tall here, try building wider, not higher.',
+ protected: 'That spot is protected, keep the spawn and totem clear.',
+ player: 'You’ve hit your block limit for this world, break some to build more.',
+ playercap: 'You’ve hit your block limit for this world, break some to build more.',
+ dense: 'That stack is too tall here, try building wider, not higher.',
notcreator: 'Only the coin’s creator can clear builds here.',
}[reason] || 'That edit couldn’t be applied.';
this.ui.toast(msg, 'warn');
@@ -4312,7 +4312,7 @@ export class CoinCommunities {
}
// Adopt the server's build-permission snapshot: drive the per-player allowance
- // meter and reveal the creator-only moderation control. Authoritative — the HUD
+ // meter and reveal the creator-only moderation control. Authoritative, the HUD
// only surfaces what the server already enforces.
_onBuildPerms(p) {
if (!p || typeof p !== 'object') return;
@@ -4346,7 +4346,7 @@ export class CoinCommunities {
};
}
- // Clear the per-player meter + creator tool — on leave and on every (re)connect,
+ // Clear the per-player meter + creator tool, on leave and on every (re)connect,
// before fresh perms arrive, so a solo build or a different world never inherits
// the last one's allowance or moderation control.
_resetBuildPerms() {
@@ -4360,7 +4360,7 @@ export class CoinCommunities {
// a wallet must hold to enter this coin's Holders world. Reads the current value
// first so the input is pre-filled, then writes through the creator-only
// endpoint (which re-verifies ownership server-side). Only the coin's verified
- // creator ever reaches this — the button is hidden otherwise.
+ // creator ever reaches this, the button is hidden otherwise.
async _configureGate() {
const coin = this.coin;
if (!coin?.mint) return;
@@ -4370,7 +4370,7 @@ export class CoinCommunities {
const cfg = await getWorldGate(coin.mint);
current = cfg?.minTokens || 0;
} catch {
- // Couldn't read the current gate — open in an "unknown" state so the creator
+ // Couldn't read the current gate, open in an "unknown" state so the creator
// can still overwrite or remove it, rather than a blank form that wrongly
// implies the world is ungated. The save validates server-side regardless.
unknown = true;
@@ -4426,8 +4426,8 @@ export class CoinCommunities {
const solo = this.net?.status !== 'online';
const how = touch
? 'tap to place, hold to break, pick a block, ⌘/Ctrl+Z to undo'
- : 'click to place, right-click to break, 1–0 pick a block, R rotates pieces, ⌘/Ctrl+Z to undo';
- this.ui.toast(`Build mode${solo ? ' (offline — reconnect to share)' : ''} — ${how}`, 'info');
+ : 'click to place, right-click to break, 1, 0 pick a block, R rotates pieces, ⌘/Ctrl+Z to undo';
+ this.ui.toast(`Build mode${solo ? ' (offline, reconnect to share)' : ''}, ${how}`, 'info');
this._syncBudget();
if (this._lastHover) this._updateGhost(this._lastHover.x, this._lastHover.y);
}
@@ -4466,7 +4466,7 @@ export class CoinCommunities {
this.ui.setPhotoActive(shown);
} catch (err) {
log.warn('[coincommunities] photo mode failed to load:', err?.message);
- this.ui.toast('Photo mode couldn’t load — check your connection and try again.', 'warn');
+ this.ui.toast('Photo mode couldn’t load, check your connection and try again.', 'warn');
} finally {
this._photoLoading = false;
}
@@ -4477,7 +4477,7 @@ export class CoinCommunities {
_shareBuild() {
if (this.phase !== 'world' || !this.coin) return;
const shot = this._captureBuildShot();
- if (!shot) { this.ui.toast('Couldn’t capture the view — try again.', 'warn'); return; }
+ if (!shot) { this.ui.toast('Couldn’t capture the view, try again.', 'warn'); return; }
const link = this._coinShareLink();
const blocks = this.voxels?.count ?? 0;
this.ui.openShareSheet({
@@ -4516,17 +4516,17 @@ export class CoinCommunities {
}),
});
if (!res.ok) {
- const reason = res.status === 429 ? 'Sharing too fast — give it a minute.'
+ const reason = res.status === 429 ? 'Sharing too fast, give it a minute.'
: res.status === 413 ? 'That screenshot was too large to share.'
: `Couldn’t publish (error ${res.status}).`;
return { ok: false, error: reason };
}
- // A fresh publish belongs at the top of the featured list — refresh if open.
+ // A fresh publish belongs at the top of the featured list, refresh if open.
if (this._featuredOpen) this._loadFeatured();
return { ok: true };
} catch (err) {
log.warn('[coincommunities] publish build failed:', err?.message);
- return { ok: false, error: 'Network error — check your connection and retry.' };
+ return { ok: false, error: 'Network error, check your connection and retry.' };
}
}
@@ -4557,7 +4557,7 @@ export class CoinCommunities {
const zone = document.getElementById('cc-joystick');
if (!zone || this._joyInit) return;
this._joyInit = true;
- // Self-contained pointer-events joystick — no external lib, so the input
+ // Self-contained pointer-events joystick, no external lib, so the input
// contract can never drift. Responds to BOTH touch and mouse-drag, so the
// world is playable without a keyboard and verifiable on desktop. Desktop
// also keeps WASD; the two intents simply sum in _stepLocal.
@@ -4617,7 +4617,7 @@ export class CoinCommunities {
const now = frameNow ?? performance.now();
// Frame cap (see constructor): 60 in-world, 30 blurred or power-saving,
// and a 4fps trickle while the opaque lobby hides the canvas entirely
- // (the transparent embed keeps 30 — its arena stays visible behind the
+ // (the transparent embed keeps 30, its arena stays visible behind the
// grid). Skipped frames are cheap: everything below is dt-based.
const lobbyHidden = this.phase === 'lobby' && !this._transparentBg;
let fpsCap = !this._focus.focused ? FPS_IDLE
@@ -4628,7 +4628,7 @@ export class CoinCommunities {
if (!this._governor.shouldRun(now, fpsCap)) return;
const dt = Math.min(0.05, (now - this._last) / 1000);
this._last = now;
- // Only judge frame health at the full-rate cap — a deliberately
+ // Only judge frame health at the full-rate cap, a deliberately
// throttled frame (blur, lobby, saver) is slow by design, not a
// struggling GPU.
// Frame health is judged at the full-rate cap only, and never during the
@@ -4644,7 +4644,7 @@ export class CoinCommunities {
}
if (this.phase === 'world') {
- // W02: while driving, the vehicle IS the local player's movement — skip
+ // W02: while driving, the vehicle IS the local player's movement, skip
// the on-foot character step (it would fight the car for localPos every
// frame) and let VehicleManager feed this frame's throttle/steer/brake
// into the Rapier vehicle controller instead.
@@ -4675,7 +4675,7 @@ export class CoinCommunities {
if (this.worldLife) { this.worldLife.setRealPeers(this.remotes.size); this.worldLife.tick(dt); }
this.combat?.tick(dt);
// Ordinary move sync is redundant (and would just get rejected by the
- // server's walking-speed step clamp) while driving — VehicleManager
+ // server's walking-speed step clamp) while driving, VehicleManager
// streams the authoritative transform itself via sendVSync.
if (this.net && !driving) this.net.sendMove({ x: this.localPos.x, y: this.localPos.y, z: this.localPos.z, yaw: this.localYaw, motion: this.motion });
// Gamepad: north button (Y/△, 3) opens the emote wheel; once open, the left
@@ -4730,7 +4730,7 @@ export class CoinCommunities {
// Map intent into world space using the camera's own basis so the
// keys read screen-relative: forward (W/up) goes straight away from
// the camera, D/right tracks screen-right. Camera forward is
- // (sinYaw, cosYaw) and camera-right is (cosYaw, -sinYaw) — see
+ // (sinYaw, cosYaw) and camera-right is (cosYaw, -sinYaw), see
// _updateCamera. world = ix*right + (-iz)*forward.
const sin = Math.sin(this.camYaw), cos = Math.cos(this.camYaw);
wx = nx * cos - nz * sin;
@@ -4767,7 +4767,7 @@ export class CoinCommunities {
});
this.grounded = res.grounded;
if (this.grounded && this.vy < 0) this.vy = 0;
- // Boundary safety — mirrors the server's square WORLD_BOUND clamp
+ // Boundary safety, mirrors the server's square WORLD_BOUND clamp
// (world-zones.js DISTRICT.half) so client and server never disagree
// on the world's edge. Snap the body too so the next query starts clean.
const clamped = clampToBounds(res.position.x, res.position.z);
@@ -4777,7 +4777,7 @@ export class CoinCommunities {
this.localPos.set(clamped.x, res.position.y, clamped.z);
} else {
this._physicsActivePrev = false;
- // Legacy direct-mutation fallback — only live for the brief window
+ // Legacy direct-mutation fallback, only live for the brief window
// before Rapier's WASM finishes loading (or if it fails to load at all).
if (!this.grounded) {
this.vy -= GRAVITY * dt;
@@ -4836,19 +4836,19 @@ export class CoinCommunities {
for (const [id, r] of this.remotes) {
peers.push({ id, x: r.rig.position.x, y: r.rig.position.y, z: r.rig.position.z, voice: r.voice });
}
- // Camera forward on the ground plane is (sin camYaw, cos camYaw) — see
+ // Camera forward on the ground plane is (sin camYaw, cos camYaw), see
// _updateCamera, where the camera sits opposite this vector from the target.
const forward = { x: Math.sin(this.camYaw), z: Math.cos(this.camYaw) };
this.voice.update({ x: this.localPos.x, y: this.localPos.y, z: this.localPos.z }, peers, forward);
}
// W01: four-mode chase camera (follow/cinematic/firstperson/topdown) via the
- // shared camera-modes.js controller — see the constructor and the 'c' key in
+ // shared camera-modes.js controller, see the constructor and the 'c' key in
// _bindInput. 'follow' reproduces the original fixed orbit exactly, so the
// default view is unchanged; the other three are new.
_updateCamera(dt) {
this._camTarget = this._camTarget || new Vector3();
- // Track the avatar on the ground plane only in follow/cinematic/topdown —
+ // Track the avatar on the ground plane only in follow/cinematic/topdown,
// ignore jump height so those cameras stay planted while the character
// hops. First person tracks the real (jump-inclusive) height for the eye.
const inWorld = this.phase === 'world' && this.localRig;
@@ -4871,7 +4871,7 @@ export class CoinCommunities {
// One scratch vector for the whole sweep, and one style write per node only
// when the value actually changed. This runs every frame for every peer, so
// at event scale (100 in one plaza) the naive version allocated ~300 Vector3
- // per frame and re-wrote ~300 transforms whether or not anything moved — a
+ // per frame and re-wrote ~300 transforms whether or not anything moved, a
// steady GC drip plus a style recalc on a crowd standing still.
const v = this._labelProj || (this._labelProj = new Vector3());
const cam = this.camera;
@@ -4940,7 +4940,7 @@ function renderBootError(err) {
overlay.classList.remove('kx-hidden');
overlay.replaceChildren();
- // The boot avatar's render loop targets a canvas we're about to remove — stop
+ // The boot avatar's render loop targets a canvas we're about to remove, stop
// it so it doesn't tick against a detached element.
try { window.__ccBootAvatar?.dispose?.(); } catch { /* best-effort teardown */ }
@@ -4956,8 +4956,8 @@ function renderBootError(err) {
const msg = document.createElement('p');
msg.className = 'kx-boot-error-msg';
msg.textContent = noWebGL
- ? 'Your browser couldn’t start 3D graphics. Turn on hardware acceleration (or WebGL) and reload — on most browsers it’s under Settings › System.'
- : 'Something went wrong starting Coin Communities. Reload to try again — if it keeps happening, your browser may be out of date.';
+ ? 'Your browser couldn’t start 3D graphics. Turn on hardware acceleration (or WebGL) and reload, on most browsers it’s under Settings › System.'
+ : 'Something went wrong starting Coin Communities. Reload to try again, if it keeps happening, your browser may be out of date.';
card.appendChild(msg);
const actions = document.createElement('div');
diff --git a/src/game/combat-system.js b/src/game/combat-system.js
index 6d8bbaef0..5da92c4e1 100644
--- a/src/game/combat-system.js
+++ b/src/game/combat-system.js
@@ -1,8 +1,8 @@
-// PlayCombat — the client half of W07: renders what the server's combat.js /
+// PlayCombat, the client half of W07: renders what the server's combat.js /
// combat-handlers.js already decide, and sends nothing but intents.
//
// The server is the sole authority (see multiplayer/src/combat-handlers.js):
-// this module never picks a target, rolls damage, or moves a mob — it renders
+// this module never picks a target, rolls damage, or moves a mob, it renders
// the roaming PvE mobs and lootable tombstones the room replicates on
// state.mobs/state.tombstones, paints the danger-zone ground the same way
// play-systems.js paints ponds/trees/rocks (from the SAME world-features.js
@@ -11,13 +11,13 @@
// combat/notice messages into the GTA-style vitals HUD (WorldHud) plus hit
// feedback (damage numbers, a screen flash, a death/respawn overlay).
//
-// Mob BODIES are rendered by W08's `src/game/npc/mobs.js` `MobSystem` — it was
+// Mob BODIES are rendered by W08's `src/game/npc/mobs.js` `MobSystem`, it was
// already built and correctly self-gated behind a `window.twsCombat` contract
// ("when W07 ships, mobs light up with zero changes here"). Rather than stand
// up a second, competing mob-rendering system, this module IS that contract:
// it installs `window.twsCombat` before `WorldLife` constructs its `MobSystem`
// (see coincommunities.js instantiation order) and feeds it this module's own
-// smoothed, per-frame interpolation of the server's authoritative positions —
+// smoothed, per-frame interpolation of the server's authoritative positions,
// so MobSystem's body + (future navmesh) pathing render OUR real combat data,
// with zero duplicate geometry. This module keeps only what MobSystem doesn't
// have: HP bars, death/respawn transitions, and combat feedback.
@@ -57,7 +57,7 @@ function el(tag, props = {}, kids = []) {
}
// A lightweight tracker for one live mob: no 3D object of its own (MobSystem
-// owns the body via the twsCombat bridge below) — just the smoothed position
+// owns the body via the twsCombat bridge below), just the smoothed position
// used to place the HP bar, plus death/respawn edge detection so the bridge
// knows when to despawn/respawn MobSystem's body.
class MobView {
@@ -95,7 +95,7 @@ class MobView {
const becameDead = !wasDead && this._dead;
const respawned = wasDead && !this._dead;
if (becameDead || respawned) {
- // A death or a respawn teleport should never glide — snap instantly.
+ // A death or a respawn teleport should never glide, snap instantly.
this.x = this.targetX; this.y = this.targetY; this.z = this.targetZ;
}
return { becameDead, respawned };
@@ -199,7 +199,7 @@ export class CombatSystem {
this.hud.minimap.setBoundary(WORLD_RADIUS);
// Must install before WorldLife constructs its MobSystem (see the module
- // doc comment) — coincommunities.js instantiates CombatSystem first.
+ // doc comment), coincommunities.js instantiates CombatSystem first.
this._installTwsCombatBridge();
this._unsub = [];
@@ -213,13 +213,13 @@ export class CombatSystem {
// -------------------------------------------------------- twsCombat bridge
// The W08 mob visual/nav system (src/game/npc/mobs.js MobSystem) already
- // implements a body + (future navmesh) walk from exactly this contract —
+ // implements a body + (future navmesh) walk from exactly this contract,
// see that file's header. We are the real implementation it was waiting on:
// every mob add/change/remove we hear from the server schema re-fires here
// verbatim, so MobSystem renders live combat data with zero duplicate
// geometry. `reportContact` is intentionally a no-op: our server already
// decides every mob's attack unilaterally from its own authoritative
- // positions each tick (see combat-handlers.js tickMobs) — trusting a
+ // positions each tick (see combat-handlers.js tickMobs), trusting a
// client-reported "I'm in melee range" would be exactly the kind of
// client-sent hit CLAUDE.md's anti-cheat baseline forbids.
_installTwsCombatBridge() {
@@ -268,7 +268,7 @@ export class CombatSystem {
document.body.appendChild(this.prompt);
}
- // Touch-friendly Attack action, shown only while a weapon is equipped — the
+ // Touch-friendly Attack action, shown only while a weapon is equipped, the
// keyboard equivalent is the 'x' key wired by the host (coincommunities.js).
_buildAttackButton() {
this.attackBtn = el('button', { class: 'combat-attack-btn', hidden: true, onclick: () => this.attack() }, [
@@ -325,7 +325,7 @@ export class CombatSystem {
const stats = MOB_STATS[mob.kind] || {};
const pos = { x: mob.x, z: mob.z };
// target === pos: MobSystem's own client-side nav-walk (a straight line
- // with no navmesh registered — see nav-graph.js findPath) then has zero
+ // with no navmesh registered, see nav-graph.js findPath) then has zero
// distance to cover, so the body sits exactly where our own per-frame
// twsState updates place it. It's ready to do real pathing the moment
// W01 registers a navmesh; nothing here has to change when that lands.
@@ -487,7 +487,7 @@ export class CombatSystem {
const parts = [];
if (nearest.t.gold > 0) parts.push(`$${nearest.t.gold}`);
if (nearest.t.count > 0) parts.push(`${nearest.t.count} item${nearest.t.count === 1 ? '' : 's'}`);
- // The tombstone owner is a remote player's chosen display name — untrusted
+ // The tombstone owner is a remote player's chosen display name, untrusted
// text. Build the prompt with textContent, never innerHTML, so a name like
// `<img onerror=…>` renders as literal text instead of executing for every
// player who walks near the tombstone.
diff --git a/src/game/community-net.js b/src/game/community-net.js
index 2c75b97f0..73ce0fbe1 100644
--- a/src/game/community-net.js
+++ b/src/game/community-net.js
@@ -1,11 +1,11 @@
-// CommunityNet — multiplayer client for Coin Communities.
+// CommunityNet, multiplayer client for Coin Communities.
//
// Each coin is its own world: we join the shared `walk_world` room definition
// but pass `token = <mint>` so Colyseus's filterBy matches us only with players
// who entered the same coin's community. The server (WalkRoom) is authoritative
// for position, emotes, avatars, and chat relay.
//
-// This is a focused sibling of walk-net.js — it adds coin identity, avatar URL,
+// This is a focused sibling of walk-net.js, it adds coin identity, avatar URL,
// and chat on top of the same room, and leaves the /walk page's client
// untouched.
@@ -31,7 +31,7 @@ function persistedPid(account) {
}
const RECONNECT_MAX_MS = 60_000;
// Attempts reset to 0 on every successful join, so this bounds ONE outage, not
-// the session. Six attempts gave up ~2.5 minutes in — shorter than a server
+// the session. Six attempts gave up ~2.5 minutes in, shorter than a server
// redeploy or instance replacement, which permanently stranded everyone present
// in single-player mid-session. Fourteen rides out ~11 minutes (the tail retries
// only once a minute) before parking on 'offline' with the manual retry().
@@ -49,7 +49,7 @@ export class CommunityNet {
* @param {string} [opts.name] display name
* @param {string} [opts.avatar] GLB/VRM URL for this player's avatar
* @param {string} [opts.agent] optional three.ws agent id
- * @param {object} [opts.coin] { mint, name, symbol, image } — '' mint = lobby
+ * @param {object} [opts.coin] { mint, name, symbol, image }, '' mint = lobby
* @param {string} [opts.tier] '' (open General world) | 'holders' (gated)
* @param {string} [opts.holderPass] signed pass required to join a holder world
* @param {number} [opts.holderMinUsd] USD floor the holder world gated on (HUD)
@@ -72,7 +72,7 @@ export class CommunityNet {
this.account = opts.account || '';
// Pre-join cosmetic loadout (W03): the compact wire string the creator built.
// The server re-validates ownership before applying it, so an unowned premium
- // id here is simply dropped — never trusted.
+ // id here is simply dropped, never trusted.
this.cosmetics = opts.cosmetics || '';
// Stable economy persistence key (wallet when signed in, else a guest id).
this.pid = persistedPid(this.account);
@@ -93,77 +93,77 @@ export class CommunityNet {
change: new Set(), // (player, id)
remove: new Set(), // (id)
chat: new Set(), // ({id, name, text, ts})
- interact: new Set(), // ({from, fromName, action, ts}) — a peer interacted with us
- denied: new Set(), // (reason) — server refused the join (e.g. holder gate); no retry
- voiceSignal: new Set(), // ({from, data}) — relayed WebRTC SDP/ICE from a peer
- ping: new Set(), // (ms) — smoothed round-trip latency to the server
- blockAdd: new Set(), // (key, type) — a voxel appeared (placed or restored)
- blockChange: new Set(), // (key, type) — a voxel was repainted
- blockRemove: new Set(), // (key) — a voxel was broken
- editReject: new Set(), // ({reason}) — the server refused one of our edits
- buildPerms: new Set(), // ({creator, cap, used, clearMaxRadius}) — build-permission snapshot (R19)
- buildCleared: new Set(), // ({count, all}) — creator clear-area result (R19)
- persistent: new Set(), // (bool) — whether this world's build is durably saved
- worldtime: new Set(), // (frac) — authoritative day fraction [0,1) for day/night
+ interact: new Set(), // ({from, fromName, action, ts}), a peer interacted with us
+ denied: new Set(), // (reason), server refused the join (e.g. holder gate); no retry
+ voiceSignal: new Set(), // ({from, data}), relayed WebRTC SDP/ICE from a peer
+ ping: new Set(), // (ms), smoothed round-trip latency to the server
+ blockAdd: new Set(), // (key, type), a voxel appeared (placed or restored)
+ blockChange: new Set(), // (key, type), a voxel was repainted
+ blockRemove: new Set(), // (key), a voxel was broken
+ editReject: new Set(), // ({reason}), the server refused one of our edits
+ buildPerms: new Set(), // ({creator, cap, used, clearMaxRadius}), build-permission snapshot (R19)
+ buildCleared: new Set(), // ({count, all}), creator clear-area result (R19)
+ persistent: new Set(), // (bool), whether this world's build is durably saved
+ worldtime: new Set(), // (frac), authoritative day fraction [0,1) for day/night
// Off-schema economy (private to this player; delivered as targeted messages).
- profile: new Set(), // (snapshot) — full purse/pack/skills on join + on demand
- inv: new Set(), // ({inv, hotbar, activeSlot, gold, hp, maxHp}) — economy delta
+ profile: new Set(), // (snapshot), full purse/pack/skills on join + on demand
+ inv: new Set(), // ({inv, hotbar, activeSlot, gold, hp, maxHp}), economy delta
xpgain: new Set(), // ({skill, amount, xp, level, levelXp, nextXp})
levelup: new Set(), // ({skill, level})
- notice: new Set(), // ({kind, text, ...}) — activity result toast (fish/eat/tool/full/quest)
+ notice: new Set(), // ({kind, text, ...}), activity result toast (fish/eat/tool/full/quest)
souvenir: new Set(), // ({id, name, slot, eventId, eventName}): a live event just granted this account its free commemorative wearable (once, ever)
// General store, bank/ATM & the $THREE boutique (W04).
store: new Set(), // ({sell:[{item,label,price}], buy:[{item,qty,price,label}]})
- boutique: new Set(), // ({listings, owned, configured}) — premium cosmetics priced in $THREE
- boutiqueQuote: new Set(), // ({id, price, quoteToken, txBase64}) — unsigned $THREE purchase to sign
- // Wheel of Fortune (W09) — Fortune's Folly, the Mainland casino wheel.
+ boutique: new Set(), // ({listings, owned, configured}), premium cosmetics priced in $THREE
+ boutiqueQuote: new Set(), // ({id, price, quoteToken, txBase64}), unsigned $THREE purchase to sign
+ // Wheel of Fortune (W09), Fortune's Folly, the Mainland casino wheel.
spinInfo: new Set(), // ({segments, now, nextFreeSpinAt, avgLevel, minLevel, eligible, atWheel, paidAvailable, symbol, costUsd})
- spinPrep: new Set(), // ({tx, tokenAmount, symbol, costUsd, quote}) — unsigned paid-spin tx to sign
- spinResult: new Set(), // ({mode, index, label, got, lost, refunded, nextFreeSpinAt?}) — the server's roll
- spinDenied: new Set(), // ({reason, ...}) — a spin request refused
- quests: new Set(), // ({offers, active, day, eventLive}) — jobs board + active runs (W05)
- questComplete: new Set(), // ({id, title, reward, kind, coop, event}) — a mission/heist finished
+ spinPrep: new Set(), // ({tx, tokenAmount, symbol, costUsd, quote}), unsigned paid-spin tx to sign
+ spinResult: new Set(), // ({mode, index, label, got, lost, refunded, nextFreeSpinAt?}), the server's roll
+ spinDenied: new Set(), // ({reason, ...}), a spin request refused
+ quests: new Set(), // ({offers, active, day, eventLive}), jobs board + active runs (W05)
+ questComplete: new Set(), // ({id, title, reward, kind, coop, event}), a mission/heist finished
// Live event (public/event.json window): the ranked standing for the event
// quest line, and this player's own running totals after each event job.
eventBoard: new Set(), // ({ok, event?, top?, you?, players?, totalRuns?, prizes?, reason?})
- eventScore: new Set(), // ({runs, cash, eventId}) — your totals after an event job
- combat: new Set(), // ({role:'attacker'|'victim', target:'mob'|'player', kind?, mobHp?, mobMaxHp?, playerHp, playerMaxHp, dealt, dead, attacker?}) — a swing/shot's result
+ eventScore: new Set(), // ({runs, cash, eventId}), your totals after an event job
+ combat: new Set(), // ({role:'attacker'|'victim', target:'mob'|'player', kind?, mobHp?, mobMaxHp?, playerHp, playerMaxHp, dealt, dead, attacker?}), a swing/shot's result
// W07 combat world entities: roaming PvE mobs + lootable death tombstones.
// add/change/remove mirror the vehicle callbacks below.
- mobAdd: new Set(), // (mob, id) — a mob entered our view (spawn/restore)
- mobChange: new Set(), // (mob, id) — its position/hp/state changed
- mobRemove: new Set(), // (id) — a mob left the world (respawn cycle)
- tombstoneAdd: new Set(), // (tombstone, id) — a death dropped a lootable marker
- tombstoneRemove: new Set(), // (id) — looted or expired
+ mobAdd: new Set(), // (mob, id), a mob entered our view (spawn/restore)
+ mobChange: new Set(), // (mob, id), its position/hp/state changed
+ mobRemove: new Set(), // (id), a mob left the world (respawn cycle)
+ tombstoneAdd: new Set(), // (tombstone, id), a death dropped a lootable marker
+ tombstoneRemove: new Set(), // (id), looted or expired
// Vehicles (synced world entities). add/change/remove mirror the player
// callbacks; `vehicle` carries the server's targeted enter/exit/deny ack.
- vehicleAdd: new Set(), // (vehicle, id) — a vehicle entered our view (spawn/restore)
- vehicleChange: new Set(), // (vehicle, id) — its transform/driver changed
- vehicleRemove: new Set(), // (id) — a vehicle left the world
- vehicle: new Set(), // ({event, id, ...}) — enter/exit/deny ack for our request
- // Generic world objects (R01/R02): the shared `objects` channel — balls,
+ vehicleAdd: new Set(), // (vehicle, id), a vehicle entered our view (spawn/restore)
+ vehicleChange: new Set(), // (vehicle, id), its transform/driver changed
+ vehicleRemove: new Set(), // (id), a vehicle left the world
+ vehicle: new Set(), // ({event, id, ...}), enter/exit/deny ack for our request
+ // Generic world objects (R01/R02): the shared `objects` channel, balls,
// build props, pickups. add/change/remove mirror the player callbacks; the
// live schema object is passed through so the manager reads current fields.
- objectAdd: new Set(), // (obj, id) — an object appeared (spawned or restored)
- objectChange: new Set(), // (obj, id) — its transform/owner changed
- objectRemove: new Set(), // (id) — an object left the world
- objectReject: new Set(), // ({reason}) — server refused a spawn (world/player full)
+ objectAdd: new Set(), // (obj, id), an object appeared (spawned or restored)
+ objectChange: new Set(), // (obj, id), its transform/owner changed
+ objectRemove: new Set(), // (id), an object left the world
+ objectReject: new Set(), // ({reason}), server refused a spawn (world/player full)
// Fired once per connection, the moment the FIRST authoritative state
- // snapshot has been decoded — i.e. every objectAdd/blockAdd the room had at
+ // snapshot has been decoded, i.e. every objectAdd/blockAdd the room had at
// join has already been emitted. `/play` uses it to retire the build it
// restored locally from the durable world store (P3.1), because from this
// point the room's own copies are in the scene and ours are duplicates.
synced: new Set(), // () : first full state patch applied
- reaction: new Set(), // ({id, emoji}) — a player sent a floating reaction
- tag: new Set(), // ({event, itId, leaderboard}) — tag mini-game state (R08)
- floorBeat: new Set(), // ({clip}) — disco-pad beat tick (R06): pulses the floor + aligns standing dancers
- king: new Set(), // ({event, phase, endsAt, scores, kingId, winner, zone}) — King of the Totem state (R07)
- social: new Set(), // ({type, ...}) — friends events: live DM, request/accept (W09)
+ reaction: new Set(), // ({id, emoji}), a player sent a floating reaction
+ tag: new Set(), // ({event, itId, leaderboard}), tag mini-game state (R08)
+ floorBeat: new Set(), // ({clip}), disco-pad beat tick (R06): pulses the floor + aligns standing dancers
+ king: new Set(), // ({event, phase, endsAt, scores, kingId, winner, zone}), King of the Totem state (R07)
+ social: new Set(), // ({type, ...}), friends events: live DM, request/accept (W09)
};
// Optional async presence-ticket supplier (W09). When provided, its resolved
// token rides the join so this coin world publishes the player's account
// presence to their friends and can deliver DMs here live. Without it the
- // player is connected but invisible to the social graph — the /walk surface
+ // player is connected but invisible to the social graph, the /walk surface
// has always passed one; /play now does too.
this.getPresence = typeof opts.getPresence === 'function' ? opts.getPresence : null;
this.ping = null; // smoothed RTT in ms, null until the first echo
@@ -202,7 +202,7 @@ export class CommunityNet {
// Detach and close the current room without triggering a reconnect. Every
// (re)connect replaces this.room; if the previous room were left live its
// socket would keep firing onMessage('chat') alongside the new one, so a
- // single broadcast got appended once per leftover connection — the duplicate
+ // single broadcast got appended once per leftover connection, the duplicate
// chat bug. State-based events (move/avatar/blocks) hid it by being
// idempotent; chat appends a row on every delivery, so it showed.
_closeRoom() {
@@ -219,19 +219,19 @@ export class CommunityNet {
if (this._destroyed) return;
this._closeRoom();
// No multiplayer server resolved for this environment (production with no
- // game-server meta/env). Surface a distinct, honest 'unavailable' state —
- // solo play still works — rather than throwing in `new Client('')`,
+ // game-server meta/env). Surface a distinct, honest 'unavailable' state,
+ // solo play still works, rather than throwing in `new Client('')`,
// looping on reconnects, or showing a "reconnecting…" pill that can never
// reconnect. (The exhausted-reconnect path below stays 'offline' because
// there a real server exists and a manual retry can still succeed.)
if (!this.url) {
- this._setStatus('unavailable', 'multiplayer unavailable — single-player only');
+ this._setStatus('unavailable', 'multiplayer unavailable, single-player only');
return;
}
// Bump a generation token so a slower in-flight connect (e.g. a manual
// retry racing the auto-reconnect timer) can detect it's been superseded
// after its await resolves and discard the room it joined, rather than
- // orphaning a second live socket — the same duplicate-chat leak.
+ // orphaning a second live socket, the same duplicate-chat leak.
const gen = ++this._connectGen;
this._setStatus('connecting');
try {
@@ -239,7 +239,7 @@ export class CommunityNet {
const mint = this.coin.mint || '';
// Resolve the presence ticket before the join so it can ride the options.
// Anonymous players resolve to null (nothing to publish) and a failed mint
- // must never block play — hence the catch: the world still joins, the
+ // must never block play, hence the catch: the world still joins, the
// player is simply offline to their friends until the next reconnect.
const presence = this.getPresence ? await this.getPresence().catch(() => null) : null;
const options = {
@@ -272,13 +272,13 @@ export class CommunityNet {
// until its ping retries expire. The server retires that exact session,
// and only when the persistent player key above matches ours too.
...(this.sessionId ? { prevSession: this.sessionId } : {}),
- // Signed guest token (server-minted, HMAC-sealed guest id). This — not
- // the raw pid — is what proves a guest owns their saved progression.
+ // Signed guest token (server-minted, HMAC-sealed guest id). This, not
+ // the raw pid, is what proves a guest owns their saved progression.
...(this._guestToken() ? { guestToken: this._guestToken() } : {}),
// Signed presence ticket (W09). WalkRoom verifies it and registers the
// account with the social hub under this world's name, so friends see
// "Online · <coin> Town" and DMs route to this socket. Omitted entirely
- // when anonymous — the server treats its absence as "don't publish".
+ // when anonymous, the server treats its absence as "don't publish".
...(presence ? { presence } : {}),
};
// Holder worlds require a signed pass the server verifies in onAuth; carry
@@ -289,7 +289,7 @@ export class CommunityNet {
}
// Hard timeout on the join: a hung handshake (Cloud Run cold start, wedged
// room, proxy holding the upgrade) would otherwise strand us in 'connecting'
- // forever — joinOrCreate has no timeout of its own. On timeout this throws
+ // forever, joinOrCreate has no timeout of its own. On timeout this throws
// 'connect_timeout', falling through to the catch → reconnect with backoff.
// No root-schema class passed on purpose: decode from the server's reflected
// schema (handshake) so the client never desyncs when a deployed server adds an
@@ -303,7 +303,7 @@ export class CommunityNet {
this.sessionId = this.room.sessionId;
// Guest identity (see guest-token.js server-side): the room seals our guest
- // id into a signed token and hands it back on every join. Persist it — the
+ // id into a signed token and hands it back on every join. Persist it, the
// token is the credential that lets this device reclaim its progression.
this.room.onMessage('guestToken', (msg) => {
if (msg && typeof msg.token === 'string' && msg.token) {
@@ -369,7 +369,7 @@ export class CommunityNet {
this.room.onMessage('floor:beat', (msg) => this._emit('floorBeat', msg || {}));
// King of the Totem (R07): the room broadcasts round start/tick/end (and a
// targeted sync on join) for the hold-the-totem mini-game. Server-authoritative
- // — the client only renders the HUD + zone. Colon-namespaced like floor:beat;
+ //, the client only renders the HUD + zone. Colon-namespaced like floor:beat;
// normalized to a camelCase `king` event.
this.room.onMessage('game:king', (msg) => this._emit('king', msg || {}));
@@ -378,7 +378,7 @@ export class CommunityNet {
// Guard each collection: if the server is running an older schema that
// doesn't include a field yet, the proxy returns undefined for that key
- // and calling .onAdd() on undefined throws — breaking the connect loop.
+ // and calling .onAdd() on undefined throws, breaking the connect loop.
const $players = $state?.players;
if ($players) {
$players.onAdd((player, id) => {
@@ -401,7 +401,7 @@ export class CommunityNet {
}
// Voxel builds: the server is authoritative for every block, so the
- // world's geometry is driven entirely by these state callbacks — local
+ // world's geometry is driven entirely by these state callbacks, local
// place/break clicks only *send*; the block appears when the server
// echoes it back, keeping every client's build identical. onAdd fires
// for the full persisted build at join time and for each new placement.
@@ -417,7 +417,7 @@ export class CommunityNet {
// Vehicles: synced world entities. The full parked fleet arrives via onAdd
// at join; onChange streams each driver's transform; onRemove drops one.
- // Optional field (servers pre-dating vehicles omit it) — guarded like blocks.
+ // Optional field (servers pre-dating vehicles omit it), guarded like blocks.
const $vehicles = $state?.vehicles;
if ($vehicles) {
$vehicles.onAdd((vehicle, id) => {
@@ -429,8 +429,8 @@ export class CommunityNet {
// Combat world entities (W07): roaming PvE mobs + lootable death tombstones.
// Both are server-owned synced state (everyone must see them, like
- // vehicles) — mirrors the vehicles wiring above exactly. Optional fields
- // (servers pre-dating combat omit them) — guarded like blocks/vehicles.
+ // vehicles), mirrors the vehicles wiring above exactly. Optional fields
+ // (servers pre-dating combat omit them), guarded like blocks/vehicles.
const $mobs = $state?.mobs;
if ($mobs) {
$mobs.onAdd((mob, id) => {
@@ -446,10 +446,10 @@ export class CommunityNet {
}
// Generic world objects (R01): the server is authoritative for every object,
- // so the scene is driven entirely by these state callbacks — local spawn/
+ // so the scene is driven entirely by these state callbacks, local spawn/
// move/remove only *send*; the object appears when the server echoes it back.
// onAdd fires for the full persisted set (durable props, R17) at join and for
- // each new spawn. Optional field (older servers omit it) — guarded like blocks.
+ // each new spawn. Optional field (older servers omit it), guarded like blocks.
const $objects = $state?.objects;
if ($objects) {
$objects.onAdd((obj, id) => {
@@ -484,13 +484,13 @@ export class CommunityNet {
this.room.onLeave((code, reason) => {
this._setStatus('offline');
// A play-pass eviction (the server dropped us because our pass expired
- // without a refresh — the wallet may have fallen below the token floor) is
+ // without a refresh, the wallet may have fallen below the token floor) is
// terminal: reconnecting would just fail onAuth again, so surface it as a
// denial and route the player back to the sign-in gate. Detect it by the
// server's close REASON, never by the bare close code: the legacy eviction
// code 4002 is also Colyseus's own WS_CLOSE_WITH_ERROR, which the server
// sends for any internal error (e.g. a message type this room build doesn't
- // know) — treating those as "session expired" kicked healthy players to a
+ // know), treating those as "session expired" kicked healthy players to a
// sign-in gate that wasn't even enabled. Anything else non-consented is a
// connection fault: reconnect with backoff.
if (/play_pass/i.test(reason || '')) { this._setStatus('denied', 'play_pass_required'); this._emit('denied', 'play_pass_required'); return; }
@@ -505,7 +505,7 @@ export class CommunityNet {
// reconnects while standing still never sends a move (the position is
// unchanged from the pre-drop one), so the server keeps them at spawn and
// every peer sees them teleported to 0,0,0 until they happen to walk.
- // The RTT sample is dropped for the same reason — its send is gone.
+ // The RTT sample is dropped for the same reason, its send is gone.
this._lastSent = null;
this._lastSentAt = 0;
this._pingSentAt = 0;
@@ -520,7 +520,7 @@ export class CommunityNet {
});
} catch (err) {
const msg = err?.message ?? String(err);
- // A holder-gate refusal (onAuth threw) is terminal, not a flaky link —
+ // A holder-gate refusal (onAuth threw) is terminal, not a flaky link,
// retrying with the same expired/invalid pass just loops. Surface it so
// the scene can route the player back to the gate, and stop here.
if (/holder_pass|play_pass/i.test(msg)) {
@@ -537,13 +537,13 @@ export class CommunityNet {
// Exponential backoff with a hard ceiling. When the game server isn't
// reachable at all (e.g. not deployed), every attempt costs an 8s+ XHR
- // timeout — retrying forever at a fixed 3s floods the console and the
+ // timeout, retrying forever at a fixed 3s floods the console and the
// network tab. After MAX_RECONNECT_ATTEMPTS we stop and stay 'offline';
// the UI can offer manual reconnect via retry().
_scheduleReconnect() {
if (this._reconnectTimer || this._destroyed) return;
if (this._reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
- this._setStatus('offline', 'multiplayer unreachable — single-player only');
+ this._setStatus('offline', 'multiplayer unreachable, single-player only');
return;
}
const attempt = this._reconnectAttempts++;
@@ -560,7 +560,7 @@ export class CommunityNet {
// reference is still live, and ws.send() on that socket logs a console
// warning per message ("WebSocket is already in CLOSING or CLOSED state").
// Returns true when the message reached an open socket; dropped messages are
- // fine — every send here is a live-state signal the reconnect resyncs anyway.
+ // fine, every send here is a live-state signal the reconnect resyncs anyway.
_send(type, payload) {
const room = this.room;
if (!room || room.connection?.isOpen !== true) return false;
@@ -613,7 +613,7 @@ export class CommunityNet {
// ownership, updates the player's schema `cosmetics` field (so peers re-render)
// and replies with a fresh profile. An unowned id is rejected with a 'notice'.
equipCosmetic(id) { this._send('equip-cosmetic', { id }); }
- // Broadcast a full loadout wire in one shot — mirrors how the avatar is sent.
+ // Broadcast a full loadout wire in one shot, mirrors how the avatar is sent.
// Server validates every id against the catalog and the account's owned set,
// drops anything invalid or unowned, and publishes the sanitized wire on the
// schema so all peers re-render the correct look.
@@ -688,7 +688,7 @@ export class CommunityNet {
// Generic world objects (R01/R02). These only *request* the change; the object
// appears/moves/disappears when the server echoes its authoritative `objects`
// state back (see the objectAdd/Change/Remove wiring above). The server assigns
- // ownership, mints/clamps ids, and bounds-clamps the transform — the client
+ // ownership, mints/clamps ids, and bounds-clamps the transform, the client
// never trusts its own optimistic copy. x/y/z must be finite or the server drops
// the spawn, so we guard here too and skip a malformed send.
spawnObject(kind, opts = {}) {
@@ -723,7 +723,7 @@ export class CommunityNet {
}
// Does an object's server-assigned ownerId belong to THIS client? The server keys
// ownership on the verified account when signed in, else the persisted economy id,
- // else the session id (WalkRoom._ownerKey) — match all three so delete-own works
+ // else the session id (WalkRoom._ownerKey), match all three so delete-own works
// in gated, un-gated, and guest sessions alike.
ownsObject(obj) {
const owner = obj?.ownerId;
@@ -733,7 +733,7 @@ export class CommunityNet {
// Adopt a refreshed play pass. Store it so the next reconnect (after a drop)
// uses the fresh credential, AND push it to the live session so the server can
- // extend this connection's bound expiry — otherwise the server's per-minute
+ // extend this connection's bound expiry, otherwise the server's per-minute
// sweep evicts a still-qualifying player at the original 10-min TTL (which
// stranded anyone in a long building session). The server re-verifies the pass
// against the gate before extending; a forged or below-floor pass is ignored.
@@ -754,7 +754,7 @@ export class CommunityNet {
// Call when the page comes back to the foreground. A backgrounded tab is the
// one case where the client's own status can be a lie: iOS Safari suspends the
// whole page, the OS reaps the TCP connection, and no 'close' event is ever
- // delivered — so the client still reads 'online' while every send silently
+ // delivered, so the client still reads 'online' while every send silently
// drops into a dead socket and no peer update ever arrives again. Probing the
// connection on resume converts that invisible half-death into the normal
// reconnect path. It also short-circuits the backoff when the retries were
@@ -763,7 +763,7 @@ export class CommunityNet {
resume() {
if (this._destroyed || !this.url) return;
if (this.status === 'online' && this.room?.connection?.isOpen !== true) {
- log.warn('[community-net] socket died while backgrounded — reconnecting');
+ log.warn('[community-net] socket died while backgrounded, reconnecting');
this._closeRoom();
this._setStatus('offline');
this.retry();
diff --git a/src/game/economy-ui.js b/src/game/economy-ui.js
index 6ac9deb0b..fe3298e73 100644
--- a/src/game/economy-ui.js
+++ b/src/game/economy-ui.js
@@ -1,9 +1,9 @@
-// Economy UI (W04) — the general store and bank/ATM modals opened by walking
+// Economy UI (W04), the general store and bank/ATM modals opened by walking
// up to their NPC and pressing E (npc/economy-npcs.js). Both are thin, honest
// clients of the server-authoritative cash economy: every button sends an
// intent over CommunityNet, the server prices/validates/mutates the profile,
// and the result streams back through the existing 'store'/'profile'/'inv'/
-// 'notice' events — this module never assumes a trade landed until the server
+// 'notice' events, this module never assumes a trade landed until the server
// confirms it. The $THREE boutique is a separate, on-chain flow that lives in
// the wardrobe panel (play-systems.js), not here.
@@ -26,7 +26,7 @@ function el(tag, props = {}, kids = []) {
}
// Base modal shell shared by the store, the bank, and (src/game/quests-ui.js)
-// the Jobs Board — overlay, card, header with a title + close button, and
+// the Jobs Board, overlay, card, header with a title + close button, and
// open/close lifecycle (fade + teardown). Exported so sibling panels reuse the
// exact same shell instead of forking it.
export class EconPanel {
@@ -191,7 +191,7 @@ let _openBank = null;
/**
* Open the general store: buy tools/consumables with cash, or sell gathered
- * goods for cash. Idempotent — a second call while one is open just refocuses
+ * goods for cash. Idempotent, a second call while one is open just refocuses
* it (mirrors coin-buy.js's TradeModal singleton).
* @param {{ ui: object, net: object }} deps
*/
@@ -253,7 +253,7 @@ class StorePanel extends EconPanel {
if (Number.isFinite(snap.gold)) this.profile.gold = snap.gold;
if (Array.isArray(snap.inv)) this.profile.inv = snap.inv;
this.purseValue.textContent = this.profile.gold.toLocaleString();
- // The purse is a plain number on screen — nothing a screen reader would
+ // The purse is a plain number on screen, nothing a screen reader would
// revisit after a trade. Announce the delta so the outcome of a buy/sell
// is audible, not just visible.
if (Number.isFinite(snap.gold) && snap.gold !== before) {
@@ -317,7 +317,7 @@ class StorePanel extends EconPanel {
.map((slot, i) => ({ slot, i }))
.filter(({ slot }) => slot?.item && slot.qty > 0 && sellable.has(slot.item));
if (!rows.length) {
- this.body.appendChild(el('div', { class: 'ec-empty', text: 'Nothing to sell yet — gather wood, stone, coal, fish or hides out in the world and bring them back.' }));
+ this.body.appendChild(el('div', { class: 'ec-empty', text: 'Nothing to sell yet, gather wood, stone, coal, fish or hides out in the world and bring them back.' }));
return;
}
for (const { slot, i } of rows) {
@@ -364,7 +364,7 @@ class BankPanel extends EconPanel {
this.bankBal = 0;
// Until the server's profile lands, both balances read as unknown rather
- // than as a confident "0" — telling a player they are broke when we have
+ // than as a confident "0", telling a player they are broke when we have
// simply not looked yet is the worst thing this panel could say.
this.purseValue = el('b', { class: 'ec-pending-val', text: '…' });
this.purse = el('div', { class: 'ec-purse' }, [
diff --git a/src/game/npc/ambient-life.js b/src/game/npc/ambient-life.js
index 6adffbf40..0e06e5e0a 100644
--- a/src/game/npc/ambient-life.js
+++ b/src/game/npc/ambient-life.js
@@ -1,9 +1,9 @@
-// Ambient world life — pedestrians and vehicle traffic that make the plaza
+// Ambient world life, pedestrians and vehicle traffic that make the plaza
// breathe (W08).
//
// Everything here is a *pure function of a shared world clock* (wall time) and
// the world seed, so two players standing in the same town see the same crowd
-// walking the same routes and the same cars on the same stretch of road —
+// walking the same routes and the same cars on the same stretch of road,
// without a single ambient NPC crossing the wire. That's the brief's deal:
// ambient life is client-side and deterministic; only consequential NPCs
// (vendors, quests, mobs) are server-authoritative.
@@ -26,7 +26,7 @@ import { loadCitizenPool, isCitizen } from './citizens.js';
const DEFAULT_AVATAR = '/avatars/default.glb';
-const PED_WALK_SPEED = 1.35; // m/s along the loop — an unhurried stroll
+const PED_WALK_SPEED = 1.35; // m/s along the loop, an unhurried stroll
const DETAILED_PEDS = 6; // GLB-bodied pedestrians near the centre
const IMPOSTOR_PEDS = 14; // cheap instanced crowd in the distance
const VEHICLES = 5; // cars/wagons on the ring road
@@ -102,7 +102,7 @@ class Pedestrian {
// so this path is hot in a busy world.
if (this._disposed) { releaseAvatar(this.rig); return; }
this.height = height;
- // Loaded into idle by buildAvatar — set them strolling.
+ // Loaded into idle by buildAvatar, set them strolling.
if (!this._held) this.anim.crossfadeTo(CLIP_WALK, 0.2).catch(() => {});
})
.catch(() => {});
@@ -126,7 +126,7 @@ class Pedestrian {
}
update(dt, T, player) {
- // Base position is a pure function of the shared clock — identical on every
+ // Base position is a pure function of the shared clock, identical on every
// client. Arc-length advances at a steady stroll. Hold-to-talk is a local,
// cosmetic deviation like the sidestep below: while held the pedestrian
// banks lag instead of moving, and afterwards walks it off at a brisk pace
@@ -236,7 +236,7 @@ class Vehicle {
}
update(dt, T, player) {
- // Target arc-length from the shared clock — the consistent baseline.
+ // Target arc-length from the shared clock, the consistent baseline.
const targetL = this.phase + this.dir * VEHICLE_SPEED * T;
// Yield to the local player: if they're standing on the road just ahead,
@@ -290,7 +290,7 @@ export class AmbientLife {
}
// A single InstancedMesh pair (bodies + heads) carries the whole background
- // crowd on the outermost loop — one draw call each, no per-ped objects.
+ // crowd on the outermost loop, one draw call each, no per-ped objects.
_buildImpostors() {
const rand = mulberry32((this.nav.seed ^ 0x9e3779b9) >>> 0);
const bodyGeo = new CapsuleGeometry(0.28, 0.7, 4, 8);
@@ -305,7 +305,7 @@ export class AmbientLife {
for (let i = 0; i < IMPOSTOR_PEDS; i++) {
bodies.setColorAt(i, new Color(palette[i % palette.length]));
this._impostorSpec.push({
- loopIdx: 0, // outermost loop only — keeps impostors in the distance
+ loopIdx: 0, // outermost loop only, keeps impostors in the distance
phase: rand() * 1000,
speed: PED_WALK_SPEED * (0.85 + rand() * 0.4),
bob: rand() * Math.PI * 2,
@@ -341,7 +341,7 @@ export class AmbientLife {
}
// Deterministic avatar assignment: shuffle the pool by seed so ped #k shows the
- // same model — and therefore the same identity — on every client.
+ // same model, and therefore the same identity, on every client.
_pedAvatar(k) {
const pool = this._avatarPool;
if (!pool || !pool.length) return null;
@@ -393,7 +393,7 @@ export class AmbientLife {
}
for (const v of this.vehicles) v.update(dt, T, player);
- // Impostor crowd — one matrix write per instance, distance only.
+ // Impostor crowd, one matrix write per instance, distance only.
if (this._impostor) {
const { bodies, heads } = this._impostor;
for (let i = 0; i < this._impostorSpec.length; i++) {
diff --git a/src/game/npc/mobs.js b/src/game/npc/mobs.js
index 5016b4d2e..715a6b07c 100644
--- a/src/game/npc/mobs.js
+++ b/src/game/npc/mobs.js
@@ -1,6 +1,6 @@
// Hostile mobs & enforcers (W08 × W07).
//
-// Mobs are consequential — they deal damage and drop loot — so unlike the
+// Mobs are consequential, they deal damage and drop loot, so unlike the
// ambient crowd they are NOT client-authoritative. Their existence, health,
// damage, movement, and rewards belong to the combat system (W07). This module
// is the *visual* half: given an authoritative hostile from W07, it puts a body
@@ -10,13 +10,13 @@
// nothing here grants an effect.
//
// W07 isn't merged yet, so this system is fully gated: with no `window.twsCombat`
-// contract present it spawns nothing and fakes no combat — it simply sleeps until
+// contract present it spawns nothing and fakes no combat, it simply sleeps until
// the foundation it depends on lands. The contract it consumes:
//
// window.twsCombat.onHostileSpawn(cb) cb({ id, kind, pos, target, speed })
// window.twsCombat.onHostileState(cb) cb({ id, pos?, target? }) // server moves
// window.twsCombat.onHostileDespawn(cb) cb({ id })
-// window.twsCombat.reportContact(id) // mob reached melee range — server rules
+// window.twsCombat.reportContact(id) // mob reached melee range, server rules
//
// When W07 ships, mobs light up with zero changes here.
@@ -28,9 +28,9 @@ const MOB_TINT = {
enforcer: 0x3a4656, bandit: 0x5a2a2a,
dummy: 0x9aa3b2, goblin: 0x5f8a3a, ogre: 0x8a6a3a, troll: 0x4a6a6a,
};
-const CONTACT_RANGE = 1.6; // metres — when we tell W07 the mob is in melee
+const CONTACT_RANGE = 1.6; // metres, when we tell W07 the mob is in melee
const YAW_EPSILON_M = 0.005; // per-frame moves smaller than this don't steer
-const YAW_LERP = 10; // 1/s — how fast the body turns into its heading
+const YAW_LERP = 10; // 1/s, how fast the body turns into its heading
function shortestAngle(a, b) {
let d = b - a;
@@ -39,7 +39,7 @@ function shortestAngle(a, b) {
return d;
}
-// A single hostile body — a menacing capsule until W07 supplies a model. The
+// A single hostile body, a menacing capsule until W07 supplies a model. The
// server (via W07's per-frame setPos stream) owns where it stands; this class
// only makes the body face the way it is actually moving and reports melee
// contact. It never decides anything.
@@ -78,7 +78,7 @@ class Mob {
}
update(dt, onContact) {
- // Ease the body toward its latest heading — a small lerp keeps turns smooth
+ // Ease the body toward its latest heading, a small lerp keeps turns smooth
// even though the heading itself updates in discrete per-frame steps.
this.rig.rotation.y += shortestAngle(this.rig.rotation.y, this._yaw) * Math.min(1, dt * YAW_LERP);
@@ -88,11 +88,11 @@ class Mob {
this._contacted = true;
onContact?.(this.id);
} else if (this._contacted && Math.hypot(tx, tz) > CONTACT_RANGE * 1.5) {
- this._contacted = false; // left melee — allow a future contact report
+ this._contacted = false; // left melee, allow a future contact report
}
}
- // Mobs respawn continuously all session — free the GPU resources, not just the
+ // Mobs respawn continuously all session, free the GPU resources, not just the
// scene-graph node, or every kill leaks a capsule + sphere + two materials.
dispose() {
this.scene.remove(this.rig);
@@ -114,7 +114,7 @@ export class MobSystem {
const combat = typeof window !== 'undefined' ? window.twsCombat : null;
this.enabled = !!(combat && typeof combat.onHostileSpawn === 'function');
- if (!this.enabled) return; // W07 absent — sleep, spawn nothing, fake nothing
+ if (!this.enabled) return; // W07 absent, sleep, spawn nothing, fake nothing
this.combat = combat;
this._unsub.push(combat.onHostileSpawn((spec) => this._spawn(spec)));
diff --git a/src/game/npc/npc.js b/src/game/npc/npc.js
index 947fc0681..0dcf5929d 100644
--- a/src/game/npc/npc.js
+++ b/src/game/npc/npc.js
@@ -1,4 +1,4 @@
-// A generalized interactive NPC — the reusable engine behind the Agent Exchange.
+// A generalized interactive NPC, the reusable engine behind the Agent Exchange.
//
// agent-commerce.js proved the pattern: a GLB-bodied character standing in the
// world, a proximity prompt, a dialogue beat, and a real role action on E/tap.
@@ -113,7 +113,7 @@ export class Npc {
interact(ctx) {
this.faceTowards(ctx.player);
if (typeof this.def.onInteract === 'function') {
- try { this.def.onInteract({ npc: this, ...ctx }); } catch { /* role action failed — stay silent rather than crash the loop */ }
+ try { this.def.onInteract({ npc: this, ...ctx }); } catch { /* role action failed, stay silent rather than crash the loop */ }
return;
}
const lines = this.def.dialogue || [];
@@ -137,7 +137,7 @@ export class Npc {
this._disposed = true;
// Free the shared-template clone's GPU buffers, not just the scene-graph
// reference. 21 NPCs per world across five world hops is 105 orphaned
- // skinned avatars otherwise — the mobile-OOM profile.
+ // skinned avatars otherwise, the mobile-OOM profile.
releaseAvatar(this.rig);
this.scene.remove(this.rig);
this.label.remove();
diff --git a/src/game/npc/world-life.js b/src/game/npc/world-life.js
index 15070acee..e28b7d70a 100644
--- a/src/game/npc/world-life.js
+++ b/src/game/npc/world-life.js
@@ -1,4 +1,4 @@
-// World life — the W08 manager that makes a coin world feel inhabited.
+// World life, the W08 manager that makes a coin world feel inhabited.
//
// It owns one deterministic nav graph and hangs everything off it: the ambient
// crowd and traffic (ambient-life.js), the interactive NPCs from the catalog
@@ -6,7 +6,7 @@
// waypoints the jobs board drives (quest-markers.js), the W07-gated mobs
// (mobs.js), and the bit of road geometry that makes the traffic legible.
// coincommunities.js builds one of these per world on enter, ticks it in the
-// render loop, routes E / tap to it, and disposes it on leave — the same
+// render loop, routes E / tap to it, and disposes it on leave, the same
// lifecycle the Agent Exchange already uses. The Agent Exchange stays its own
// special module; this manages everyone else.
@@ -28,10 +28,10 @@ import { log } from '../../shared/log.js';
const ROLE_RING = { vendor: 0x46d49a, quest: 0xffce6e, bank: 0xe6b422, flavor: 0xffffff };
export class WorldLife {
- // world: { mint, name, symbol, seed, biome } — biome is the resolved env
+ // world: { mint, name, symbol, seed, biome }, biome is the resolved env
// biome object; name/symbol feed the world-aware NPC chat prompt.
// onInspectNpc (optional): called with an interactive Npc when the player
- // selects one from outside its interaction range — the host opens its
+ // selects one from outside its interaction range, the host opens its
// profile (coincommunities wires the shared avatar inspector).
constructor({ scene, camera, renderer, getPlayer, ui, net, world, radius = 54, onInspectNpc }) {
this.scene = scene;
@@ -58,7 +58,7 @@ export class WorldLife {
onInspectPed: (ped) => this._inspectPed(ped),
});
this.mobs = new MobSystem({ scene });
- // Waypoints for the jobs board's active objectives (W08 hooking W05) —
+ // Waypoints for the jobs board's active objectives (W08 hooking W05),
// pure client render of the same quest-zones.js the server already
// validates goto/interact against; it drives itself off the 'quests'
// snapshot, so it needs only the network handle, not the NPC list.
@@ -67,7 +67,7 @@ export class WorldLife {
// Interactive NPCs from the data-driven catalog: the Agent Exchange
// roster (real x402 micro-services), the general-store clerks + bank
// teller (W04's off-schema cash economy), and the quest-givers (W08
- // hooking W05's jobs board — see quest-npcs.js) — fronted by the
+ // hooking W05's jobs board, see quest-npcs.js), fronted by the
// room's own message channel, no on-chain settlement for either.
this.npcs = [...npcCatalogFor(), ...economyNpcsFor(), ...questNpcsFor()].map((def) => {
const npc = new Npc(scene, def);
@@ -91,7 +91,7 @@ export class WorldLife {
return npc;
});
- // One shared "press E" prompt for whichever NPC — or quest zone —
+ // One shared "press E" prompt for whichever NPC, or quest zone,
// you're nearest.
this.prompt = document.createElement('div');
this.prompt.className = 'npc-prompt';
@@ -182,7 +182,7 @@ export class WorldLife {
// The single thing the shared "press E" prompt/interact acts on: whichever
// of (nearest NPC, nearest in-range quest zone) is actually closer. Quest
- // zones only ever contend for "interact" kind — a goto waypoint has nothing
+ // zones only ever contend for "interact" kind, a goto waypoint has nothing
// to press E on, so it never enters this contest.
_nearestInteractable(p) {
if (!p) return null;
@@ -244,8 +244,8 @@ export class WorldLife {
const pulse = 0.22 + 0.1 * (0.5 + 0.5 * Math.sin(this._ringT * 2));
for (const npc of this.npcs) if (npc.marker) npc.marker.material.opacity = pulse;
- // Single proximity prompt for whichever interactable — NPC or quest
- // zone — is nearest right now. Keyed by a stable id so we don't churn
+ // Single proximity prompt for whichever interactable, NPC or quest
+ // zone, is nearest right now. Keyed by a stable id so we don't churn
// the DOM/innerHTML every frame for the same target.
const nearest = player ? this._nearestInteractable(player) : null;
const key = nearest ? (nearest.kind === 'npc' ? `npc:${nearest.npc.id}` : `quest:${nearest.zone.id}`) : null;
@@ -271,7 +271,7 @@ export class WorldLife {
// Walk-up trigger: an NPC with `onApproach` fires it once when the player
// enters its range, and re-arms only after the player walks away (1 m of
// hysteresis so boundary jitter can't re-fire it). Driven off the nearest
- // NPC specifically (not the combined prompt target) — a quest zone
+ // NPC specifically (not the combined prompt target), a quest zone
// winning the shared prompt shouldn't suppress an NPC's own approach line.
const nearNpc = player ? this._nearestNpc(player) : null;
if (player) {
@@ -290,7 +290,7 @@ export class WorldLife {
// Player pressed E: talk to / open the nearest NPC, or act at the nearest
// in-range quest zone (courier pickup/dropoff, a heist terminal, the vault
- // door) — whichever is actually closer. The quest path only ever SENDS the
+ // door), whichever is actually closer. The quest path only ever SENDS the
// intent; the server re-derives the zone from its own authoritative
// position and rules on it, same as every other off-schema action. Returns
// true if one consumed the press, so the caller can stop here.
@@ -308,7 +308,7 @@ export class WorldLife {
return true;
}
- // Tap/click any character in the world — the touch equivalent of E, extended
+ // Tap/click any character in the world, the touch equivalent of E, extended
// to every walker. An interactive NPC tapped in range runs its role action
// (counter, chat, board); tapped from afar it opens its profile instead. An
// ambient pedestrian with a gallery identity opens its citizen profile card
@@ -363,7 +363,7 @@ export class WorldLife {
this.npcs = [];
if (this.roadGroup) {
this.scene.remove(this.roadGroup);
- // Road band + kerb are one-off RingGeometries with their own materials —
+ // Road band + kerb are one-off RingGeometries with their own materials,
// free them, this group is rebuilt for every world enter.
for (const child of this.roadGroup.children) {
child.geometry.dispose();
diff --git a/src/game/photo-mode.css b/src/game/photo-mode.css
index 9dc4197ad..1e0a33546 100644
--- a/src/game/photo-mode.css
+++ b/src/game/photo-mode.css
@@ -1,4 +1,4 @@
-/* Photo mode (/play) — shutter flash + the preview card.
+/* Photo mode (/play), shutter flash + the preview card.
Loaded with src/game/photo-mode.js, which is imported lazily on the first
press, so none of this reaches a player who never takes a photo.
Tokens come from coincommunities.css; the fallbacks keep the sheet readable
diff --git a/src/game/photo-mode.js b/src/game/photo-mode.js
index 594c05cdb..f3172edd0 100644
--- a/src/game/photo-mode.js
+++ b/src/game/photo-mode.js
@@ -1,4 +1,4 @@
-// Photo mode for /play — the screenshot people post.
+// Photo mode for /play, the screenshot people post.
//
// Press the HUD camera button or P and the world is captured, composited onto a
// share card, and offered back as a download or a clipboard image. Everything
@@ -286,7 +286,7 @@ function showPreview({ blob, width, height, stamp, filename, onClose }) {
'aria-disabled': copyable ? null : 'true',
title: copyable
? 'Copy the image to your clipboard'
- : 'This browser cannot put images on the clipboard — Download saves the same file',
+ : 'This browser cannot put images on the clipboard, Download saves the same file',
}, [el('span', { 'aria-hidden': 'true', text: '⧉' }), document.createTextNode('Copy image')]);
copyBtn.addEventListener('click', async () => {
// Honest rather than hidden: browsers without the async clipboard image
@@ -384,7 +384,7 @@ export async function takePhoto({ renderer, scene, camera, coinLabel, worldLabel
shutter();
const shot = captureSceneCanvas(renderer, scene, camera, { maxWidth: MAX_CAPTURE_WIDTH });
if (!shot) {
- toast?.('Couldn’t photograph the world just now — try again in a moment.', 'warn');
+ toast?.('Couldn’t photograph the world just now, try again in a moment.', 'warn');
return false;
}
@@ -396,7 +396,7 @@ export async function takePhoto({ renderer, scene, camera, coinLabel, worldLabel
const blob = await new Promise((resolve) => card.toBlob(resolve, 'image/png'));
if (!blob) {
- toast?.('Couldn’t save that photo — try again in a moment.', 'warn');
+ toast?.('Couldn’t save that photo, try again in a moment.', 'warn');
return false;
}
@@ -411,7 +411,7 @@ export async function takePhoto({ renderer, scene, camera, coinLabel, worldLabel
return true;
} catch (err) {
log.warn('[photo-mode] photo failed:', err?.message);
- toast?.('Couldn’t photograph the world just now — try again in a moment.', 'warn');
+ toast?.('Couldn’t photograph the world just now, try again in a moment.', 'warn');
return false;
} finally {
capturing = false;
diff --git a/src/game/plaza-stage.js b/src/game/plaza-stage.js
index e9bb42dea..6b1fc3a96 100644
--- a/src/game/plaza-stage.js
+++ b/src/game/plaza-stage.js
@@ -1,4 +1,4 @@
-// The Plaza Stage — a Living Stage standing in every /play coin world (F17).
+// The Plaza Stage, a Living Stage standing in every /play coin world (F17).
//
// The platform already runs real hosted shows: an embodied AI host performs live
// beats with spatial voice, lip-sync, synced captions, an audience question
@@ -11,7 +11,7 @@
//
// Two halves, split for cost:
// • THIS file is always mounted with the world. It is geometry, a canvas
-// marquee, and one distance check per frame — no sockets, no fetches, no
+// marquee, and one distance check per frame, no sockets, no fetches, no
// audio. A player who never walks over there costs exactly that.
// • src/game/plaza-stage-show.js is the show client (the stage_world room, the
// host avatar, TTS + lip-sync, tips, questions). It is dynamically imported
@@ -55,7 +55,7 @@ export class PlazaStage {
* @param {import('three').Camera} opts.camera the follow camera (spatial audio listener)
* @param {() => ({x:number,y:number,z:number})} opts.getPlayer local avatar pose
* @param {object} opts.coin the world's coin ({ mint, name, symbol })
- * @param {object} opts.ui CommunityUI — toasts + the chat bar
+ * @param {object} opts.ui CommunityUI, toasts + the chat bar
*/
constructor({ scene, camera, getPlayer, coin, ui }) {
this.scene = scene;
@@ -110,7 +110,7 @@ export class PlazaStage {
deck.receiveShadow = true;
g.add(deck);
- // A lit lip around the deck — the edge that reads as "a stage" from across
+ // A lit lip around the deck, the edge that reads as "a stage" from across
// the plaza, and the thing that pulses while the host is speaking.
const lip = new Mesh(
new TorusGeometry(3.45, 0.075, 8, 48),
@@ -320,7 +320,7 @@ export class PlazaStage {
: (this.state.nextShowAt > Date.now() ? 'scheduled' : 'dark');
if (this._show) this._show.setStageDetail(data);
// The player may have reached the venue before this read landed (or before a
- // stage existed at all) — now that there is a real show to join, join it.
+ // stage existed at all), now that there is a real show to join, join it.
else if (this._attending) this._mountShow();
}
@@ -432,7 +432,7 @@ export class PlazaStage {
ctx.fillText(`NEXT SHOW IN ${countdown(s.nextShowAt)}`, 40, 66);
} else {
ctx.fillStyle = COL.dim;
- ctx.fillText('DARK — BETWEEN SHOWS', 40, 66);
+ ctx.fillText('DARK, BETWEEN SHOWS', 40, 66);
}
// Title + host.
@@ -443,7 +443,7 @@ export class PlazaStage {
ctx.font = '400 28px system-ui, -apple-system, Segoe UI, sans-serif';
fitText(ctx, `${s.host}${s.format ? ` · ${s.format}` : ''}`, 40, 174, CW - 380);
- // The last line the host said — the marquee doubles as a caption board for
+ // The last line the host said, the marquee doubles as a caption board for
// anyone standing too far back to hear the spatial audio.
if (s.lastLine) {
ctx.fillStyle = 'rgba(255,255,255,0.05)';
@@ -454,7 +454,7 @@ export class PlazaStage {
wrapText(ctx, `“${s.lastLine}”`, 50, 244, CW - 100, 34, 2);
}
- // Tip leaderboard — the same verified, on-chain board /stage shows.
+ // Tip leaderboard, the same verified, on-chain board /stage shows.
const boardY = s.lastLine ? 330 : 240;
ctx.fillStyle = COL.faint;
ctx.font = '700 22px system-ui, -apple-system, Segoe UI, sans-serif';
@@ -463,7 +463,7 @@ export class PlazaStage {
if (!rows.length) {
ctx.fillStyle = COL.dim;
ctx.font = '400 26px system-ui, -apple-system, Segoe UI, sans-serif';
- ctx.fillText(live ? 'No tips yet — take the top spot' : 'No tips on the last show', 40, boardY + 40);
+ ctx.fillText(live ? 'No tips yet, take the top spot' : 'No tips on the last show', 40, boardY + 40);
} else {
rows.forEach((r, i) => {
const y = boardY + 40 + i * 36;
@@ -495,7 +495,7 @@ export class PlazaStage {
ctx.fillText(`$THREE · ${s.tipCount || 0} tips`, CW - 40, 314);
ctx.textAlign = 'left';
- // Footer hint — what the player can actually do from here.
+ // Footer hint, what the player can actually do from here.
ctx.fillStyle = COL.faint;
ctx.font = '400 24px system-ui, -apple-system, Segoe UI, sans-serif';
ctx.fillText(live ? 'Walk up to take a seat · E opens the show panel' : 'Walk up to check the schedule', 40, CH - 34);
@@ -541,7 +541,7 @@ export class PlazaStage {
// ── canvas helpers ───────────────────────────────────────────────────────────
-// Draw text, shrinking the font until it fits `maxWidth` — a long agent name must
+// Draw text, shrinking the font until it fits `maxWidth`, a long agent name must
// never run off the marquee.
function fitText(ctx, text, x, y, maxWidth) {
const original = ctx.font;
diff --git a/src/game/quests-ui.css b/src/game/quests-ui.css
index 0758efa41..a81d3a764 100644
--- a/src/game/quests-ui.css
+++ b/src/game/quests-ui.css
@@ -1,4 +1,4 @@
-/* Jobs Board UI (W08) — shares the .ec-* shell tokens from economy-ui.css
+/* Jobs Board UI (W08), shares the .ec-* shell tokens from economy-ui.css
* (same overlay/card/tabs/row/status chrome as the general store and bank),
* this file only adds the quest-specific bits: objective checklists, reward
* chips, and the highlight flash when a giver NPC opens straight to their job. */
@@ -72,7 +72,7 @@
}
.qb-lb-prize { margin-top: 12px; font-size: 10px; color: var(--cc-dim); line-height: 1.5; opacity: 0.85; }
-/* Skeleton rows while the first read is in flight — the shape of the answer,
+/* Skeleton rows while the first read is in flight, the shape of the answer,
* so the panel doesn't jump when the real rows land. */
@keyframes qb-lb-shimmer {
0%, 100% { opacity: 0.35; }
diff --git a/src/game/quests-ui.js b/src/game/quests-ui.js
index 9c15a9fe5..3b3f53b4f 100644
--- a/src/game/quests-ui.js
+++ b/src/game/quests-ui.js
@@ -1,12 +1,12 @@
-// Jobs Board UI (W08 hooking W05) — the client the quest engine never had.
+// Jobs Board UI (W08 hooking W05), the client the quest engine never had.
// multiplayer/src/quests.js + quest-zones.js + WalkRoom's questReq/questAccept/
// questAbandon/questInteract handlers were fully built and fully wired
// server-side, but nothing on the client ever called requestQuests() or
-// rendered what came back — "designed and completely unreachable", the same
+// rendered what came back, "designed and completely unreachable", the same
// gap W04's economy pass found and closed for the cash economy. This is that
// same fix for jobs: walk up to any quest-giver NPC (npc/quest-npcs.js) or
-// open it directly, and the real board — real daily rotation, real
-// prereqs/repeat rules, real per-objective progress, real heist crew size —
+// open it directly, and the real board, real daily rotation, real
+// prereqs/repeat rules, real per-objective progress, real heist crew size,
// renders straight from the server's own snapshot. Every button only sends an
// intent; the server's reply re-renders, exactly like the store/bank panel
// this one is styled to match.
@@ -41,7 +41,7 @@ function rewardText(reward) {
return parts.join(' · ');
}
-// "3 runs · 960 cash" — the two numbers the ranking is actually sorted on, in the
+// "3 runs · 960 cash", the two numbers the ranking is actually sorted on, in the
// order it sorts them.
function scoreText(row) {
const runs = row?.runs | 0;
@@ -52,7 +52,7 @@ let _openQuests = null;
/**
* Open the Jobs Board: browse offers, accept/abandon, and track active
- * objectives — all server-authoritative. Idempotent — a second open while one
+ * objectives, all server-authoritative. Idempotent, a second open while one
* is already up just refocuses it (and re-targets `highlight` if given).
* @param {{ ui: object, net: object }} deps
* @param {string} [highlight] a mission id to jump straight to (from the
@@ -77,7 +77,7 @@ class QuestsPanel extends EconPanel {
// The abandon just sent, confirmed by the next snapshot no longer listing it.
this._abandoning = null; // { id, title }
this._highlight = highlight || null;
- // One-shot flag: which id to flash/scroll-to on the NEXT render only —
+ // One-shot flag: which id to flash/scroll-to on the NEXT render only,
// kept separate from _pickForTab's persistent `_highlight` so a later
// snapshot re-render (progress ticking in) doesn't keep re-pulsing it.
this._flashId = highlight || null;
@@ -125,7 +125,7 @@ class QuestsPanel extends EconPanel {
this.eventBoard = b && typeof b === 'object' ? b : { ok: false, reason: 'unavailable' };
this._render();
}));
- // Finishing an event job moves the standings — pull the fresh ranking rather
+ // Finishing an event job moves the standings, pull the fresh ranking rather
// than waiting out the poll, so the panel reacts to the player's own run.
this.track(net.on('eventScore', () => this.net.requestEventBoard()));
@@ -140,7 +140,7 @@ class QuestsPanel extends EconPanel {
super.close();
}
- // Called again if a giver NPC/menu opens the board while it's already up —
+ // Called again if a giver NPC/menu opens the board while it's already up,
// jump to whichever tab actually has that mission and flash it once.
focusMission(id) {
if (!id) return;
@@ -175,8 +175,8 @@ class QuestsPanel extends EconPanel {
_onComplete(c) {
if (!c) return;
const crew = c.coop && c.crew > 1 ? ` (crew of ${c.crew})` : '';
- const tag = c.event ? `${EVENT_GLYPH} Event job — ` : '';
- this.setStatus(`${tag}${c.title} complete${crew} — ${rewardText(c.reward)}`, 'ok');
+ const tag = c.event ? `${EVENT_GLYPH} Event job, ` : '';
+ this.setStatus(`${tag}${c.title} complete${crew}, ${rewardText(c.reward)}`, 'ok');
}
// Is there an event worth surfacing a tab for? Live right now, or finished with a
@@ -214,7 +214,7 @@ class QuestsPanel extends EconPanel {
return;
}
if (!this.board.offers.length) {
- this.body.appendChild(el('div', { class: 'ec-empty', text: 'No jobs on the board right now — dailies rotate at UTC midnight, and repeatable work is always open somewhere in town.' }));
+ this.body.appendChild(el('div', { class: 'ec-empty', text: 'No jobs on the board right now, dailies rotate at UTC midnight, and repeatable work is always open somewhere in town.' }));
return;
}
for (const offer of this.board.offers) {
@@ -246,7 +246,7 @@ class QuestsPanel extends EconPanel {
return;
}
if (!this.board.active.length) {
- this.body.appendChild(el('div', { class: 'ec-empty', text: 'No active jobs — accept one from the Board tab or talk to a quest-giver out in the world.' }));
+ this.body.appendChild(el('div', { class: 'ec-empty', text: 'No active jobs, accept one from the Board tab or talk to a quest-giver out in the world.' }));
return;
}
for (const run of this.board.active) {
@@ -304,13 +304,13 @@ class QuestsPanel extends EconPanel {
class: 'qb-lb-note',
text: ev.live
? `Live now · ${b.players} ${b.players === 1 ? 'runner' : 'runners'} · ${b.totalRuns} event ${b.totalRuns === 1 ? 'job' : 'jobs'} finished`
- : 'Final standings — the event has ended',
+ : 'Final standings, the event has ended',
}),
]));
if (!b.top?.length) {
this.body.appendChild(el('div', { class: 'ec-empty' }, [
- el('div', { text: 'No event runs yet — be the first.' }),
+ el('div', { text: 'No event runs yet, be the first.' }),
el('div', {
class: 'qb-lb-note',
text: 'Take an EVENT job from the Board tab and finish it. Every completed event job is one run.',
@@ -335,7 +335,7 @@ class QuestsPanel extends EconPanel {
]));
} else {
this.body.appendChild(el('div', { class: 'qb-lb-you-wrap' }, [
- el('div', { class: 'qb-lb-note', text: 'You have not finished an event job yet — one run puts you on this board.' }),
+ el('div', { class: 'qb-lb-note', text: 'You have not finished an event job yet, one run puts you on this board.' }),
]));
}
this._renderPrizeNote();
@@ -362,7 +362,7 @@ class QuestsPanel extends EconPanel {
el('div', {
class: 'qb-lb-note',
text: reason === 'unavailable'
- ? 'Your own progress is safe — every finished job was already paid and recorded. Only this view is offline.'
+ ? 'Your own progress is safe, every finished job was already paid and recorded. Only this view is offline.'
: 'Try again in a moment.',
}),
el('button', {
diff --git a/src/game/spin-wheel-ui.js b/src/game/spin-wheel-ui.js
index 461845f0f..7fd08068e 100644
--- a/src/game/spin-wheel-ui.js
+++ b/src/game/spin-wheel-ui.js
@@ -1,14 +1,14 @@
-// Wheel of Fortune — the in-world spinner UI for /play (Task 19/W09).
+// Wheel of Fortune, the in-world spinner UI for /play (Task 19/W09).
//
// Opened when the player reaches Fortune's Folly, the Mainland casino wheel
// (multiplayer/src/wheel-station.js renders the landmark + prompt; this module
// is lazy-imported on first interaction). The SERVER owns every outcome: this
// module renders the 20-segment wheel, requests a spin, and animates the wheel
-// to land on exactly the segment the server rolled — it never decides a prize.
+// to land on exactly the segment the server rolled, it never decides a prize.
// Two ways to spin:
-// • Free — one per account every 12h, with a live countdown.
-// • Paid — $3 in $THREE, split 50% to the holder-rewards pool / 50% to the
-// treasury (see multiplayer/src/game-token.js — the platform never burns
+// • Free, one per account every 12h, with a live countdown.
+// • Paid, $3 in $THREE, split 50% to the holder-rewards pool / 50% to the
+// treasury (see multiplayer/src/game-token.js, the platform never burns
// supply; the share that historically went to the incinerator now
// reflects back to holders instead). The server builds the split
// transaction, the player's wallet signs + broadcasts it, and the server
@@ -57,7 +57,7 @@ function el(tag, props = {}, kids = []) {
const kindOf = (seg) => (seg.kind === 'gold' ? 'gold' : seg.item || 'stone');
/**
- * Open the Wheel of Fortune. Idempotent — a second call focuses the existing
+ * Open the Wheel of Fortune. Idempotent, a second call focuses the existing
* modal. Returns a controller with `.close()`.
* @param {{ net: object, onClose?: () => void }} opts
*/
@@ -101,7 +101,7 @@ class SpinWheel {
}, 12_000);
}
- // Loading never resolved — show an actionable error with a retry that re-asks
+ // Loading never resolved, show an actionable error with a retry that re-asks
// the server, instead of an indefinite spinner.
_loadFailed() {
this.phase = 'error';
@@ -212,7 +212,7 @@ class SpinWheel {
// The payment is confirmed on our end but the server's RPC node hasn't
// indexed it yet. Retry; the signature is already reserved so no double-roll
// is possible regardless of how many times this fires.
- this._status(`Payment confirmed — waiting for server to see it… (attempt ${this._settleAttempts}/5)`, '');
+ this._status(`Payment confirmed, waiting for server to see it… (attempt ${this._settleAttempts}/5)`, '');
setTimeout(() => { if (!this._closed && this.phase === 'spinning') this._settle(); }, 2500);
return;
}
@@ -289,14 +289,14 @@ class SpinWheel {
case 'cooldown': return 'Your free spin isn’t ready yet.';
case 'token_unavailable': return 'Paid spins are unavailable right now.';
case 'no_wallet': return 'Connect a Solana wallet to buy a spin.';
- case 'price_unavailable': return 'Live token price unavailable — try again in a moment.';
+ case 'price_unavailable': return 'Live token price unavailable, try again in a moment.';
case 'service_unavailable':
case 'treasury_unavailable':
- case 'rewards_unavailable': return 'Paid spins are briefly unavailable — try again in a moment.';
+ case 'rewards_unavailable': return 'Paid spins are briefly unavailable, try again in a moment.';
case 'build_failed': return 'Could not prepare the payment. Try again.';
case 'no_signature': return 'No transaction signature received.';
case 'already_settled': return 'That payment was already used for a spin.';
- case 'not_found': return 'Payment not confirmed on-chain yet — give it a moment and try again.';
+ case 'not_found': return 'Payment not confirmed on-chain yet, give it a moment and try again.';
case 'underpaid': return 'The payment amount didn’t match the quote. No spin was taken.';
case 'quote_expired': return 'Your quote expired before the payment confirmed. Try again.';
default: return 'The spin couldn’t be completed.';
@@ -308,7 +308,7 @@ class SpinWheel {
if (this.busy || !this._levelOk()) return;
const now = this.info?.now ?? Date.now();
const next = this.info?.nextFreeSpinAt ?? 0;
- if (now < next) return; // not ready — button is disabled, but guard anyway
+ if (now < next) return; // not ready, button is disabled, but guard anyway
this.busy = true;
this.phase = 'spinning';
this.resultLine.textContent = '';
@@ -329,7 +329,7 @@ class SpinWheel {
this.resultLine.textContent = '';
this._status('Connecting your wallet…', '');
this._sync();
- // Same connect + address-extraction step boutique-purchase.js uses — the
+ // Same connect + address-extraction step boutique-purchase.js uses, the
// server prices the quote for a specific buyer, so it needs the address
// before it can build anything.
let address = wallet.publicKey?.toString?.();
@@ -365,7 +365,7 @@ class SpinWheel {
this._paymentLive = true;
const url = solanaTxExplorerUrl(NETWORK, sig);
- this._statusNode(el('span', {}, ['Confirming payment — ', el('a', { href: url, target: '_blank', rel: 'noopener', text: 'view ↗' }), '…']), 'ok');
+ this._statusNode(el('span', {}, ['Confirming payment, ', el('a', { href: url, target: '_blank', rel: 'noopener', text: 'view ↗' }), '…']), 'ok');
await this._confirm(conn, sig);
// Hand the signature to the server: it verifies the burn + treasury legs
@@ -383,7 +383,7 @@ class SpinWheel {
this.net.spinPaidSettle(this._prep.quote, this._sig);
}
- // Poll signature status over HTTP (no WS — the public RPC refuses subscriptions).
+ // Poll signature status over HTTP (no WS, the public RPC refuses subscriptions).
async _confirm(conn, sig, timeoutMs = 35_000) {
const start = Date.now();
while (Date.now() - start < timeoutMs) {
@@ -397,7 +397,7 @@ class SpinWheel {
}
await new Promise((r) => setTimeout(r, 1500));
}
- // Timed out waiting — let the server try anyway; it may already see it.
+ // Timed out waiting, let the server try anyway; it may already see it.
}
_payError(err) {
@@ -625,14 +625,14 @@ class SpinWheel {
// The gate level is always the server's own MIN_AVG_LEVEL, carried on spinInfo.
// The banner only renders once info has landed, so it never has to guess.
const min = this.info?.minLevel;
- // Level gate banner — the designed "not eligible" state with a how-to.
+ // Level gate banner, the designed "not eligible" state with a how-to.
if (this.info && !lvlOk) {
this.gate.hidden = false;
this.gate.replaceChildren(
el('div', { class: 'kg-spin-gate-h', text: 'Locked' }),
el('div', { class: 'kg-spin-gate-b' }, [
`Spinning needs an average skill level of ${min}. You're at ${this.info.avgLevel ?? 0}. `,
- 'Chop, mine, fish, cook and fight to raise your skills — the wheel unlocks at level ' + min + '.',
+ 'Chop, mine, fish, cook and fight to raise your skills, the wheel unlocks at level ' + min + '.',
]),
);
} else {
diff --git a/src/game/spin-wheel.css b/src/game/spin-wheel.css
index 64fe1d173..f3f7cd771 100644
--- a/src/game/spin-wheel.css
+++ b/src/game/spin-wheel.css
@@ -1,4 +1,4 @@
-/* Wheel of Fortune — styles for the openSpinWheel modal in spin-wheel-ui.js.
+/* Wheel of Fortune, styles for the openSpinWheel modal in spin-wheel-ui.js.
Imported by that module so the modal carries its own styles wherever it is
opened (it ships as its own lazy chunk, so it cannot rely on
coincommunities.css having loaded first).
diff --git a/src/game/static-batch.js b/src/game/static-batch.js
index 1ced65403..6526b2f8c 100644
--- a/src/game/static-batch.js
+++ b/src/game/static-batch.js
@@ -18,7 +18,7 @@
// batch.flush(root); // one InstancedMesh per bucket
//
// Anything that has to animate individually (the tumbleweeds, the market ring)
-// must NOT go through here — add it to the scene the ordinary way.
+// must NOT go through here, add it to the scene the ordinary way.
import { InstancedMesh, Matrix4, StaticDrawUsage } from 'three';
diff --git a/src/game/vehicles.js b/src/game/vehicles.js
index 2e9043b7c..e40dd4acb 100644
--- a/src/game/vehicles.js
+++ b/src/game/vehicles.js
@@ -1,4 +1,4 @@
-// VehicleManager — drivable, networked vehicles for /play.
+// VehicleManager, drivable, networked vehicles for /play.
//
// Networking follows the same authoritative-relay pattern the movement netcode
// already uses (and the model Notblox uses for its Rapier cars): the DRIVER
@@ -7,13 +7,13 @@
// and relays it, staying the gate on who may drive what. Everyone else is a pure
// spectator of the replicated transform, interpolated smoothly.
//
-// Only the vehicle the local player is driving is ever simulated here — it shares
+// Only the vehicle the local player is driving is ever simulated here, it shares
// the SAME Rapier world CoinCommunities already boots for the character
// controller (W01's `this._physics`: ground + district building colliders), so a
// driven car collides with the town exactly like a walking avatar does, and
// (as kinematic ghosts) the other players' cars so the local car can bump them.
// The world is stepped exactly once per frame, centrally, in CoinCommunities'
-// _loop — this module never calls physics.step() itself; tick() feeds driver
+// _loop, this module never calls physics.step() itself; tick() feeds driver
// input BEFORE that step, postStep() reads the resulting transform AFTER it.
// Parked and remote-driven vehicles are interpolated meshes, cheap and
// ghost-light.
@@ -21,7 +21,7 @@
// This subsystem is intentionally tightly coupled to the scene (camera handoff,
// avatar seating, shared input, the shared physics world), so it takes the
// CoinCommunities `host` and reads its live fields (localPos, localYaw, localRig,
-// keys, camera, _physics) — exactly the coupling PlaySystems and AgentCommerce
+// keys, camera, _physics), exactly the coupling PlaySystems and AgentCommerce
// already have.
import { Vector3, Quaternion, Raycaster, Vector2 } from 'three';
@@ -72,14 +72,14 @@ export class VehicleManager {
this._prevCamDist = host.camDist;
// Reuse CoinCommunities' own Rapier world (ground + district colliders +
- // character controller) instead of standing up a second one — the driven
+ // character controller) instead of standing up a second one, the driven
// car then collides with the same town the avatar does. host.enter() only
// constructs VehicleManager after its physics boot has already resolved, so
// this is synchronous; a WASM failure (no WebGL/WASM) leaves `phys` null,
// which disables driving gracefully (toast on interact) without breaking
// the rest of the scene.
this.phys = host._physicsOk ? host._physics : null;
- if (!this.phys) log.warn('[vehicles] no shared physics world — driving disabled this session.');
+ if (!this.phys) log.warn('[vehicles] no shared physics world, driving disabled this session.');
this._injectStyles();
this._buildPrompt();
@@ -104,7 +104,7 @@ export class VehicleManager {
changeVehicle(state, id) {
const entry = this.vehicles.get(id);
if (!entry) { this.addVehicle(state, id); return; }
- entry.state = state; // live schema proxy — read latest each frame
+ entry.state = state; // live schema proxy, read latest each frame
// The server kicked us out of the seat (disconnect sweep, eviction): bail out
// of the driving state cleanly so we don't keep streaming a car we don't own.
if (entry.id === this._drivingId && state.driver !== this.net?.sessionId) {
@@ -149,8 +149,8 @@ export class VehicleManager {
// Called BEFORE CoinCommunities steps the shared physics world this frame:
// interpolates every vehicle we're not actively simulating (and re-queues
- // their kinematic ghost transforms, which — like the character controller's
- // queued move — must be set before world.step() consumes them), and, while
+ // their kinematic ghost transforms, which, like the character controller's
+ // queued move, must be set before world.step() consumes them), and, while
// driving, feeds this frame's input into the Rapier vehicle controller so its
// forces are ready for that same step. Reading the result back happens in
// postStep(), after the world has actually advanced.
@@ -221,7 +221,7 @@ export class VehicleManager {
// ---------------------------------------------------------------- driving sim
// Pre-step: feed this frame's driver intent to the Rapier vehicle controller.
- // Nothing here reads back a transform — the shared world hasn't advanced yet.
+ // Nothing here reads back a transform, the shared world hasn't advanced yet.
_driveInput(dt) {
if (!this.vehicle || !this.phys) return;
const keys = this.host.keys;
@@ -239,7 +239,7 @@ export class VehicleManager {
}
// Post-step: the shared world just advanced (CoinCommunities._loop calls this
- // right after physics.step()) — read the now-authoritative transform and apply
+ // right after physics.step()), read the now-authoritative transform and apply
// everything downstream of it: mesh, camera, seat, HUD, netcode.
_driveApply(dt) {
const entry = this.vehicles.get(this._drivingId);
@@ -247,7 +247,7 @@ export class VehicleManager {
const braking = this._lastBraking;
let t = this.vehicle.transform();
- // World bounds — clamp the car inside the square district (the server clamps
+ // World bounds, clamp the car inside the square district (the server clamps
// per-axis too). Only correct when actually past an edge, to avoid jitter.
if (Math.abs(t.x) > VEHICLE_WORLD_BOUND_M || Math.abs(t.z) > VEHICLE_WORLD_BOUND_M) {
const cx = Math.max(-VEHICLE_WORLD_BOUND_M, Math.min(VEHICLE_WORLD_BOUND_M, t.x));
@@ -326,7 +326,7 @@ export class VehicleManager {
{ qx: 0, qy: Math.sin(half), qz: 0, qw: Math.cos(half) },
);
this._flipSince = 0;
- this.ui?.toast?.('Vehicle flipped — set you back upright.', 'info');
+ this.ui?.toast?.('Vehicle flipped, set you back upright.', 'info');
}
// ---------------------------------------------------------------- enter/exit
@@ -419,7 +419,7 @@ export class VehicleManager {
spec: entry.spec,
});
this.vehicle.teleport({ x: s.x, y: s.y + 0.1, z: s.z }, { qx: s.qx, qy: s.qy, qz: s.qz, qw: s.qw });
- // The driven car is the dynamic body now — drop its kinematic ghost so the two
+ // The driven car is the dynamic body now, drop its kinematic ghost so the two
// don't fight.
entry.collider?.remove();
entry.collider = null;
@@ -429,7 +429,7 @@ export class VehicleManager {
this._prevCamDist = this.host.camDist;
this.host.camDist = Math.max(this.host.camDist, 11);
this._showControls(true);
- this.ui?.toast?.(`Driving the ${entry.spec.label} — ${this._isTouch() ? 'use the on-screen pedals' : 'WASD to drive, Space to handbrake'}, ${this._isTouch() ? 'tap Exit' : 'F'} to get out.`, 'info');
+ this.ui?.toast?.(`Driving the ${entry.spec.label}, ${this._isTouch() ? 'use the on-screen pedals' : 'WASD to drive, Space to handbrake'}, ${this._isTouch() ? 'tap Exit' : 'F'} to get out.`, 'info');
}
requestExit() {
@@ -471,7 +471,7 @@ export class VehicleManager {
this.host.localRig.rotation.set(0, this.host.localYaw, 0);
}
// The shared character controller's kinematic body was left wherever the
- // player stood before entering — resync it to the drop point (the same
+ // player stood before entering, resync it to the drop point (the same
// flag CoinCommunities sets on a fresh coin spawn) so the next _stepLocal
// re-seeds it there instead of resolving a stale move from the old spot.
this.host._physicsActivePrev = false;
@@ -515,7 +515,7 @@ export class VehicleManager {
// Driving HUD: a speedometer plus an exit button always, and an on-screen pedal
// + steering cluster on touch devices. Pointer events (not click) so holding a
- // pedal accelerates and releasing lets off — works for touch and mouse alike.
+ // pedal accelerates and releasing lets off, works for touch and mouse alike.
_buildControls() {
const wrap = document.createElement('div');
wrap.className = 'veh-hud';
@@ -560,7 +560,7 @@ export class VehicleManager {
this._hud?.classList.toggle('veh-touch', on && this._isTouch());
if (!on) this._touch = { throttle: 0, brake: 0, steer: 0, handbrake: false };
// The on-foot movement joystick (#cc-joystick) sits in the same bottom-left
- // corner as the steering pad and renders above it (z-index 30 vs our 22) —
+ // corner as the steering pad and renders above it (z-index 30 vs our 22),
// hide it while driving so it doesn't block the wheel.
document.getElementById('cc-joystick')?.classList.toggle('veh-hide-joy', on);
}
@@ -623,7 +623,7 @@ export class VehicleManager {
}
dispose() {
- // Not serverForced: this is our own teardown, not an eviction — no toast.
+ // Not serverForced: this is our own teardown, not an eviction, no toast.
if (this._drivingId) this._endDriving(this.vehicle ? this.vehicle.transform() : null, false);
clearTimeout(this._pendingTimer);
for (const [, entry] of this.vehicles) {
@@ -635,7 +635,7 @@ export class VehicleManager {
this.prompt?.remove();
this._hud?.remove();
document.getElementById('veh-styles')?.remove();
- // `phys` is CoinCommunities' own shared world — owned and disposed by the
+ // `phys` is CoinCommunities' own shared world, owned and disposed by the
// host, not us. Just drop our reference.
this.phys = null;
}
diff --git a/src/game/world-env.js b/src/game/world-env.js
index 01ae5f2f2..91553a1da 100644
--- a/src/game/world-env.js
+++ b/src/game/world-env.js
@@ -1,14 +1,14 @@
-// World environment — a distinct, living biome for every coin community.
+// World environment, a distinct, living biome for every coin community.
//
// The lobby/landing stays monochrome by design, but the moment a player drops
// into a world it should feel alive AND feel like *this* community's place.
// Two coins should never share a skin. We hash the coin's mint into a stable
// seed, pick one of several biome archetypes from it (meadow, desert, tundra,
// volcanic, alien, tropical), then jitter that biome's palette and scatter its
-// vegetation from the same seed — so a given coin always renders the same world,
+// vegetation from the same seed, so a given coin always renders the same world,
// and a thousand coins render a thousand recognisably different ones.
//
-// Colour does the heavy lifting here — the monochrome restraint is the lobby's
+// Colour does the heavy lifting here, the monochrome restraint is the lobby's
// job, not the world's. Everything decorative sits OUTSIDE the playRadius circle
// so it frames the space without ever blocking a player. Geometry is low-poly
// and shared/cloned, so the whole environment is cheap enough to run alongside
@@ -106,7 +106,7 @@ const BIOMES = [
flora: 'palm', density: 30,
},
{
- // Old-west frontier town — a dusty main square ringed by false-front
+ // Old-west frontier town, a dusty main square ringed by false-front
// storefronts under a low golden-hour sun that throws the long shadows of
// every porch post and water tower across the packed-dirt plaza. `town`
// flags the storefront/prop builder below; sagebrush + the odd saguaro
@@ -121,7 +121,7 @@ const BIOMES = [
},
];
-// Curated biomes reachable ONLY by explicit id (biomeById) — never by the seed
+// Curated biomes reachable ONLY by explicit id (biomeById), never by the seed
// modulo, so adding one here can't shift which biome an existing coin's mint maps
// to. `noir` is a neutral, near-monochrome dark world tuned to match an embedding
// host's dark UI: its sky and ground sit on the same #1c2530→#0c1116 ramp the
@@ -138,7 +138,7 @@ const CURATED_BIOMES = [
flora: 'conifer', density: 12,
},
{
- // Robinhood Chain worlds. A trading-floor-at-night mood — deep emerald
+ // Robinhood Chain worlds. A trading-floor-at-night mood, deep emerald
// dark fading to near-black, gold ticker-tape accents on the ring and
// glass "crystal" flora standing in for a financial district skyline. No
// wordmark, logo, or literal brand hex; the palette nods at "stocks +
@@ -169,7 +169,7 @@ export function biomeById(id) {
}
// A vertical gradient backdrop, rendered as the scene background so it's immune
-// to fog and never rotates with the orbit camera — a clean graded sky per biome.
+// to fog and never rotates with the orbit camera, a clean graded sky per biome.
function gradientSky(top, mid, horizon) {
const c = document.createElement('canvas');
c.width = 4; c.height = 256;
@@ -379,7 +379,7 @@ function makeStorefront(geo, mats, rand, label) {
return g;
}
-// A timber water tower: a banded tank on four braced legs under a conic cap —
+// A timber water tower: a banded tank on four braced legs under a conic cap,
// the tallest thing on the skyline and the town's signature silhouette.
function makeWaterTower(geo, mats) {
const g = new Group();
@@ -401,7 +401,7 @@ function makeWaterTower(geo, mats) {
return g;
}
-// Scatter props: barrels, crates, wagon wheels, hitching rails, water troughs —
+// Scatter props: barrels, crates, wagon wheels, hitching rails, water troughs,
// the small clutter that turns an empty lot into a lived-in town.
function makeProp(kind, geo, mats, rand) {
const g = new Group();
@@ -518,7 +518,7 @@ function buildFrontierTown(root, rand, playRadius, batch) {
batch.add(prop);
}
- // A couple of tumbleweeds drifting the mesa band beyond the town — pure life.
+ // A couple of tumbleweeds drifting the mesa band beyond the town, pure life.
// Returned to the caller so they roll on the same animator clock as the world.
const tumbleMat = new MeshStandardMaterial({ color: 0x8a6e44, roughness: 1, metalness: 0, flatShading: true, wireframe: true });
const tumbleGeo = new IcosahedronGeometry(0.9, 1);
@@ -602,7 +602,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
plaza.rotation.x = -Math.PI / 2; plaza.position.y = 0.01; plaza.receiveShadow = true;
root.add(plaza);
- // Faint paving grid over the plaza — a sense of scale that the haze fades.
+ // Faint paving grid over the plaza, a sense of scale that the haze fades.
const grid = new GridHelper(playRadius * 2, 30, biome.grid, biome.grid);
grid.position.y = 0.02;
grid.material.transparent = true;
@@ -610,7 +610,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
grid.material.depthWrite = false;
root.add(grid);
- // Glowing boundary hairline — the bright accent ring around the plaza, the
+ // Glowing boundary hairline, the bright accent ring around the plaza, the
// most per-coin-distinct colour in the scene.
const ring = new Mesh(new RingGeometry(playRadius - 0.12, playRadius + 0.12, 128),
new MeshBasicMaterial({ color: cRing, transparent: true, opacity: 0.55, side: DoubleSide }));
@@ -678,7 +678,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
plant.rotation.y = rand() * Math.PI * 2;
batch.add(plant);
}
- // Alien crystals breathe with a faint emissive shimmer — biome-specific life.
+ // Alien crystals breathe with a faint emissive shimmer, biome-specific life.
// The pulse is written on the shared leaf materials, so every batched shard
// picks it up without the animator touching a single mesh.
if (neon && biome.density > 0) {
@@ -717,7 +717,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
// --- Live-market reactivity --------------------------------------------
// The boundary ring is the world's heartbeat: a slow breathing pulse is the
// baseline, but a trade can kick it to a colour (green on a buy, red on a
- // sell) that decays back to the per-coin accent — so the arena visibly
+ // sell) that decays back to the per-coin accent, so the arena visibly
// flinches with the on-chain tape. The market-reactor drives flashRing().
const baseRing = cRing.clone();
const flashColor = new Color();
@@ -734,7 +734,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
// strobe. Baselines are captured so every community settles back to its own.
// Daytime baselines the market mood multiplies. The day/night cycle drives
// these through setBaseSun/setBaseFog so the time of day sets the base and the
- // trade tape's mood still flexes it on top — the two compose instead of fighting.
+ // trade tape's mood still flexes it on top, the two compose instead of fighting.
const base = { sun: biome.sun.intensity, fogNear: biome.fogNear, fogFar: biome.fogFar };
let mood = 0, moodTarget = 0; // -1 storm … +1 euphoric
animators.push((t, dt) => {
@@ -783,7 +783,7 @@ export function createWorldEnvironment(scene, renderer, playRadius = 58, opts =
// geometry/material sweep below.
disposeInstanced(root);
// The sun is a DirectionalLight, not a Mesh, so the traverse below skips
- // it — and its 2048x2048 shadow depth target is one of the largest GPU
+ // it, and its 2048x2048 shadow depth target is one of the largest GPU
// allocations in the world. Free it explicitly, or every coin-world switch
// strands another full-size shadow map in VRAM.
sunLight.shadow?.map?.dispose?.();
diff --git a/src/shared/avatar-inspector.js b/src/shared/avatar-inspector.js
index 7ce5fefed..d34f50a1f 100644
--- a/src/shared/avatar-inspector.js
+++ b/src/shared/avatar-inspector.js
@@ -1,17 +1,17 @@
/**
- * Avatar Inspector — one panel, every world.
+ * Avatar Inspector, one panel, every world.
*
- * Press I (or select an avatar) in any three.ws world — /play, /city, a coin
- * world, the walk playground — and this side panel opens on whoever you're
+ * Press I (or select an avatar) in any three.ws world, /play, /city, a coin
+ * world, the walk playground, and this side panel opens on whoever you're
* looking at: who they are, the reputation they've earned, the wallet they
* carry, and every public fact the platform knows about them. It is the
* world-side twin of the Agora passport: non-modal, keyboard-first, honest.
*
- * Everything shown is real, server-authoritative data — the same public
+ * Everything shown is real, server-authoritative data, the same public
* endpoints every other surface reads, so a number never disagrees across
* the platform:
* - GET /api/agents/:id → identity (name, bio, skills, links)
- * - GET /api/agents/:id/reputation → 0–100 trust score + pillars
+ * - GET /api/agents/:id/reputation → 0, 100 trust score + pillars
* (rendered by the shared reputationPanelEl, the exact breakdown the
* wallet hub shows)
* - GET /api/agents/:id/solana/networth → wallet address, USD/SOL/$THREE
@@ -19,10 +19,10 @@
* - POST /api/wallet/balances → balances for a bare verified
* wallet when the avatar isn't piloting a registered agent
*
- * A guest with no wallet renders as exactly that — a designed empty state
- * that says what's missing and how to get it — never a fabricated number.
+ * A guest with no wallet renders as exactly that, a designed empty state
+ * that says what's missing and how to get it, never a fabricated number.
*
- * Usage (each world supplies its own picking — raycast, nameplate click, or
+ * Usage (each world supplies its own picking, raycast, nameplate click, or
* the I key on the nearest avatar):
* import { openAvatarInspector } from '../shared/avatar-inspector.js';
* openAvatarInspector({
@@ -101,10 +101,10 @@ export function closeAvatarInspector() {
* @param {string} [subject.world] world chip ('play', 'city', …)
* @param {string} [subject.agentId] three.ws agent UUID this avatar pilots
* @param {string} [subject.wallet] verified Solana address (used when no agentId)
- * @param {string} [subject.avatarUrl] GLB url — shown as an "Avatar model" fact row
+ * @param {string} [subject.avatarUrl] GLB url, shown as an "Avatar model" fact row
* @param {string} [subject.bio] caller-supplied bio paragraph (used when the
* subject has no registered agent to load one from)
- * @param {string} [subject.username] verified three.ws username (W10) — only pass a
+ * @param {string} [subject.username] verified three.ws username (W10), only pass a
* value the server verified (e.g. off the signed
* presence ticket via the player schema); it
* unlocks the real profile section: follow,
@@ -143,7 +143,7 @@ export function openAvatarInspector(subject = {}, opts = {}) {
const root = document.createElement('aside');
root.className = 'avi-root';
root.setAttribute('role', 'dialog');
- root.setAttribute('aria-label', `Avatar inspector — ${name}`);
+ root.setAttribute('aria-label', `Avatar inspector, ${name}`);
root.innerHTML = `
<header class="avi-head">
<div class="avi-monogram" aria-hidden="true">${esc(name.replace(/^@/, '').slice(0, 2).toUpperCase())}</div>
@@ -208,7 +208,7 @@ export function openAvatarInspector(subject = {}, opts = {}) {
if (username) {
// Verified platform identity: surface the @handle under the display name
- // immediately — the profile section fills in the rest as it loads.
+ // immediately, the profile section fills in the rest as it loads.
const nameEl = root.querySelector('.avi-name');
nameEl?.insertAdjacentHTML('afterend', `<div class="avi-subname">@${esc(username)}</div>`);
renderProfile(root, { username, kind, onOpenDM: opts.onOpenDM });
@@ -257,7 +257,7 @@ function errorState(message, retry) {
// Only rendered for a username the SERVER verified (signed presence ticket →
// player schema), never a client-claimed handle. Reads the same endpoints the
// /u/:username page reads, and acts through the same follow + friends APIs the
-// profile page and friends drawer use — so a follow made here is the same edge
+// profile page and friends drawer use, so a follow made here is the same edge
// everywhere on the platform.
async function renderProfile(root, { username, kind, onOpenDM }) {
const body = sectionBody(root, 'profile');
@@ -481,7 +481,7 @@ async function renderAbout(root, subject, { agentId }) {
// to load one from (a gallery citizen's description, a world lore line).
// The agent path below overwrites this with the live profile once loaded.
const bioHtml = subject.bio ? `<p class="avi-bio">${esc(subject.bio)}</p>` : '';
- // The GLB this avatar is wearing — a real, linkable fact of the encounter.
+ // The GLB this avatar is wearing, a real, linkable fact of the encounter.
const avatarUrl = String(subject.avatarUrl || '');
if (/^(https?:\/\/|\/)[^\s]+\.(glb|gltf|vrm)(\?|$)/i.test(avatarUrl)) {
const file = avatarUrl.split('?')[0].split('/').pop();
@@ -601,7 +601,7 @@ async function renderWallet(root, { agentId, wallet, kind }) {
`<div class="avi-holding"><span>${esc(t.symbol || shortAddress(t.mint))}</span><span>${esc(fmtAmount(t.amount))}${t.usd ? ` · ${esc(formatWalletUsd(t.usd))}` : ''}</span></div>`,
)
.join('')}</div>`
- : `<p class="avi-note">No token holdings yet — a real $0 wallet shows $0.</p>`) +
+ : `<p class="avi-note">No token holdings yet, a real $0 wallet shows $0.</p>`) +
(data.reputation?.tips?.count
? `<div class="avi-fact"><span class="avi-fact-l">Tips received</span><span class="avi-fact-v">${esc(data.reputation.tips.count)} (${esc(formatWalletUsd(data.reputation.tips.usd))})</span></div>`
: '');
@@ -638,7 +638,7 @@ async function renderWallet(root, { agentId, wallet, kind }) {
.map((t) => `<div class="avi-holding"><span>${esc(t.symbol || '?')}</span><span>${esc(fmtAmount(t.amount))}${t.usd ? ` · ${esc(formatWalletUsd(t.usd))}` : ''}</span></div>`)
.join('')}</div>`
: '') +
- `<p class="avi-note">Verified account wallet — this player signed in with it, but isn’t piloting a registered agent.</p>`;
+ `<p class="avi-note">Verified account wallet, this player signed in with it, but isn’t piloting a registered agent.</p>`;
wireCopy();
} catch (err) {
if (!document.contains(body)) return;
@@ -655,8 +655,8 @@ async function renderWallet(root, { agentId, wallet, kind }) {
kind === 'npc'
? 'Townspeople sell real paid services at their counters, but don’t carry a public wallet of their own.'
: kind === 'self'
- ? 'Sign in with your wallet — or pilot one of your agents — and your balances and reputation appear here.'
- : 'This player is exploring as a guest — no verified wallet, no agent.',
+ ? 'Sign in with your wallet, or pilot one of your agents, and your balances and reputation appear here.'
+ : 'This player is exploring as a guest, no verified wallet, no agent.',
kind === 'self' ? [{ label: 'Get an agent wallet', href: '/agent-wallet' }] : [],
);
};
@@ -675,7 +675,7 @@ function renderReputation(root, { agentId, kind }) {
body.innerHTML = emptyState(
'No trust score',
kind === 'npc'
- ? 'Townspeople are part of the world itself — reputation applies to player-owned agents.'
+ ? 'Townspeople are part of the world itself, reputation applies to player-owned agents.'
: 'Reputation is earned by registered agents through real settled activity. This avatar isn’t piloting one.',
kind === 'npc' ? [] : [{ label: 'How trust is earned', href: '/reputation' }],
);
diff --git a/src/shared/brand-mark.js b/src/shared/brand-mark.js
index 836a16d36..6a00d5fc3 100644
--- a/src/shared/brand-mark.js
+++ b/src/shared/brand-mark.js
@@ -4,8 +4,8 @@
// needed it, which is how a logo ends up subtly different on three pages. It
// lives here now as raw path data plus two renderers:
//
-// threeMarkSvg() — an inline <svg> string for DOM chrome (nav, HUD, footers)
-// threeMarkPath2D() — a Path2D for <canvas> compositing (share cards, exports)
+// threeMarkSvg(), an inline <svg> string for DOM chrome (nav, HUD, footers)
+// threeMarkPath2D(), a Path2D for <canvas> compositing (share cards, exports)
//
// Both draw the SAME path in the SAME 32x32 viewBox, so a mark stamped onto a
// downloaded PNG is pixel-for-pixel the mark in the page header.
diff --git a/src/shared/stage-voice.js b/src/shared/stage-voice.js
index 08f815afa..995f17616 100644
--- a/src/shared/stage-voice.js
+++ b/src/shared/stage-voice.js
@@ -1,8 +1,8 @@
-// Living Stages — the host's voice, shared by every surface that renders a show.
+// Living Stages, the host's voice, shared by every surface that renders a show.
//
// A StageRoom beat arrives as a timed `utterance` broadcast: { id, text, voice,
// cue, durationMs }. Turning that into a performance is the same job everywhere
-// it happens — fetch /api/tts/speak for the words, route the audio through the
+// it happens, fetch /api/tts/speak for the words, route the audio through the
// host avatar's PositionalAudio (so it gets louder as you walk toward the stage),
// tap an AnalyserNode off it to drive lip-sync on whatever the rig supports, and
// stop cleanly when the next beat pre-empts this one.
@@ -159,7 +159,7 @@ export class StageVoice {
/**
* Maps lip-sync {open,wide,round} onto whatever the GLB rig supports: morph
* targets (visemes / mouthOpen / jawOpen) when present, else a jaw bone, else a
- * subtle head scale — so lip-sync is real where the rig allows and degrades
+ * subtle head scale, so lip-sync is real where the rig allows and degrades
* gracefully where it doesn't (no T-pose, never a hard failure).
*/
export class MouthTarget {
diff --git a/src/walk.js b/src/walk.js
index 9ffadc3cb..53b084e8d 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -1,4 +1,4 @@
-// /walk — a third-person walkaround for three.ws
+// /walk, a third-person walkaround for three.ws
//
// Loads the default avatar, attaches the project's AnimationManager so the
// skinned mesh can crossfade between idle / walking / running clips, and
@@ -97,8 +97,8 @@ const GALLERY_MODE = new URLSearchParams(location.search).get('gallery') === 'ma
const AVATAR_URL_DEFAULT = '/avatars/default.glb';
// The GLB URL the local avatar actually loaded from. Captured by resolveAvatarUrl
-// so we can (a) broadcast it to the room — other clients render us as our real
-// avatar — and (b) short-circuit remote avatar loads that match ours.
+// so we can (a) broadcast it to the room, other clients render us as our real
+// avatar, and (b) short-circuit remote avatar loads that match ours.
let resolvedAvatarUrl = AVATAR_URL_DEFAULT;
// The resolved avatar record (id, name, description, agent_id) from
@@ -110,14 +110,14 @@ let avatarMeta = null;
// (?avatar=<draftId>&preview=true), the unsaved appearance to apply on top of
// the base GLB once it loads. Stashed by resolveAvatarUrl, consumed in loadAvatar.
let pendingDraftAppearance = null;
-// True for a draft preview — run solo (no multiplayer broadcast of a throwaway
+// True for a draft preview, run solo (no multiplayer broadcast of a throwaway
// presigned URL) and skip the player's own equipped cosmetics so the creator
// sees exactly the look they're editing.
let isDraftPreview = false;
async function resolveAvatarUrl() {
const params = new URLSearchParams(location.search);
- // A direct GLB/VRM URL wins — this is what the /communities lobby passes when
+ // A direct GLB/VRM URL wins, this is what the /communities lobby passes when
// a guest drops in with a pasted model or a Ready Player Me link.
const direct = params.get('avatarUrl');
if (direct) {
@@ -129,7 +129,7 @@ async function resolveAvatarUrl() {
resolvedAvatarUrl = AVATAR_URL_DEFAULT;
return AVATAR_URL_DEFAULT;
}
- // Editor draft preview: resolve the unsaved look through the draft endpoint —
+ // Editor draft preview: resolve the unsaved look through the draft endpoint,
// the base (unbaked) GLB plus an appearance overlay we apply client-side.
if (params.get('preview') === 'true' || params.get('preview') === '1') {
isDraftPreview = true;
@@ -175,18 +175,18 @@ const CLIP_IDLE = 'idle';
const CLIP_WALK = 'av-walk-feminine';
const CLIP_RUN = 'av-walk-feminine'; // no separate run clip; timeScale handles pace difference
-const WALK_SPEED = 1.6; // m/s — target ground speed in walk mode
-const RUN_SPEED = 4.0; // m/s — target ground speed in run mode
+const WALK_SPEED = 1.6; // m/s, target ground speed in walk mode
+const RUN_SPEED = 4.0; // m/s, target ground speed in run mode
// Natural ground speed of the Mixamo clips at timeScale=1, in m/s. Measured
// from the clip cadence (root-bone delta per cycle ÷ cycle duration on the
// canonical Avaturn rig). We rescale the mixer's timeScale by
-// actualSpeed / NATURAL_* so foot-plants line up with translation — kills
+// actualSpeed / NATURAL_* so foot-plants line up with translation, kills
// the "skating" artifact that shows when clip cadence != translation speed.
const NATURAL_WALK_SPEED = 1.5;
const NATURAL_RUN_SPEED = 3.4;
-const TURN_LERP = 0.18; // 0..1 — how snappy avatar facing follows movement
-const CAM_LERP = 0.12; // 0..1 — how snappy follow-camera trails the avatar
-// Procedural body lean — pitch the avatar slightly forward when moving so
+const TURN_LERP = 0.18; // 0..1, how snappy avatar facing follows movement
+const CAM_LERP = 0.12; // 0..1, how snappy follow-camera trails the avatar
+// Procedural body lean, pitch the avatar slightly forward when moving so
// the silhouette communicates weight transfer instead of looking like the
// torso is being slid along on rails. Radians, ramped by speed fraction.
const LEAN_WALK_RAD = 0.05;
@@ -195,7 +195,7 @@ const LEAN_LERP = 0.12;
const CAM_OFFSET = new Vector3(0, 1.85, 3.6); // behind-and-above, relative to avatar yaw
const CAM_LOOK_OFFSET = new Vector3(0, 1.1, 0);
const GROUND_RADIUS = 12;
-// Right-hand "look" stick — radians/sec the camera rotates at full deflection.
+// Right-hand "look" stick, radians/sec the camera rotates at full deflection.
// Signs mirror the canvas drag-orbit handler so push-right turns right and
// push-up tilts the view up.
const LOOK_YAW_SPEED = 2.6;
@@ -341,7 +341,7 @@ if (screenshotBtn) screenshotBtn.addEventListener('click', () => walkCapture.scr
if (minimapBtn) minimapBtn.addEventListener('click', () => toggleMinimap());
// ── On-screen touch action cluster (mobile) ──────────────────────────────
-// jump / camera flip / gestures for thumbs — keyboardless devices can't reach
+// jump / camera flip / gestures for thumbs, keyboardless devices can't reach
// Space, C, or G. The gesture button is wired by WalkGestures.attachTouchButton
// (tap = open the wheel, long-press = aim-and-release) once gestures are ready.
document.getElementById('walk-touch-jump')?.addEventListener('click', () => triggerJump());
@@ -412,7 +412,7 @@ if (friendsOverlay) {
});
}
-// Keep HUD unread badge live — start a background load immediately so the
+// Keep HUD unread badge live, start a background load immediately so the
// badge appears before the user opens the panel for the first time.
const _fc = friendsClient();
_fc.subscribe(() => {
@@ -458,7 +458,7 @@ function esc(s) {
// ── Renderer / scene ──────────────────────────────────────────────────────
// preserveDrawingBuffer is required so the canvas pixels remain readable for
-// the "Record" feature — without it, drawImage(renderer.domElement, …) into
+// the "Record" feature, without it, drawImage(renderer.domElement, …) into
// the offscreen compositor canvas returns blank pixels after the next paint.
const renderer = new WebGLRenderer({
canvas,
@@ -472,7 +472,7 @@ renderer.shadowMap.enabled = true;
// PCFSoftShadowMap is deprecated in three.js and silently downgrades to hard
// PCFShadowMap at runtime; VSMShadowMap is the supported soft-shadow type.
renderer.shadowMap.type = VSMShadowMap;
-// Filmic response to match the IRL/avatar-sdk render stack — the IBL below
+// Filmic response to match the IRL/avatar-sdk render stack, the IBL below
// already supplies real ambient light; ACES keeps its highlights from clipping.
renderer.toneMapping = ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.1;
@@ -481,10 +481,10 @@ const scene = new Scene();
const pmrem = new PMREMGenerator(renderer);
scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
-// The neutral room IBL — restored for environments that ship no HDR (the void).
+// The neutral room IBL, restored for environments that ship no HDR (the void).
const defaultEnvTexture = scene.environment;
-// Lights — ambient + hemi for soft fill, directional for shadow cast.
+// Lights, ambient + hemi for soft fill, directional for shadow cast.
const ambientLight = new AmbientLight(0xffffff, 0.55);
scene.add(ambientLight);
const hemi = new HemisphereLight(0xbcd6ff, 0x202830, 0.6);
@@ -517,7 +517,7 @@ const frameGovernor = createFrameGovernor();
const focusState = trackWindowFocus();
let powerSaver = getPowerSaver();
-// Ground — opaque disc in non-AR mode, swapped to a shadow-only catcher in AR.
+// Ground, opaque disc in non-AR mode, swapped to a shadow-only catcher in AR.
const groundOpaque = new Mesh(
new CircleGeometry(GROUND_RADIUS, 64),
new MeshStandardMaterial({ color: 0x202833, roughness: 0.95, metalness: 0.0 }),
@@ -529,7 +529,7 @@ scene.add(groundOpaque);
// terrain below supersedes it as the visible, walkable ground in non-AR mode.
groundOpaque.visible = false;
-// Procedural heightfield terrain — the single source of truth for ground shape.
+// Procedural heightfield terrain, the single source of truth for ground shape.
// Its column-major height buffer feeds both this mesh and the Rapier heightfield
// collider (see initWalkPhysics), so the surface you see is the surface you walk.
// `let`, not `const`: each environment regenerates the heightfield with its own
@@ -549,7 +549,7 @@ const trailSetting = createTrailSetting(TRAIL_KEY, 'footprints');
let trails = null;
// ── NPC companions (Task 19) ───────────────────────────────────────────────
-// A small cast of autonomous companions — a greeter, a wanderer, and a guide —
+// A small cast of autonomous companions, a greeter, a wanderer, and a guide,
// that make each environment feel inhabited. Built once the avatar + animation
// clips load (so NPCs share the resolved clip library), spawned/despawned per
// environment with its own dialogue table, and ticked in the render loop. The
@@ -587,7 +587,7 @@ groundShadowCatcher.receiveShadow = true;
groundShadowCatcher.visible = false;
scene.add(groundShadowCatcher);
-// Blob contact shadow — radial gradient decal that moves with the avatar.
+// Blob contact shadow, radial gradient decal that moves with the avatar.
// Ensures there is always a convincing foot-contact cue even on low-end
// devices where PCF shadow maps may be coarse or disabled.
const _blobCanvas = document.createElement('canvas');
@@ -613,7 +613,7 @@ blobShadow.rotation.x = -Math.PI / 2;
blobShadow.position.y = 0.004;
scene.add(blobShadow);
-// Camera + follow-rig — avatar lives at scene origin (translated by a group)
+// Camera + follow-rig, avatar lives at scene origin (translated by a group)
// so the camera offset math stays in local space.
const camera = new PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.05, 200);
const avatarRig = new Group();
@@ -627,7 +627,7 @@ const camLookCurrent = new Vector3();
let cameraYaw = 0; // user-controlled orbit yaw around avatar (radians)
let cameraPitch = 0.05; // small downward tilt by default
// In AR mode the camera is frozen in world space instead of following the
-// avatar — the joystick then walks the avatar around physically and natural
+// avatar, the joystick then walks the avatar around physically and natural
// perspective makes it grow/shrink as it approaches/recedes. Captured when
// AR is enabled, cleared when AR is disabled.
let arFrozenCamPos = null;
@@ -665,7 +665,7 @@ const FP_EYE_HEIGHT_MULT = 0.9; // fraction of avatar height for eye position
const TOPDOWN_HEIGHT = 18;
const TOPDOWN_LOOK_DOWN = new Vector3(0, -1, 0.001); // slight offset so lookAt works
-// Hot-path scratch — computeCameraForMode runs every frame; reuse these instead
+// Hot-path scratch, computeCameraForMode runs every frame; reuse these instead
// of allocating fresh Vector3s per call. _RIGHT is the world +X (pitch) axis;
// upY (the world +Y / yaw axis, defined below) is reused for the yaw rotation.
const _RIGHT = new Vector3(1, 0, 0);
@@ -745,7 +745,7 @@ function updateCameraModeIndicator() {
}
// Compute desired camera position/look for each mode
-// Returns a shared scratch { pos, look } — the caller must read/copy the values
+// Returns a shared scratch { pos, look }, the caller must read/copy the values
// in the same frame and must not retain the reference across frames.
function computeCameraForMode(mode, avatarPos, avatarHeight) {
const pos = _camPos;
@@ -794,7 +794,7 @@ function applyCameraImmediate() {
// Recompute the follow offset so the full avatar plus headroom fits the
// current viewport. Distance is derived from the camera's vertical FOV, and
// portrait/narrow viewports (phones) get pulled back further so the head
-// isn't cropped. Safe to call before an avatar loads — uses the cached height.
+// isn't cropped. Safe to call before an avatar loads, uses the cached height.
// On a resize we update the offset only and let the follow loop lerp to it;
// on first load we snap so frame 0 is already framed.
function frameAvatarCamera({ snap = true } = {}) {
@@ -812,7 +812,7 @@ function frameAvatarCamera({ snap = true } = {}) {
}
applyCameraImmediate();
-// ── Canvas camera control — one-finger drag orbits, two-finger pinch zooms ──
+// ── Canvas camera control, one-finger drag orbits, two-finger pinch zooms ──
// Multi-touch aware via a live pointer map: the joystick(s) and the camera can
// be driven at the same time because pointers that land inside a stick zone are
// never tracked here. A single tracked pointer orbits; a second promotes the
@@ -833,7 +833,7 @@ applyCameraImmediate();
};
canvas.addEventListener('pointerdown', (e) => {
- // Pointers belonging to a stick zone are owned by nipplejs — capturing
+ // Pointers belonging to a stick zone are owned by nipplejs, capturing
// them here would redirect its move stream and break movement.
if (
inRect(joystickEl, e.clientX, e.clientY) ||
@@ -895,7 +895,7 @@ applyCameraImmediate();
canvas.addEventListener('pointercancel', onUp);
}
-// ── Input state — combined keyboard + joystick → unit move vector ────────
+// ── Input state, combined keyboard + joystick → unit move vector ────────
const input = {
keys: { forward: 0, back: 0, left: 0, right: 0, run: false },
joy: { x: 0, y: 0, active: false },
@@ -944,12 +944,12 @@ const GROUND_Y = 0;
// ── Physics ────────────────────────────────────────────────────────────────
// A real Rapier solver drives roaming when available (non-AR). Until the WASM
-// runtime finishes loading — and in AR, where the avatar floats in the room —
+// runtime finishes loading, and in AR, where the avatar floats in the room,
// movement falls back to the legacy direct-mutation path below.
let physics = null;
let physicsReady = false;
let character = null;
-let verticalVel = 0; // m/s — integrated vertical velocity for the physics path
+let verticalVel = 0; // m/s, integrated vertical velocity for the physics path
let characterGrounded = true;
let physicsActivePrev = false; // rising-edge guard to resync after AR/legacy
@@ -1006,7 +1006,7 @@ const helpOverlay = (() => {
el.setAttribute('aria-hidden', 'true');
// The overlay is pointer-events:none at ALL times, including while shown.
// It's a read-only info panel with no interactive controls, and on tall /
- // portrait viewports its card overlaps the bottom joysticks — a capturing
+ // portrait viewports its card overlaps the bottom joysticks, a capturing
// overlay (even at opacity:0) silently eats every joystick / canvas touch
// and makes the controls feel dead. Dismissal is handled entirely by the
// window-level pointerdown listener below plus H / Esc, so the panel never
@@ -1014,7 +1014,7 @@ const helpOverlay = (() => {
// Its own switches are the exception: they opt back into pointer events, but
// only while the panel is open (`.is-open`), so a hidden overlay still can't
// swallow a joystick touch. Without this the haptics / trail / NPC / power
- // switches rendered but could never be clicked — the canvas got every event.
+ // switches rendered but could never be clicked, the canvas got every event.
{
const s = document.createElement('style');
s.id = 'walk-help-overlay-style';
@@ -1102,7 +1102,7 @@ const helpOverlay = (() => {
return el;
})();
-// Haptics on/off switch lives in the controls overlay — keep its tap from
+// Haptics on/off switch lives in the controls overlay, keep its tap from
// bubbling up to the dismiss-on-any-pointer handler below.
const hapticsToggle = helpOverlay.querySelector('#walk-haptics-toggle');
if (hapticsToggle) {
@@ -1117,9 +1117,9 @@ if (hapticsToggle) {
});
}
-// Path-trail style switch — cycles off → footprints → glow → line. Persisted via
+// Path-trail style switch, cycles off → footprints → glow → line. Persisted via
// trailSetting; applied live to the trail system (which may not exist yet if the
-// avatar is still loading — the new style is still persisted and read on build).
+// avatar is still loading, the new style is still persisted and read on build).
const trailToggle = helpOverlay.querySelector('#walk-trail-toggle');
if (trailToggle) {
trailToggle.addEventListener('click', () => {
@@ -1161,7 +1161,7 @@ if (powerSaverToggle) {
});
}
-// NPC companions on/off. Persisted; applied live — turning them on respawns the
+// NPC companions on/off. Persisted; applied live, turning them on respawns the
// current environment's cast, turning them off despawns and releases every NPC.
const npcToggle = helpOverlay.querySelector('#walk-npc-toggle');
if (npcToggle) {
@@ -1196,7 +1196,7 @@ function toggleHelp() {
}
// Any pointer interaction dismisses the overlay. Capture phase + a
// non-blocking backdrop means the SAME tap that closes the panel also reaches
-// the joystick underneath — so the first-visit help never costs the user a
+// the joystick underneath, so the first-visit help never costs the user a
// stalled touch. Controls tagged data-help-keep (the haptics switch) are
// exempt so toggling a setting doesn't slam the panel shut.
window.addEventListener(
@@ -1238,7 +1238,7 @@ window.addEventListener('keydown', (e) => {
case 'KeyQ':
cameraYaw += SNAP_TURN_RAD;
break;
- // 'E' kept for snap turn — environment cycles via 'V'
+ // 'E' kept for snap turn, environment cycles via 'V'
case 'KeyE':
cameraYaw -= SNAP_TURN_RAD;
break;
@@ -1252,7 +1252,7 @@ window.addEventListener('keydown', (e) => {
break;
case 'KeyT':
// Push-to-talk: hold T to speak to the avatar. Ignore the auto-repeat
- // the OS fires while held — recording starts on the first press and
+ // the OS fires while held, recording starts on the first press and
// ends on keyup. (Enter still opens the text chat box.)
e.preventDefault();
if (!e.repeat) voiceChat?.startListening();
@@ -1408,7 +1408,7 @@ const wantsTouchControls = (() => {
return matchMedia('(hover: none)').matches || matchMedia('(max-width: 640px)').matches;
})();
-// Radial dead zone — nipplejs reports a vector the instant a thumb grazes the
+// Radial dead zone, nipplejs reports a vector the instant a thumb grazes the
// ring, which reads as drift. We swallow the inner `dead` fraction and remap
// the remainder to the full [0, 1] range so the stick still reaches max speed
// at the rim while staying dead-still for tiny touches.
@@ -1423,7 +1423,7 @@ function applyDeadzone(x, y, dead = JOY_DEADZONE) {
const joystick = nipplejs.create({
zone: joystickEl,
- // Floating on touch — the stick materializes wherever the left thumb lands
+ // Floating on touch, the stick materializes wherever the left thumb lands
// inside the zone (which spans the lower-left of the screen) and follows it,
// so the user never has to look for a fixed pad. Static elsewhere.
mode: wantsTouchControls ? 'dynamic' : 'static',
@@ -1434,12 +1434,12 @@ const joystick = nipplejs.create({
});
joystick.on('move', (evt) => {
// nipplejs v1 calls handlers with a single { type, target, data } event
- // object — the move payload lives on evt.data, not a second argument.
+ // object, the move payload lives on evt.data, not a second argument.
const data = evt?.data;
if (data?.vector) {
// data.vector is the proportional stick displacement within the radius,
// already in [-1, 1] per axis (magnitude ≤ 1). y is positive when the
- // stick is pushed UP — our forward direction.
+ // stick is pushed UP, our forward direction.
const d = applyDeadzone(data.vector.x, data.vector.y);
input.joy.x = d.x;
input.joy.y = d.y;
@@ -1452,7 +1452,7 @@ joystick.on('end', () => {
input.joy.active = false;
});
-// Right-hand "look" stick — drives the follow-camera yaw/pitch so touch users
+// Right-hand "look" stick, drives the follow-camera yaw/pitch so touch users
// can turn the view with a thumb instead of fighting the avatar for the
// canvas. Only mounted where the desktop mouse-look affordances are hidden
// (touch / narrow viewports); on a wide pointer-fine screen the WASD + mouse
@@ -1500,10 +1500,10 @@ function rebuildFootPlant() {
}
let avatarYaw = 0; // current facing (radians); we lerp this toward movement angle
let avatarLean = 0; // current torso pitch (radians); lerps toward target lean
-let currentMotion = 'idle'; // 'idle' | 'walk' | 'run' — drives clip crossfades
+let currentMotion = 'idle'; // 'idle' | 'walk' | 'run', drives clip crossfades
let avatarHeight = 1.8; // cached avatar height, updated on load/switch
-// Cached gltf scene + animation manifest defs, populated by loadAvatar — the
+// Cached gltf scene + animation manifest defs, populated by loadAvatar, the
// multiplayer layer reuses both to spawn remote-player avatars without
// re-fetching the .glb or the clip manifest. SkeletonUtils.clone() makes a
// proper deep copy of skinned hierarchies; vanilla object3D.clone() would
@@ -1529,7 +1529,7 @@ function applyLocalCosmetics(wire) {
}
// three.ws avatars ship with EXT_meshopt_compression, so every GLTFLoader that
-// loads one must have the meshopt decoder wired first — otherwise GLTFLoader
+// loads one must have the meshopt decoder wired first, otherwise GLTFLoader
// throws "setMeshoptDecoder must be called before loading compressed files".
// Build the loader once and share it across the initial load, live avatar swaps,
// and remote-player templates (mirrors walk-embed.js's getAvatarLoader).
@@ -1631,9 +1631,9 @@ async function loadAvatar() {
currentMotion = 'idle';
dismissLoading();
- // Clear the sticky "loading avatar…" pill that #walk-status ships with —
+ // Clear the sticky "loading avatar…" pill that #walk-status ships with,
// setStatus auto-hides this confirmation after a couple of seconds.
- setStatus('Ready — drag to look around');
+ setStatus('Ready, drag to look around');
setupGestures();
// Stand up the NPC companion system now that the clip library is resolved.
@@ -1649,14 +1649,14 @@ async function loadAvatar() {
});
walkNpcs.setEnabled(npcsEnabled);
- // Stand up the agent desk system — desks show live agent screens in-world.
+ // Stand up the agent desk system, desks show live agent screens in-world.
// Fetches active agents from Redis and spawns one desk per active stream.
walkAgentDesks = createAgentDeskManager({ scene, camera, renderer });
fetchLiveAgentDesks().then((deskConfigs) => {
if (deskConfigs.length) walkAgentDesks.spawn(deskConfigs);
}).catch(() => {});
- // Auto-hide help hints after 5 seconds — fade first, then remove from layout
+ // Auto-hide help hints after 5 seconds, fade first, then remove from layout
// so the transition in temporary.html's #walk-help { transition: opacity } plays.
if (helpEl) {
helpAutoHideTimer = setTimeout(() => {
@@ -1718,7 +1718,7 @@ function setupGestures() {
animationManager,
getMotionClip: () => motionToClipName(currentMotion),
// Replicate the gesture's clip to other players over the existing emote
- // channel — remote avatars render it full-body via _playRemoteEmote.
+ // channel, remote avatars render it full-body via _playRemoteEmote.
broadcast: (clip) => {
if (net) net.sendEmote(clip);
},
@@ -1741,7 +1741,7 @@ function setupGestures() {
// Track the user's recent gestures for session persistence. Wrapping play()
// here (rather than editing walk-gestures.js) records every user-initiated
- // gesture — wheel, tray, quick keys, programmatic — without touching the
+ // gesture, wheel, tray, quick keys, programmatic, without touching the
// gesture module. Remote echoes pass { silent: true } and are not recorded.
const _origPlay = gestures.play.bind(gestures);
gestures.play = (name, opts = {}) => {
@@ -1775,7 +1775,7 @@ function setupGestures() {
// Two-way voice chat (push-to-talk). Wires the WalkVoiceChat controller to the
// page's avatar, persona, speech bubble, chat log, talking overlay, and the
-// multiplayer chat channel — then exposes walk.say(text, { voice, gesture }) so
+// multiplayer chat channel, then exposes walk.say(text, { voice, gesture }) so
// the narrator / scripts can make the avatar speak with real TTS + lipsync.
function setupVoiceChat() {
if (voiceChat) return;
@@ -1860,7 +1860,7 @@ function estimateLighting() {
);
hemi.color.lerp(_leColor, 0.12);
} catch {
- /* cross-origin or tainted canvas — skip */
+ /* cross-origin or tainted canvas, skip */
}
}
@@ -1928,7 +1928,7 @@ async function enableAR() {
arFrozenCamPos = camera.position.clone();
arFrozenCamLook = camLookCurrent.clone();
- setStatus('AR on — joystick walks your agent');
+ setStatus('AR on, joystick walks your agent');
}
function disableAR() {
@@ -1981,7 +1981,7 @@ arBtn.addEventListener('click', () => {
});
// ── Mobile AR CTA ────────────────────────────────────────────────────────
-// three.ws is "3D agents in real life," not a metaverse — the AR camera
+// three.ws is "3D agents in real life," not a metaverse, the AR camera
// feature is the point. On touch devices the small "AR" pill in the corner
// is easy to miss, so we surface a prominent CTA after the avatar loads
// inviting the user to put their agent on their real floor. Dismissible.
@@ -2003,7 +2003,7 @@ const AR_CTA_DISMISS_KEY = 'walk:ar-cta-dismissed';
// enableAR() with a clear error message.
(function initArButtonState() {
if (!arBtn) return;
- if (CAMERA_SUPPORTED) return; // all good — leave the button as-is
+ if (CAMERA_SUPPORTED) return; // all good, leave the button as-is
// Camera API unavailable: mark the button as disabled and explain why.
arBtn.disabled = true;
@@ -2054,7 +2054,7 @@ if (arCta) {
// ── Recording (6s composite clip → Web Share API or download) ────────────
// Composites the live camera feed (when AR is active) plus the WebGL canvas
// into a single offscreen canvas, runs MediaRecorder on its captureStream,
-// and hands the resulting blob to navigator.share — the IRL viral loop.
+// and hands the resulting blob to navigator.share, the IRL viral loop.
const RECORD_SECONDS = 6;
let recording = false;
@@ -2167,12 +2167,12 @@ async function startRecording() {
await navigator.share({
files: [file],
title: 'My 3D agent on three.ws',
- text: 'Walking around on three.ws — your AI, in the real world.',
+ text: 'Walking around on three.ws, your AI, in the real world.',
});
setStatus('shared');
return;
} catch (err) {
- // User cancelled or share failed — fall through to download.
+ // User cancelled or share failed, fall through to download.
if (err?.name !== 'AbortError') {
log.warn('[walk] share failed, falling back to download:', err);
} else {
@@ -2208,7 +2208,7 @@ async function startRecording() {
if (recordBtn) {
recordBtn.addEventListener('click', () => {
- if (recording) return; // single shot — must finish first
+ if (recording) return; // single shot, must finish first
startRecording();
hideArCta(); // recording is a user gesture; if they hit record, dismiss the CTA
});
@@ -2241,7 +2241,7 @@ const _camToAvatarTmp = new Vector3();
function readMoveInput() {
let ix, iy;
if (input.joy.active) {
- // Joystick vector — y up is forward.
+ // Joystick vector, y up is forward.
ix = input.joy.x;
iy = input.joy.y;
// User input cancels waypoint
@@ -2252,7 +2252,7 @@ function readMoveInput() {
// User input cancels waypoint
if (waypointTarget) waypointTarget = null;
} else if (waypointTarget) {
- // Auto-walk toward waypoint — compute direction in world space,
+ // Auto-walk toward waypoint, compute direction in world space,
// then project to camera-relative input so the existing movement
// pipeline handles facing and animation correctly.
const dx = waypointTarget.x - avatarRig.position.x;
@@ -2305,7 +2305,7 @@ function tick(frameNow) {
clock.update();
const dt = Math.min(clock.getDelta(), 0.05); // clamp huge frames after a tab switch
- // Right-stick look — rotate the follow-camera while the stick is held.
+ // Right-stick look, rotate the follow-camera while the stick is held.
// Signs match the drag-orbit handler: push right turns right, push up
// tilts the view upward, clamped to the same pitch limits.
if (input.look.active) {
@@ -2323,7 +2323,7 @@ function tick(frameNow) {
// can re-anchor the avatar each frame without fighting the physics character.
const usePhysics = physicsReady && !!character && !arActive && !GALLERY_MODE;
- // Legacy jump — simple parabola in Y, lands back at GROUND_Y. The physics
+ // Legacy jump, simple parabola in Y, lands back at GROUND_Y. The physics
// path integrates verticalVel against real ground contact instead.
if (!usePhysics && jumpActive && avatar) {
jumpVelocity += GRAVITY * dt;
@@ -2396,7 +2396,7 @@ function tick(frameNow) {
// Animation crossfade based on actual speed (the AnimationManager
// no-ops if the requested name is already current). A full-body gesture
- // (sit/dance) owns the base layer — skip the locomotion crossfade until it
+ // (sit/dance) owns the base layer, skip the locomotion crossfade until it
// clears; an upper-body gesture (wave/point) rides additively over it.
const want = wantRun ? 'run' : 'walk';
if (currentMotion !== want) {
@@ -2412,7 +2412,7 @@ function tick(frameNow) {
}
}
- // Physics movement — feed the frame's horizontal displacement plus an
+ // Physics movement, feed the frame's horizontal displacement plus an
// integrated vertical velocity to the kinematic character controller. It
// resolves wall slides, step-ups, ground contact, and shoves dynamic props,
// then hands back where the feet actually ended up. We step the world right
@@ -2433,7 +2433,7 @@ function tick(frameNow) {
characterGrounded = res.grounded;
if (characterGrounded && verticalVel < 0) verticalVel = 0;
- // Boundary safety — keep roaming inside the ground disc. Snap the body
+ // Boundary safety, keep roaming inside the ground disc. Snap the body
// too so the controller's next query starts from the corrected spot.
let px = res.position.x;
let pz = res.position.z;
@@ -2466,7 +2466,7 @@ function tick(frameNow) {
animationManager.mixer.timeScale = ts;
}
- // Procedural forward lean — sells weight transfer. Target lean ramps
+ // Procedural forward lean, sells weight transfer. Target lean ramps
// with how much of the input is engaged; we lerp to it so direction
// changes don't snap.
const targetLean =
@@ -2482,7 +2482,7 @@ function tick(frameNow) {
// the camera reads its position, so the treadmill stays seamless.
if (marketplaceGallery) marketplaceGallery.update(dt);
- // 2. Update camera — frozen in AR mode, camera-mode system otherwise.
+ // 2. Update camera, frozen in AR mode, camera-mode system otherwise.
if (arFrozenCamPos && arFrozenCamLook) {
// Clamp the avatar so it can't walk through (or past) the frozen camera.
_camFwdTmp.subVectors(arFrozenCamLook, arFrozenCamPos);
@@ -2619,8 +2619,8 @@ function lerpAngle(a, b, t) {
// ── Walk metrics (leaderboard + per-creator analytics) ─────────────────────
//
// Accumulates the two signals the leaderboard (task 39) and embed analytics
-// (task 40) rank/aggregate on — horizontal distance travelled and time spent
-// actually walking — straight from the controller's resolved per-frame
+// (task 40) rank/aggregate on, horizontal distance travelled and time spent
+// actually walking, straight from the controller's resolved per-frame
// displacement, and flushes a compact batch to POST /api/walk/metrics every
// ~60s plus once on pagehide (sendBeacon, so it survives the unload). The same
// batch carries any achievement thresholds crossed this session so the server
@@ -2636,7 +2636,7 @@ const WALK_ANON_KEY = 'twx_walk_anon';
const WALK_ACHIEVED_KEY = 'twx_walk_achieved';
const WALK_FLUSH_INTERVAL_MS = 60_000;
-// Stable anonymous walker id — generated once and persisted, so an unauthenticated
+// Stable anonymous walker id, generated once and persisted, so an unauthenticated
// walker accrues a continuous track record across sessions/visits.
function getWalkAnonId() {
try {
@@ -2650,7 +2650,7 @@ function getWalkAnonId() {
}
return id;
} catch {
- // Private mode / storage disabled — fall back to a per-page id so the batch
+ // Private mode / storage disabled, fall back to a per-page id so the batch
// is still attributable (just not continuous across reloads).
if (!getWalkAnonId._mem) {
getWalkAnonId._mem = `anon_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`;
@@ -2661,7 +2661,7 @@ function getWalkAnonId() {
// The avatar whose walks we attribute. Seeded from ?avatar and kept in sync when
// the in-page picker swaps avatars (see the picker block, which calls
-// setWalkMetricsAvatarId). Only forwarded when it is a real UUID — the default
+// setWalkMetricsAvatarId). Only forwarded when it is a real UUID, the default
// avatar has no id.
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
let walkMetricsAvatarId = (() => {
@@ -2719,7 +2719,7 @@ function captureWalkState() {
heading: round3(avatarYaw),
trailStyle: trailSetting.get(),
recentGestures: [...recentGestures],
- // Multiplayer room — the coin mint doubles as the matchmaking key. Recorded
+ // Multiplayer room, the coin mint doubles as the matchmaking key. Recorded
// so the snapshot is complete; rejoining is URL-driven so it is informational.
roomCode: COIN_PARAMS.coin || null,
};
@@ -2735,7 +2735,7 @@ function round3(n) {
async function restoreWalkState(state) {
if (!state || typeof state !== 'object') return;
- // Environment — only if it differs from what initEnvironments already staged.
+ // Environment, only if it differs from what initEnvironments already staged.
if (state.envId && walkManifest && state.envId !== currentEnvName) {
const meta = getEnvironment(walkManifest, state.envId);
if (meta) await applyEnvironment(meta.name, { initial: true });
@@ -2783,7 +2783,7 @@ async function restoreWalkState(state) {
}
}
- // Recent gestures — seed the most-recent-first ring for quick re-use.
+ // Recent gestures, seed the most-recent-first ring for quick re-use.
if (Array.isArray(state.recentGestures)) {
recentGestures.length = 0;
for (const g of state.recentGestures.slice(0, 5)) {
@@ -2791,7 +2791,7 @@ async function restoreWalkState(state) {
}
}
- // Avatar — swap last so it lands on the restored ground position. Only when it
+ // Avatar, swap last so it lands on the restored ground position. Only when it
// differs from the booted avatar and resolves to a loadable URL.
const wantUrl = state.avatarUrl || null;
if (wantUrl && wantUrl !== resolvedAvatarUrl && isLoadableAvatarUrl(wantUrl)) {
@@ -2835,7 +2835,7 @@ function persistAchievedSet(set) {
try {
localStorage.setItem(WALK_ACHIEVED_KEY, JSON.stringify([...set]));
} catch {
- /* storage disabled — toasts still fire from the in-memory set */
+ /* storage disabled, toasts still fire from the in-memory set */
}
}
const walkAchieved = loadAchievedSet();
@@ -2899,7 +2899,7 @@ function showAchievementToast(label) {
el.addEventListener('transitionend', () => el.remove(), { once: true });
}, 4200);
} catch {
- /* DOM unavailable — non-fatal; the unlock is still flushed to the server */
+ /* DOM unavailable, non-fatal; the unlock is still flushed to the server */
}
}
@@ -3019,7 +3019,7 @@ function trackWalkEvent(eventName, opts = {}) {
}
function startWalkMetrics() {
- // Expose the embed SDK tracking API. Idempotent — merges onto any existing
+ // Expose the embed SDK tracking API. Idempotent, merges onto any existing
// global so a host page that defined a stub before load keeps working.
window.ThreeWalkAvatar = Object.assign(window.ThreeWalkAvatar || {}, {
track: trackWalkEvent,
@@ -3037,7 +3037,7 @@ function startWalkMetrics() {
// ── Multiplayer ───────────────────────────────────────────────────────────
//
// The server is best-effort. /walk works fully as a single-player page if
-// the Colyseus server is unreachable — the WalkNet client emits status
+// the Colyseus server is unreachable, the WalkNet client emits status
// transitions but never blocks the render loop or the local controller.
const REMOTE_LERP = 0.22; // per-frame lerp factor toward the latest server state
@@ -3048,7 +3048,7 @@ const remotePlayers = new Map();
// ── Avatar inspector ──────────────────────────────────────────────────────
// I (or clicking a nameplate) opens the shared inspector on a player: who they
-// are, the agent they pilot, their reputation and wallet — the same server
+// are, the agent they pilot, their reputation and wallet, the same server
// truth every other surface reads. See src/shared/avatar-inspector.js.
function worldInspectFacts() {
if (COIN_PARAMS.coin) {
@@ -3068,7 +3068,7 @@ function inspectRemotePlayer(rp) {
world: COIN_PARAMS.coin ? 'coin world' : 'walk',
agentId: rp.agent || '',
wallet: rp.account || '',
- // Verified three.ws profile (W10) off the signed presence ticket — unlocks
+ // Verified three.ws profile (W10) off the signed presence ticket, unlocks
// the real profile card: follow, friend/DM, creations.
username: rp.username || '',
avatarUrl: rp._avatarUrl,
@@ -3085,7 +3085,7 @@ function inspectSelfPlayer() {
facts: worldInspectFacts(),
}, { trigger: canvas });
}
-// Nearest player within reach of your avatar; yourself when alone — the I key
+// Nearest player within reach of your avatar; yourself when alone, the I key
// always answers.
function inspectNearestPlayer() {
if (isAvatarInspectorOpen()) { closeAvatarInspector(); return; }
@@ -3101,13 +3101,13 @@ function inspectNearestPlayer() {
// In-world wallet reveal: walk up to a player piloting an agent and its wallet
// (vanity address, live value, tip) rises beside the nameplate. Frugal by design
-// — one card, throttled proximity scan, cached embed reads. See walk-wallet.js.
+//, one card, throttled proximity scan, cached embed reads. See walk-wallet.js.
const walletProximity = createWalkWalletProximity({
getLocalPosition: () => avatarRig.position,
remotePlayers,
});
-// Walk-Browse marketplace hall — only on /marketplace-walk; a no-op otherwise.
+// Walk-Browse marketplace hall, only on /marketplace-walk; a no-op otherwise.
// Builds a recycling belt of listing plinths and treadmills it past the avatar.
const marketplaceGallery = GALLERY_MODE
? createMarketplaceGallery({ scene, getLocalPosition: () => avatarRig.position })
@@ -3116,7 +3116,7 @@ const marketplaceGallery = GALLERY_MODE
let net = null;
let netConnected = false;
let coinTotem = null; // CoinTotem instance when in a coin community world
-let contentBillboard = null; // ContentBillboard instance — a static content panel in-world
+let contentBillboard = null; // ContentBillboard instance, a static content panel in-world
// Remote-avatar template cache. Each distinct GLB URL is fetched once and
// reused (via SkeletonUtils.clone) for every player wearing it, so a room full
@@ -3153,7 +3153,7 @@ function loadRemoteAvatarTemplate(url) {
return gltf.scene;
})
.catch((err) => {
- // A failed load must not poison the cache forever — drop the entry so a
+ // A failed load must not poison the cache forever, drop the entry so a
// later player can retry, and re-throw for the caller's own handling.
if (_remoteAvatarTemplates.get(url) === entry) _remoteAvatarTemplates.delete(url);
throw err;
@@ -3247,12 +3247,12 @@ class RemotePlayer {
this._lastEmoteTs = 0;
this._emoting = false;
this._avatarUrl = initial?.avatar || '';
- // The agent this peer is piloting (UUID) — drives the in-world wallet reveal.
+ // The agent this peer is piloting (UUID), drives the in-world wallet reveal.
this.agent = initial?.agent || null;
// Verified account wallet bound at sign-in (server-authoritative; empty for
// guests). Feeds the avatar inspector alongside the piloted agent.
this.account = initial?.account || '';
- // Verified three.ws username (W10) — bound server-side from the signed
+ // Verified three.ws username (W10), bound server-side from the signed
// presence ticket, so the inspector can open the real profile card.
this.username = initial?.username || '';
this.name = initial?.name || sessionId.slice(0, 6);
@@ -3275,7 +3275,7 @@ class RemotePlayer {
this.anim = new AnimationManager();
this.anim.attach(root);
this.anim.setAnimationDefs(animationDefs);
- // Reuse the already-fetched clips on the local manager — load asynchronously
+ // Reuse the already-fetched clips on the local manager, load asynchronously
// so the remote doesn't block on a second manifest fetch.
this.anim.loadAll().then(() => {
this.anim.crossfadeTo(motionToClipName(this.motion), 0.0);
@@ -3288,7 +3288,7 @@ class RemotePlayer {
this._swapAvatar(this._avatarUrl);
}
- // Floating name tag — rendered as a CSS-styled DOM sprite that we
+ // Floating name tag, rendered as a CSS-styled DOM sprite that we
// project onto the avatar's head each frame.
this.label = document.createElement('div');
this.label.className = 'walk-remote-label';
@@ -3304,13 +3304,13 @@ class RemotePlayer {
// Living-avatar legibility: enrich the nameplate with the piloted agent's
// wealth tier (a coloured dot) + a vanity mark, so a crowded plaza reads at a
- // glance — who's funded, who's vanity — without walking up to each. One cached,
+ // glance, who's funded, who's vanity, without walking up to each. One cached,
// deduped public wallet-embed read per agent; the tier dot rides CSS so the
// per-frame textContent name update never clobbers it. Released on dispose.
this._wealthLabel = null;
this._applyWealthLabel();
- // Visual state — target (latest server) vs current (interpolated).
+ // Visual state, target (latest server) vs current (interpolated).
this.targetX = initial?.x ?? 0;
this.targetY = initial?.y ?? 0;
this.targetZ = initial?.z ?? 0;
@@ -3346,12 +3346,12 @@ class RemotePlayer {
this._lastEmoteTs = player.emoteTs;
this._playRemoteEmote(player.emote);
}
- // Live avatar swap — a player picked a new avatar without rejoining.
+ // Live avatar swap, a player picked a new avatar without rejoining.
if (player.avatar !== this._avatarUrl && isLoadableAvatarUrl(player.avatar)) {
this._avatarUrl = player.avatar;
this._swapAvatar(player.avatar);
}
- // Live cosmetic change — they equipped/unequipped something.
+ // Live cosmetic change, they equipped/unequipped something.
if (player.cosmetics !== undefined && player.cosmetics !== this._cosWire) {
this._applyCosmetics(player.cosmetics);
}
@@ -3363,7 +3363,7 @@ class RemotePlayer {
}
// (Re)bind the nameplate's wealth-tier + vanity enrichment to the currently
- // piloted agent. Idempotent — tears down a stale binding before rebinding, and
+ // piloted agent. Idempotent, tears down a stale binding before rebinding, and
// no-ops (clean label) when the peer isn't piloting a real agent.
_applyWealthLabel() {
try { this._wealthLabel?.destroy?.(); } catch { /* already gone */ }
@@ -3372,8 +3372,8 @@ class RemotePlayer {
if (id && this.label) this._wealthLabel = applyWorldNameplate(this.label, id, { network: 'mainnet' });
}
- // (Re)dress this peer in their equipped loadout. Idempotent — re-applies only
- // when the wire changed — and shares applyLoadout with the local avatar so one
+ // (Re)dress this peer in their equipped loadout. Idempotent, re-applies only
+ // when the wire changed, and shares applyLoadout with the local avatar so one
// wardrobe renders the same in every world.
_applyCosmetics(wire) {
const next = typeof wire === 'string' ? wire : this._cosWire || '';
@@ -3557,7 +3557,7 @@ function setupOnlinePill() {
function renderOnlineCount() {
if (!onlineCountEl) return;
- // +1 for the local player — they're not in remotePlayers.
+ // +1 for the local player, they're not in remotePlayers.
onlineCountEl.textContent = String(remotePlayers.size + (netConnected ? 1 : 0));
}
@@ -3572,7 +3572,7 @@ function setOnlineStatus(status) {
: status === 'connecting'
? 'connecting…'
: status === 'failed'
- ? 'offline — tap to retry'
+ ? 'offline, tap to retry'
: status === 'offline'
? 'reconnecting…'
: status === 'unavailable'
@@ -3582,7 +3582,7 @@ function setOnlineStatus(status) {
}
function startNet() {
- // Draft previews run solo — never broadcast a throwaway, soon-to-expire
+ // Draft previews run solo, never broadcast a throwaway, soon-to-expire
// presigned GLB into a live room where peers would fail to load it.
if (isDraftPreview) return;
if (!avatarTemplate || !animationDefs) return;
@@ -3654,7 +3654,7 @@ function startNet() {
}
});
net.on('chat', (msg) => {
- // Our own messages are rendered optimistically on send — skip the echo.
+ // Our own messages are rendered optimistically on send, skip the echo.
if (!msg || msg.id === net.mySessionId) return;
const rp = remotePlayers.get(msg.id);
const color = rp?._color;
@@ -3669,7 +3669,7 @@ function startNet() {
}
// ── Gestures: see setupGestures() and src/walk-gestures.js. The radial
-// gesture wheel (hold G / long-press), the 1–8 quick keys, and the side
+// gesture wheel (hold G / long-press), the 1, 8 quick keys, and the side
// tray are all owned by the WalkGestures controller built in setupGestures().
// ── Speech bubbles (3D→2D projected CSS overlays) ────────────────────────
@@ -3798,7 +3798,7 @@ function updateSpeechBubbles() {
}
// ── Environment selector ─────────────────────────────────────────────────
-// Six worlds the avatar can roam — park, cyberpunk street, beach, gallery,
+// Six worlds the avatar can roam, park, cyberpunk street, beach, gallery,
// abstract void, and the three.ws office. Each is a real glTF scene (or the
// procedural void) with its own terrain tint, sky gradient, light rig, and HDR
// image-based lighting, defined in public/environments/index.json and loaded
@@ -3810,8 +3810,8 @@ let currentEnvName = 'park';
let envApplyToken = 0; // bumped per swap so a stale async load can't clobber a newer one
const envPropsGroup = new Group(); // holds the kickable dynamic props (balls/crates)
scene.add(envPropsGroup);
-let envScenery = null; // { group, dispose } — the current GLB/void scenery in the scene
-let envHdr = null; // { texture, dispose } — the current pre-filtered IBL
+let envScenery = null; // { group, dispose }, the current GLB/void scenery in the scene
+let envHdr = null; // { texture, dispose }, the current pre-filtered IBL
// Collider descriptors for the current environment. `worldObstacles` are static
// (trees/buildings/walls); `worldDynamicProps` are the kickable bodies whose
@@ -3865,11 +3865,11 @@ function buildCollidersFromMeta(meta) {
}
}
// The content billboard is a persistent prop, not part of any environment's
- // manifest — re-add its post colliders on every swap (this array is reset above).
+ // manifest, re-add its post colliders on every swap (this array is reset above).
if (contentBillboard) worldObstacles.push(...contentBillboard.colliders());
}
-// Kickable physics props — beach balls and crates that fall, roll, and get
+// Kickable physics props, beach balls and crates that fall, roll, and get
// shoved when the avatar walks into them. Counts come from the manifest. Each
// mesh is added to envPropsGroup (torn down on swap) with a descriptor in
// worldDynamicProps that rebuildPhysicsWorld() binds a rigid body to.
@@ -4081,7 +4081,7 @@ function fadeWorld(color, opacity) {
});
}
-// Environment indicator — a transient pill naming the active scene.
+// Environment indicator, a transient pill naming the active scene.
const envIndicator = (() => {
const el = document.createElement('div');
el.id = 'walk-env-indicator';
@@ -4312,7 +4312,7 @@ function startGifRecording() {
gifRecording = true;
gifFrames = [];
gifIndicator.style.display = 'inline-flex';
- setStatus('Recording started — press R to stop');
+ setStatus('Recording started, press R to stop');
gifInterval = setInterval(() => {
if (!gifRecording) return;
@@ -4353,7 +4353,7 @@ function stopGifRecording() {
async function exportFramesAsVideo(frames) {
// Re-render frames onto a canvas and use MediaRecorder for a real video file
if (frames.length < 2) {
- // Single frame — just download as PNG
+ // Single frame, just download as PNG
const a = document.createElement('a');
a.href = frames[0];
a.download = `three-ws-walk-${Date.now()}.png`;
@@ -4466,7 +4466,7 @@ const minimapContainer = (() => {
'z-index:6',
// Bottom-left, the corner /play's world HUD parks its radar in, lifted
// clear of the movement stick (140px pad at bottom 28). The bottom-RIGHT
- // corner is the walk companion mascot's (200x280, right/bottom 16) — the
+ // corner is the walk companion mascot's (200x280, right/bottom 16), the
// old minimap sat under it and only got away with it by defaulting to
// hidden. This radar is on by default, so it needs a corner of its own.
'left:16px',
@@ -4569,7 +4569,7 @@ const HELP_FIRST_VISIT_KEY = 'walk:help-shown';
function showHelpOnFirstVisit() {
// The overlay is a keyboard cheat-sheet (WASD/Shift/Space) and its card is
// tall enough to cover the joystick on a phone. Both are wrong on touch, so
- // skip the auto-popup there — the on-screen sticks are self-explanatory and
+ // skip the auto-popup there, the on-screen sticks are self-explanatory and
// the help button still opens it on demand.
if (IS_TOUCH) return;
try {
@@ -4621,7 +4621,7 @@ async function initWalkPhysics() {
// Catch up to whatever environment is already showing.
rebuildPhysicsWorld();
} catch (err) {
- // Solver failed to load — the legacy movement path keeps the scene fully
+ // Solver failed to load, the legacy movement path keeps the scene fully
// playable, so degrade quietly rather than blocking the experience.
log.warn('[walk] physics unavailable, using legacy movement:', err);
physics = null;
@@ -4696,7 +4696,7 @@ loadAvatar()
// the scene (default ground/lighting) is visible behind the message.
dismissLoading();
const hasParam = new URLSearchParams(location.search).has('avatar');
- const suffix = hasParam ? ' — <a href="/temporary">try the default avatar</a>' : '';
+ const suffix = hasParam ? ', <a href="/temporary">try the default avatar</a>' : '';
if (statusEl) {
statusEl.innerHTML = `failed to load avatar: ${err?.message ?? err}${suffix}`;
statusEl.classList.add('is-error');
@@ -4878,7 +4878,7 @@ if (import.meta.env?.DEV) {
addChatMessage(name, text);
// Show speech bubble above local avatar
showSpeechBubbleFor('local', text);
- // Read the avatar as speaking for the life of the bubble — the talking
+ // Read the avatar as speaking for the life of the bubble, the talking
// overlay animates the upper body while the message is on screen.
triggerTalking(text);
net?.sendChat(text);
@@ -4903,8 +4903,8 @@ if (import.meta.env?.DEV) {
// ── Coin community theming (HUD + 3D totem) ──────────────────────────────
// When /walk is entered as a coin community (?coin=<mint>&…), we theme the
// world: a top-center HUD carrying the coin's identity + live trade flow, and
-// a 3D totem at world center — a billboarded medallion of the coin over a
-// glowing ground ring — so each coin's space looks unmistakably its own.
+// a 3D totem at world center, a billboarded medallion of the coin over a
+// glowing ground ring, so each coin's space looks unmistakably its own.
{
const COIN_FRONTEND = 'https://pump.fun/coin/';
const TRADE_POLL_MS = 7000;
@@ -5028,7 +5028,7 @@ if (import.meta.env?.DEV) {
const accent = coinAccent(COIN_PARAMS.coin);
this.group = new Group();
- // Ground ring — flat, additive, slowly spinning.
+ // Ground ring, flat, additive, slowly spinning.
this.ringMesh = new Mesh(
new CircleGeometry(2.6, 64),
new MeshBasicMaterial({
@@ -5153,7 +5153,7 @@ if (import.meta.env?.DEV) {
</span>`;
document.body.appendChild(hud);
- // Live trade flow — last on-chain trade for this mint, refreshed on an
+ // Live trade flow, last on-chain trade for this mint, refreshed on an
// interval. Real data only: on any failure we leave the chip hidden.
const tradeEl = hud.querySelector('[data-trade]');
const url = `/api/pump/coin-trades?mint=${encodeURIComponent(COIN_PARAMS.coin)}&limit=1`;
@@ -5174,7 +5174,7 @@ if (import.meta.env?.DEV) {
}
}
} catch {
- /* offline / rate-limited — keep last value */
+ /* offline / rate-limited, keep last value */
}
if (!stopped) setTimeout(pollTrade, TRADE_POLL_MS);
}
@@ -5193,7 +5193,7 @@ if (import.meta.env?.DEV) {
}
// ── Content billboard ────────────────────────────────────────────────────────
-// A cheap, static billboard you can drop content onto — a framed panel on two
+// A cheap, static billboard you can drop content onto, a framed panel on two
// posts standing as a backdrop behind spawn. It is decoration, not an ad unit:
// no targeting, no tracking, no network of its own. It just shows one image (or
// a short caption) so a space has something on its walls.
@@ -5216,7 +5216,7 @@ if (import.meta.env?.DEV) {
const u = new URL(boardParam, location.origin);
if (u.protocol === 'http:' || u.protocol === 'https:') return u.href;
} catch {
- /* not a URL — treated as no image, caption-only is still valid */
+ /* not a URL, treated as no image, caption-only is still valid */
}
}
if (COIN_PARAMS.image) return COIN_PARAMS.image;
@@ -5286,7 +5286,7 @@ if (import.meta.env?.DEV) {
tex.needsUpdate = true;
}
};
- // On error we keep the fallback that's already painted — no handler needed.
+ // On error we keep the fallback that's already painted, no handler needed.
img.src = imageSrc;
}
return tex;
@@ -5320,7 +5320,7 @@ if (import.meta.env?.DEV) {
this.group.add(post);
}
- // Backing frame — a thin dark slab a touch larger than the screen so the
+ // Backing frame, a thin dark slab a touch larger than the screen so the
// panel reads as a solid board from any angle and the back isn't see-through.
const frame = new Mesh(
new BoxGeometry(PANEL_W + 0.4, PANEL_H + 0.4, 0.16),
@@ -5330,7 +5330,7 @@ if (import.meta.env?.DEV) {
frame.castShadow = true;
this.group.add(frame);
- // Content screen — unlit so the artwork is always legible and cheap to
+ // Content screen, unlit so the artwork is always legible and cheap to
// draw, sitting just proud of the frame's front face. Starts on the world
// default; a paid placement (if any) swaps in via setContent() once the
// /api/billboard fetch resolves.
@@ -5360,7 +5360,7 @@ if (import.meta.env?.DEV) {
prev?.dispose();
}
- // Sit the structure on the live terrain — re-called on every environment
+ // Sit the structure on the live terrain, re-called on every environment
// swap so the billboard tracks the new ground instead of floating or sinking.
placeOnTerrain() {
const y = terrain ? terrain.heightAt(FOOT.x, FOOT.z) : 0;
@@ -5400,7 +5400,7 @@ if (import.meta.env?.DEV) {
}
})
.catch(() => {
- /* offline / not configured — the world default stays on the panel */
+ /* offline / not configured, the world default stays on the panel */
});
buildBillboardPublisher();
@@ -5492,7 +5492,7 @@ if (import.meta.env?.DEV) {
<div style="font:700 16px/1.2 system-ui;margin-bottom:4px">Feature your content</div>
<div style="font:400 13px/1.45 system-ui;color:rgba(255,255,255,0.6);margin-bottom:16px">
Hold this world’s billboard for everyone who walks in. ${SLOT_LABEL}. It’s a content
- slot, not an ad — nothing is tracked.
+ slot, not an ad, nothing is tracked.
</div>
<label style="display:block;font:600 12px/1 system-ui;color:rgba(255,255,255,0.7);margin-bottom:6px">Image URL</label>
<input id="bb-image" type="url" inputmode="url" placeholder="https://…/art.png"
@@ -5503,7 +5503,7 @@ if (import.meta.env?.DEV) {
<div id="bb-msg" role="status" style="min-height:18px;font:500 12px/1.4 system-ui;color:#ffb4b4;margin-bottom:10px"></div>
<div style="display:flex;gap:8px;justify-content:flex-end">
<button id="bb-cancel" type="button" style="padding:9px 14px;border-radius:10px;border:1px solid rgba(255,255,255,0.14);background:transparent;color:rgba(255,255,255,0.8);font:600 13px system-ui;cursor:pointer">Cancel</button>
- <button id="bb-pay" type="button" style="padding:9px 16px;border-radius:10px;border:0;background:#5a8dee;color:#fff;font:700 13px system-ui;cursor:pointer">Feature — pay</button>
+ <button id="bb-pay" type="button" style="padding:9px 16px;border-radius:10px;border:0;background:#5a8dee;color:#fff;font:700 13px system-ui;cursor:pointer">Feature, pay</button>
</div>`;
overlay.appendChild(card);
document.body.appendChild(overlay);
@@ -5531,7 +5531,7 @@ if (import.meta.env?.DEV) {
return;
}
if (!window.X402?.pay) {
- setMsg('Wallet widget still loading — try again in a second.');
+ setMsg('Wallet widget still loading, try again in a second.');
return;
}
setMsg('');
@@ -5555,12 +5555,12 @@ if (import.meta.env?.DEV) {
} catch (err) {
if (err?.code === 'cancelled') {
payBtn.disabled = false;
- payBtn.textContent = 'Feature — pay';
+ payBtn.textContent = 'Feature, pay';
return;
}
- setMsg(err?.message || 'Payment failed — please try again.');
+ setMsg(err?.message || 'Payment failed, please try again.');
payBtn.disabled = false;
- payBtn.textContent = 'Feature — pay';
+ payBtn.textContent = 'Feature, pay';
}
});
@@ -5599,15 +5599,15 @@ if (import.meta.env?.DEV) {
// move → set the existing waypointTarget; the locomotion pipeline walks
// (and faces, and animates) the avatar there, exactly as a minimap
// click does.
-// gesture → gestures.play(name) — the same call the wheel / quick keys use.
+// gesture → gestures.play(name), the same call the wheel / quick keys use.
// say → a speech bubble above the avatar + the talking overlay, with
// optional browser TTS when the command requested voice.
-// env → applyEnvironment(name) — a live, faded environment swap.
+// env → applyEnvironment(name), a live, faded environment swap.
//
// Commands are delivered exactly once by the server, so we simply apply what each
// poll returns. The poll cadence backs off on transient failures so a blip never
// turns into a request storm, and stops cleanly if the session 401s (expired or
-// revoked) — there is nothing left to drive.
+// revoked), there is nothing left to drive.
(() => {
const params = new URLSearchParams(location.search);
const sessionId = (params.get('control') || '').trim();
@@ -5632,7 +5632,7 @@ if (import.meta.env?.DEV) {
window.speechSynthesis.cancel();
window.speechSynthesis.speak(u);
} catch {
- /* synthesis unavailable — the bubble already conveyed the line */
+ /* synthesis unavailable, the bubble already conveyed the line */
}
}
}
@@ -5696,7 +5696,7 @@ if (import.meta.env?.DEV) {
cache: 'no-store',
});
if (res.status === 401 || res.status === 403) {
- // Session expired or revoked — nothing left to drive.
+ // Session expired or revoked, nothing left to drive.
stopped = true;
setStatus('Remote-control session ended', { sticky: false });
return;
@@ -5709,7 +5709,7 @@ if (import.meta.env?.DEV) {
backoff = Math.min(MAX_BACKOFF_MS, backoff * 2);
}
} catch {
- // Offline / transient — back off and retry.
+ // Offline / transient, back off and retry.
backoff = Math.min(MAX_BACKOFF_MS, backoff * 2);
} finally {
inFlight = false;
@@ -5721,7 +5721,7 @@ if (import.meta.env?.DEV) {
stopped = true;
});
- setStatus('Remote control active — awaiting commands', { sticky: false });
+ setStatus('Remote control active, awaiting commands', { sticky: false });
// First poll after a short delay so the avatar/scene have a frame to settle.
setTimeout(pollOnce, 600);
})();
diff --git a/tests/event-leaderboard.test.js b/tests/event-leaderboard.test.js
index 3694fa590..a85fb0a3f 100644
--- a/tests/event-leaderboard.test.js
+++ b/tests/event-leaderboard.test.js
@@ -1,4 +1,4 @@
-// Event leaderboard ranking (order 04) — the pure math both the in-world panel and
+// Event leaderboard ranking (order 04), the pure math both the in-world panel and
// api/play/event-leaderboard.js fold their rows through. Ranking is the thing a
// player will argue about, so every rule is pinned: runs first, cash as the
// tiebreak, the earlier finisher ahead on a dead heat, and your own row findable
diff --git a/tests/event-quests.test.js b/tests/event-quests.test.js
index bd5a6b7a8..4e0bdb3f5 100644
--- a/tests/event-quests.test.js
+++ b/tests/event-quests.test.js
@@ -1,4 +1,4 @@
-// Event quest line (order 04) — the gate is the whole feature. An event job must
+// Event quest line (order 04), the gate is the whole feature. An event job must
// be invisible, unacceptable and unpayable outside the event window, and fully
// playable inside it, judged from the SERVER's read of public/event.json. These
// cases pin both halves plus the new `defeat` objective the combat job runs on.
diff --git a/tests/play-death-drop.test.js b/tests/play-death-drop.test.js
index 2f132903d..30a0be82c 100644
--- a/tests/play-death-drop.test.js
+++ b/tests/play-death-drop.test.js
@@ -44,7 +44,7 @@ function loadedProfile() {
return p;
}
-describe('killPlayer — the drop', () => {
+describe('killPlayer, the drop', () => {
it('drops carried cash and the pack, keeps banked cash and hotbar tools', () => {
const profile = loadedProfile();
const { room } = makeRoom(profile);
@@ -75,7 +75,7 @@ describe('killPlayer — the drop', () => {
});
});
-describe('killPlayer — what the dying player is told', () => {
+describe('killPlayer, what the dying player is told', () => {
it('pushes the emptied purse immediately, not at respawn', () => {
const profile = loadedProfile();
const { room, client } = makeRoom(profile);
@@ -117,7 +117,7 @@ describe('killPlayer — what the dying player is told', () => {
});
});
-describe('killPlayer — respawn', () => {
+describe('killPlayer, respawn', () => {
it('revives at full health at the safe spawn and persists the emptied profile', () => {
const profile = loadedProfile();
const { room, timers, sent } = makeRoom(profile);
diff --git a/tests/play-profile-identity.test.js b/tests/play-profile-identity.test.js
index ca1f44454..d8e7fd8e1 100644
--- a/tests/play-profile-identity.test.js
+++ b/tests/play-profile-identity.test.js
@@ -6,13 +6,13 @@
// end: the presence ticket carries the username + display name (signed, so a
// client can never wear a handle it doesn't own), WalkRoom publishes the
// verified username on the Player schema, and the shared avatar inspector
-// renders the real profile card — follow, friend/DM, creations — for any peer
+// renders the real profile card, follow, friend/DM, creations, for any peer
// whose ticket verified. These tests pin the three seams that make that
// trustworthy:
// 1. the multiplayer ticket verifier: profile fields round-trip, legacy
// tickets (no u/dn) still verify, tampering and expiry still fail;
// 2. the Player schema: `username` exists, defaults empty, and stays the
-// LAST field (append-only binary protocol — reordering breaks live
+// LAST field (append-only binary protocol, reordering breaks live
// clients against older servers);
// 3. the inspector profile card: renders real profile data, wires follow
// and message actions, and stays completely absent for guests.
@@ -92,7 +92,7 @@ describe('Player schema username field (W10)', () => {
const defBlock = src.slice(src.indexOf('defineTypes(Player'), src.indexOf('export class Block'));
const usernameAt = defBlock.indexOf("username: 'string'");
expect(usernameAt).toBeGreaterThan(-1);
- // Every other Player field must be declared before it — inserting a field
+ // Every other Player field must be declared before it, inserting a field
// mid-schema shifts the positional indices and desyncs live clients.
for (const field of ['id:', 'name:', 'account:', 'cosmetics:', 'it:', 'itSince:']) {
const at = defBlock.indexOf(field);
@@ -156,7 +156,7 @@ function routeApi({ following = false, followPost } = {}) {
if (followPost) return followPost(method);
return { ok: true, status: 200, json: async () => ({ following: method === 'POST', followed_by: false, followers_count: method === 'POST' ? 4 : 3, following_count: 2 }) };
}
- // Anything else (agents, balances) — a clean 404 keeps those sections quiet.
+ // Anything else (agents, balances), a clean 404 keeps those sections quiet.
return { ok: false, status: 404, json: async () => ({}) };
});
}
@@ -252,7 +252,7 @@ describe('avatar inspector profile card (W10)', () => {
it('leaves no verified profile section behind when switching to a guest', async () => {
// Switching subjects overlaps two panels for the exit transition (220ms).
// Once it finishes, exactly one panel may remain, and a guest's panel must
- // carry no profile section — otherwise the previous player's identity is
+ // carry no profile section, otherwise the previous player's identity is
// still on screen over an anonymous avatar.
routeApi();
openAvatarInspector({ kind: 'peer', name: 'Nick', username: 'nirholas' });