ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.
Python ai-agentsamdcomfyuidockerllama-cppllmlocal-ain8nnvidiaopen-webuiragself-hostedspeech-to-textstrix-halotext-to-speechworkflow-automation
Elf of Doom: endless loop, Hunter's Blessing and Gabriel
Mike Bradley3e3e04418b74
diff --git a/ods/CHANGELOG.md b/ods/CHANGELOG.mdindex 44edcc3fd..a4fed13c5 100644--- a/ods/CHANGELOG.md+++ b/ods/CHANGELOG.md@@ -307,6 +307,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).a long line of spaces.### Changed+- Elf of Doom no longer ends after realm 6: the six realms loop for as long+ as you survive, each circuit with 50% more enemies and 50% more boss+ health, every boss on realm 6's reinforcement timer from the second circuit+ on, and a victory panel that continues the run and turns bronze, silver,+ then gold. The Swift Draw boon is replaced by Hunter's Blessing, which+ doubles every arrow drop from then on (2x, 4x, 8x as it stacks), and the+ elf is now Gabriel with a new portrait. Portal made the changes from the+ owner's prompts, running Qwen3.8-Flash-Next on local hardware; the game+ files are exactly the ones https://odsspark.com/game/ serves. An install+ that already has `Playground/elf-of-doom` keeps its own copy.- Elf of Doom gives more arrows: slain enemies drop a 6-arrow quiver 20% ofthe time (was 18% for 3), and the timed supply drop gives 12 arrows every20 seconds (was 6), so boss-fight reinforcements no longer outrun the arrowdiff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/README.md b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/README.mdindex 537cb334e..8eeb00f44 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/README.md+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/README.md@@ -4,6 +4,14 @@ A small dungeon crawler that runs in your browser. You play an elf archer:clear each arena of brutes, grab hearts and quivers, level up, and fightthrough six realms to Mount Cinderfall.+The quest never really ends. Break the Hollow Crown and the six realms fold+back on themselves: every circuit brings 50% more foes at every spawn, bosses+with 50% more health, and realm-6 reinforcement timers from the very first+boss of the loop. The reinforcement clock never goes faster than realm 6's,+no matter how deep you get. The victory panel appears after each circuit with+a Continue button, and its colour deepens each time - bronze, silver, gold,+and gold from then on.+## Play itIn Portal's sidebar, open Projects, then Playground, then elf-of-doom. The@@ -13,7 +21,8 @@ keyboard.- Arrow keys or WASD: move. You shoot the way you last moved.- Space: shoot. Hold it to keep shooting.- 1, 2, 3: choose a boon when you level up.-- Esc or P: pause. Enter: start or retry. M: mute.+- Esc or P: pause. Enter: start or retry, or continue the quest at a victory+ panel. M: mute.Clicking outside the game pauses it. The game is plain HTML, CSS andJavaScript and needs no internet connection, so you can also opendiff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/chars.js b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/chars.jsindex dae476f9d..33f53969f 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/chars.js+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/chars.js@@ -1,8 +1,8 @@// Elf of Doom — characters (cartoon canvas art)"use strict";-// ---------- hero: Faelar Brightarrow with elven bow -----------function drawFaelar(g, p, time) {+// ---------- hero: Gabriel with elven bow ----------+function drawElf(g, p, time) {const s = p.face; // 1 right, -1 leftconst moving = p.moving;const legs = moving ? legSwing(time, .022) : [0, 0];diff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/engine.js b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/engine.jsindex 273253090..f80a93d85 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/engine.js+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/engine.js@@ -34,12 +34,22 @@ addEventListener("keydown", e => {// M mutes from anywhere, so the title-screen control list is accurateif (k === "m") { AudioSys.muted = !AudioSys.muted; const mb = $("mute-btn"); if (mb) mb.textContent = AudioSys.muted ? "🔇" : "🔊"; }// 1/2/3 pick a boon on the level-up panel (main row and numpad)- if (G.state === "levelup" && (k === "1" || k === "&" || k === "2" || k === "@" || k === "3" || k === "#")) {+ // G.state is "over" while any modal panel is up, so the boon shortcut has to be gated on the+ // level-up screen itself. Without this, pressing 1/2/3 on the quest-victory panel ran the boon+ // picker against the old boon list, clicked a stale button, and started a fresh game mid-panel.+ if (G.state === "levelup" && document.getElementById("screen-levelup") &&+ !document.getElementById("screen-levelup").classList.contains("hidden") &&+ (k === "1" || k === "&" || k === "2" || k === "@" || k === "3" || k === "#")) {const idx = (k === "1" || k === "&") ? 0 : (k === "2" || k === "@") ? 1 : 2;if (typeof boonKeySelect === "function") boonKeySelect(idx);return;}- if (k === "enter" && (G.state === "title" || G.state === "over" || G.state === "win")) startGame();+ // Enter on the quest panel continues the endless run (matching its Continue button) rather than+ // throwing away a deep run to restart. Every other end state still starts a fresh game.+ if (k === "enter") {+ if (G.state === "winstate") { if (typeof continueQuest === "function") continueQuest(); return; }+ if (G.state === "title" || G.state === "over" || G.state === "win") startGame();+ }});addEventListener("keyup", e => { const k = e.key.toLowerCase(); keys[k] = false; if (k === "j" || k === " ") slashHeld = false; });// Losing focus must STOP the game, not just drop the keys. Previously only the key state was@@ -61,7 +71,13 @@ const PERKS = [{ ico: "🎯", nm: "Keen Eye", ds: "+25% draw speed", apply: s => { s.atkDur *= .75; s.atkCd *= .75; } },{ ico: "❤️", nm: "Sylvanic Hardbread", ds: "+25 max HP, heal full", apply: s => { s.maxHp += 25; s.hp = s.maxHp; } },{ ico: "🩸", nm: "Hunter's Vigor", ds: "Heal 3 HP per kill", apply: s => s.lifesteal += 3 },- { ico: "🏹", nm: "Swift Draw", ds: "+20% fire rate", apply: s => { s.atkCd *= 0.8; } },+ // "Hunter's Blessing" replaced "Swift Draw" (+20% fire rate), which stacked with Keen Eye into+ // a generic rate-up nobody had to think about. This one is a trade: you give up the HP, damage+ // and speed options for one pick, and every quiver you pick up from then on is worth double.+ // ammoSec doubles per pick (x2, x4, x8...), so 6-arrow drops become 12 then 24 then 48. It is a+ // multiplier on *drops*, not on the quiver: it never refills anything by itself, so it only pays+ // out if you actually walk over to the supplies, and it does nothing at all in a wave with no drops.+ { ico: "🦌", nm: "Hunter's Blessing", ds: "Quivers found are worth double — stacks ×2, ×4, ×8", apply: s => { s.ammoSec = Math.max(1, s.ammoSec | 0) * 2; } },{ ico: "🏹", nm: "Double Shot", ds: "Loose 2 arrows per shot", apply: s => s.multi += 1 },];@@ -73,6 +89,9 @@ function resetHero() {hp: 50, maxHp: 50, lvl: 1, xp: 0, xpNext: Math.round(XP_BASE * XP_REQUIREMENT_SCALE), dmg: 22, spd: 205,drawT: 0, atkT: 0, atkDur: 0.26, atkCd: 0.32, atkCdT: 0, multi: 1,invuln: 0, lifesteal: 0,+ // Hunter's Blessing multiplier on arrow drops. 1 = no blessing; each pick doubles it. Reset+ // here so a new run never inherits the last run's blessing (same reason lifesteal is reset).+ ammoSec: 1,arrows: 24, maxArrows: 24, hitFx: 0, shootAng: 0, webT: 0,});BOON_QUEUE = 0; // a new run must never inherit picks left over from the last one (window global)@@ -110,8 +129,12 @@ function startZone() {// the generation path - saw a half-populated arena. A missing or non-callable method then threw// "D.nearestFloor is not a function" from steerAround on the first brute that wedged against a// pillar, so a single bad realm build became per-frame update failures for the rest of the run.- const fresh = genArena(G.zone);- fresh.baked = bakeArena(fresh, G.zone, Math.floor(Math.random() * 1e9));+ // Endless loop: the arena layout is chosen by realmIndex(), so realm 7 is a fresh realm-1 hall+ // rather than an out-of-range ZONES lookup. genArena's obstacle seed stays on the raw zone, so+ // each circuit still gets its own arrangement of pillars.+ const lay = realmIndex(G.zone);+ const fresh = genArena(lay);+ fresh.baked = bakeArena(fresh, lay, Math.floor(Math.random() * 1e9));if (!(fresh.RW > 0 && fresh.RH > 0 && fresh.wpx > 0 && fresh.hpx > 0) ||!isFinite(fresh.wpx) || !isFinite(fresh.hpx) ||!fresh.spawn || !isFinite(fresh.spawn.x) || !isFinite(fresh.spawn.y) ||@@ -149,19 +172,23 @@ function startZone() {}for (let i = 0; i < 4; i++) {const s = D.farSpot(P.x, P.y, 210, 16);- G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: 6, t: Infinity, bob: rand(0, 6) });+ G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: arrowDrop(6), t: Infinity, bob: rand(0, 6) });}spawnWave();- announce(ZONES[G.zone].name, "Faelar draws his bow…");+// realmIndex() again: past the first circuit G.zone is >= 6 and this lookup would be undefined.+announce(ZONES[realmIndex(G.zone)].name, "Gabriel draws his bow…");}function spawnWave() {- const z = ZONES[G.zone];+ const z = ZONES[realmIndex(G.zone)];G.waveNum = (G.waveNum || 0) + 1;// +30% roster size (ROSTER_SCALE). The old 22 cap was set against the *pre-scale* curve, where// it only bound at about 14.7 raw; after scaling it clamped nearly every mid/late wave and// silently cancelled the increase (zone 5 wave 4 stayed at 22). Raised to 30 so the increase// lands, while keeping a hard ceiling: crowd rasterisation and AI are what caused the stalls.- const n = Math.min(30, (6 + G.zone + G.waveNum + randi(0, 2)) * 1.5 * ROSTER_SCALE | 0);+ // The loop multiplier is applied *outside* that ceiling on purpose. In loop 1 it is exactly 1,+ // so the shipped curve is untouched; in deeper loops the crowd keeps growing past 30 instead+ // of the +50% being silently eaten by the clamp, which is the whole point of the endless mode.+ const n = Math.min(30, (6 + G.zone + G.waveNum + randi(0, 2)) * 1.5 * ROSTER_SCALE | 0) * loopEnemyMul(loopNumber(G.zone)) | 0;for (let i = 0; i < n; i++) spawnEnemy(pick(z.enemies));if (G.waveNum > 1) announce("Wave " + G.waveNum, "More brutes pour into the hall");// replenish supplies each wave. Each call resolves independently against candidates spread@@ -174,7 +201,7 @@ function spawnWave() {}for (let i = 0; i < 2; i++) {const s = D ? D.farSpot(P.x, P.y, 200, 16) : { x: P.x - rand(140, 340), y: P.y - rand(120, 280) };- G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: 6, t: Infinity, bob: rand(0, 6) });+ G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: arrowDrop(6), t: Infinity, bob: rand(0, 6) });}updateHud();}@@ -183,8 +210,10 @@ function spawnWave() {// untouched. Capped against a smaller ceiling than a normal wave because this lands on top of// the boss and its escort rather than replacing them - the crowd is what caused the frame stalls.function spawnReinforceWave(isFinal) {- const z = ZONES[G.zone];- const n = Math.min(14, (6 + G.zone + (G.waveNum || 1) + randi(0, 2)) * 1.5 * ROSTER_SCALE | 0);+ const z = ZONES[realmIndex(G.zone)];+ // Same treatment as a normal wave: loop scaling lands outside the ceiling, and the boss clock+ // itself is never accelerated past realm 6 — the reinforcement just arrives in bigger packs.+ const n = Math.min(14, (6 + G.zone + (G.waveNum || 1) + randi(0, 2)) * 1.5 * ROSTER_SCALE | 0) * loopEnemyMul(loopNumber(G.zone)) | 0;for (let i = 0; i < n; i++) spawnEnemy(pick(z.enemies));announce(isFinal ? "The Hollow Crown calls for aid!" : "Reinforcements!", "More brutes pour into the hall");G.shake = Math.max(G.shake, 5);@@ -211,12 +240,17 @@ function spawnEnemy(kind) {return G.enemies[G.enemies.length - 1];}function spawnBoss() {- const z = ZONES[G.zone], bs = BOSS_STATS[z.boss.kind];+ const z = ZONES[realmIndex(G.zone)], bs = BOSS_STATS[z.boss.kind];G.wave = "boss";const spot = D ? D.farSpot(P.x, P.y, 320, bs.r + 6) : { x: DW - 240, y: DH / 2 };+ // +50% boss HP per completed loop. The loop term replaces the old per-zone term for the boss:+ // realm 6 was already the shipped difficulty peak, and multiplying a growing zone term by a+ // growing loop term would compound two curves at once. One loop factor keeps each circuit+ // exactly 1.5x the last.+ const bossHp = bs.hp * 2 * BOSS_HP_SCALE * (z.boss.kind === "fenris" ? WOLF_HP_SCALE : 1) * loopBossHpMul(loopNumber(G.zone));const e = {kind: z.boss.kind, boss: true, name: z.boss.name,- x: spot.x, y: spot.y, hp: bs.hp * 2 * BOSS_HP_SCALE * (z.boss.kind === "fenris" ? WOLF_HP_SCALE : 1), maxHp: bs.hp * 2 * BOSS_HP_SCALE * (z.boss.kind === "fenris" ? WOLF_HP_SCALE : 1),+ x: spot.x, y: spot.y, hp: bossHp, maxHp: bossHp,// Bosses were scaling their minions but not themselves: ENEMY_SPEED_SCALE doubled the wave// while a boss still walked at its raw BOSS_STATS.spd, so Skarnax crawled next to pack hounds and// the Hollow Crown trailed the brutes summoned around him. Same dial, so a boss keeps its@@ -228,13 +262,15 @@ function spawnBoss() {G.enemies.push(e); G.boss = e;// Boss fights must never stall into a quiet duel: a fresh wave arrives on a timer so pressure// is continuous. The final boss halves the interval. Reset here so each boss owns its own clock.- G.bossReinT = (z.boss.kind === FINAL_BOSS_KIND ? FINAL_BOSS_REINFRESH_S : BOSS_REINFRESH_S);+ // From loop 2 on, every boss gets realm 6's aggressive cadence (see bossReinIntervalS). That+ // interval is the floor: deeper loops add bulk and pack size, never a shorter clock.+ G.bossReinT = bossReinIntervalS(z.boss.kind, loopNumber(G.zone));// escort of brutes storms in with the boss so it can't be kited from range;// staggered with a spark flare as each one arrives- const escort = Math.min(12, 6 + G.zone * 2);+ const escort = Math.min(12, 6 + G.zone * 2) * loopEnemyMul(loopNumber(G.zone)) | 0;G.escorts = [];for (let i = 0; i < escort; i++) {- const e = spawnEnemy(pick(ZONES[G.zone].enemies));+ const e = spawnEnemy(pick(ZONES[realmIndex(G.zone)].enemies));if (e) {const when = .25 + i * .14;G.escorts.push({ e, t: when, life: when });@@ -252,7 +288,7 @@ function spawnBoss() {}for (let i = 0; i < 1; i++) {const s = D ? D.farSpot(e.x, e.y, 220, 16) : { x: e.x - rand(140, 300), y: e.y - rand(120, 260) };- G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: 10, t: Infinity, bob: rand(0, 6) });+ G.pickups.push({ x: s.x, y: s.y, kind: "arrows", val: arrowDrop(10), t: Infinity, bob: rand(0, 6) });}bossWrap.classList.remove("hidden"); $("boss-name").textContent = e.name;AudioSys.bossRoar();@@ -318,9 +354,23 @@ function dropPickup(x, y, kind, val) {}if (!ok) { const s = D.freeSpot(x, y, 26, 14); px = s.x; py = s.y; }}+ // Blessing is applied at drop time, not at pickup time, so the number that pops over the+ // quiver and the number that lands in the quiver are always the same number.+ if (kind === "arrows") { val = arrowDrop(val); }G.pickups.push({ x: px, y: py, kind, val, t: 20, bob: rand(0, 6) });}+// ---------- Hunter's Blessing ----------+// Single place where a quiver's value is resolved, so every arrow source in the game respects the+// blessing and none of them can double-apply it. Integer shift keeps 6 -> 12 -> 24 -> 48 exact+// without floating-point drift, and the 9999 cap exists only so a pathological number of picks+// cannot produce Infinity in the HUD; that cap is a sanity guard, not balance.+const ARROW_DROP_CAP = 9999;+function arrowDrop(n) {+ const m = Math.max(1, (typeof P !== "undefined" && P.ammoSec | 0) || 1);+ return Math.min(ARROW_DROP_CAP, (n | 0) * m);+}+// ---------- supply drops: never run dry ----------G.supplyT = 20;function supplyTick(dt) {@@ -339,7 +389,7 @@ function supplyTick(dt) {// each drop keeps TILE*2 from the item already placed, and - the part that actually mattered -// farSpot consults pickups already on the floor, which it did not before at all.const a = D.farSpot(P.x, P.y, 170, 16);- G.pickups.push({ x: a.x, y: a.y, kind: "arrows", val: 12, t: 45, bob: rand(0, 6) });+ G.pickups.push({ x: a.x, y: a.y, kind: "arrows", val: arrowDrop(12), t: 45, bob: rand(0, 6) });burst(a.x, a.y - 8, 5, "rgba(220,190,140,.7)", 60, .5, 3);const h = D.farSpot(a.x, a.y, 150, 16);G.pickups.push({ x: h.x, y: h.y, kind: "heart", val: 30, t: 45, bob: rand(0, 6) });@@ -452,4 +502,4 @@ function hurtHero(dmg, srcX, srcY) {function togglePause() {if (G.state === "play") { G.state = "pause"; showScreen("pause"); }else if (G.state === "pause") { G.state = "play"; showScreen(null); }-}\ No newline at end of file+}diff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/index.html b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/index.htmlindex 4cfa396eb..a6dae2075 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/index.html+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/index.html@@ -14,30 +14,113 @@<div id="hud" class="hidden"><div class="hud-left"><div class="hero-badge">- <div class="hero-emoji"><svg viewBox="0 0 40 40" width="46" height="46" aria-hidden="true">- <!-- Faelar: fair skin and long blond hair under a slim circlet. The previous art- used green skin, pig ears and a brown horned helm, which read as a brute. -->- <ellipse cx="20" cy="23" rx="11.5" ry="13" fill="#e8c39a" stroke="#3a2a1c" stroke-width="1.6"/>- <!-- long hair falling behind the shoulders -->- <path d="M8 20 Q5 34 11 38 L15 33 Q11 27 12 19 Z" fill="#e6cf82" stroke="#3a2a1c" stroke-width="1.5"/>- <path d="M32 20 Q35 34 29 38 L25 33 Q29 27 28 19 Z" fill="#e6cf82" stroke="#3a2a1c" stroke-width="1.5"/>- <!-- hair crown / fringe -->- <path d="M8.5 21 Q8 8 20 8 Q32 8 31.5 21 Q29 13 20 12.5 Q11 13 8.5 21 Z" fill="#f0dc93" stroke="#3a2a1c" stroke-width="1.5"/>- <!-- elven circlet with a small leaf gem -->- <path d="M9.5 17.5 Q20 13.5 30.5 17.5" fill="none" stroke="#d9bd63" stroke-width="1.8"/>- <circle cx="20" cy="14.6" r="1.7" fill="#7fd6a0" stroke="#3a2a1c" stroke-width="1"/>- <!-- eyes, brows, nose, mouth -->- <ellipse cx="15.8" cy="22.5" rx="1.7" ry="1.3" fill="#2c4a6b"/>- <ellipse cx="24.2" cy="22.5" rx="1.7" ry="1.3" fill="#2c4a6b"/>- <path d="M13.8 19.6 Q15.8 18.6 17.6 19.5" fill="none" stroke="#b99b57" stroke-width="1.2" stroke-linecap="round"/>- <path d="M22.4 19.5 Q24.2 18.6 26.2 19.6" fill="none" stroke="#b99b57" stroke-width="1.2" stroke-linecap="round"/>- <path d="M20 23.5 L19.2 26.4 Q20 27.1 20.9 26.5" fill="none" stroke="#c49a72" stroke-width="1.1" stroke-linecap="round"/>- <path d="M17.2 29.6 Q20 31.2 22.8 29.6" fill="none" stroke="#a9695c" stroke-width="1.5" stroke-linecap="round"/>- <!-- shoulder line of the elven cloak -->- <path d="M7 40 Q20 32 33 40" fill="#3f6b4f" stroke="#3a2a1c" stroke-width="1.5"/>+ <div class="hero-emoji"><svg viewBox="-7 -4 78 60" width="68" height="52" shape-rendering="geometricPrecision" role="img" aria-label="Gabriel, male elven archer">+ <!-- Gabriel, male elven archer. The previous pass went cartoon: open grin with teeth,+ arched brows, blush and freckles made him read as a joker. He is killing waves of+ monsters, so this pass keeps the cockiness and takes the comedy out of it: the mouth+ is now a closed one-sided smirk, the brows are heavier and set lower with a slight+ inward drive for determination, eyes are shallower and half-lidded with a smaller+ brighter iris, and the ahoge, freckles and blush are gone in favour of an undercut+ and a flipped ponytail. Still blond (#fff0b0 / #f7d96c / #e8c24a, shadow #d0a633);+ the only brown is the leather guard and the warm ink #46300f. -->+ <defs>+ <linearGradient id="gabHair" x1="0" y1="0" x2=".25" y2="1">+ <stop offset="0" stop-color="#fff0b0"/>+ <stop offset=".5" stop-color="#f7d96c"/>+ <stop offset="1" stop-color="#e8c24a"/>+ </linearGradient>+ <radialGradient id="gabFace" cx=".42" cy=".3" r=".85">+ <stop offset="0" stop-color="#ffd9b0"/>+ <stop offset=".62" stop-color="#eeb98a"/>+ <stop offset="1" stop-color="#d69867"/>+ </radialGradient>+ <linearGradient id="gabCloak" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stop-color="#4e8a66"/>+ <stop offset="1" stop-color="#27503a"/>+ </linearGradient>+ <radialGradient id="gabIris" cx=".4" cy=".3" r=".82">+ <stop offset="0" stop-color="#6fb4dd"/>+ <stop offset=".55" stop-color="#2f72a6"/>+ <stop offset="1" stop-color="#143c5f"/>+ </radialGradient>+ <linearGradient id="gabGold" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stop-color="#ffe9a0"/>+ <stop offset="1" stop-color="#cf9c33"/>+ </linearGradient>+ <radialGradient id="gabGem" cx=".35" cy=".3" r=".8">+ <stop offset="0" stop-color="#a9e8bd"/>+ <stop offset="1" stop-color="#2c8e58"/>+ </radialGradient>+ <clipPath id="gabFaceClip">+ <path d="M17 30 Q17 13 32 13 Q47 13 47 30 L47 38.5 Q47 48 41 53.5 Q36.5 57 32 57 Q27.5 57 23 53.5 Q17 48 17 38.5 Z"/>+ </clipPath>+ </defs>+ <!-- hair mass behind the head, swept back into an undercut with a flipped tail -->+ <path d="M12.5 28 Q8 3 32 2 Q56 3 51.5 28 Q51.5 17 48.5 13.5 Q53.5 11 54.5 6.5 Q48.5 8 44.5 11.5 Q39 7.5 32 7.5 Q25 7.5 19.5 11.5 Q12.5 17 12.5 28 Z" fill="url(#gabHair)" stroke="#46300f" stroke-width="1.45" stroke-linejoin="round"/>+ <!-- undercut: short-shaved sideburn on both sides, darker than the mass above it -->+ <g clip-path="url(#gabFaceClip)">+ <path d="M17 26 Q19.5 31 18.8 37 L17 37 Z" fill="#c99f2e" opacity=".5"/>+ <path d="M47 26 Q44.5 31 45.2 37 L47 37 Z" fill="#c99f2e" opacity=".5"/>+ </g>+ <!-- ponytail: pulled back and flipped, no curl -->+ <path d="M45 31 Q53.5 36 52.5 45 Q51.8 51 47 53.5 Q50.8 46.5 47.8 39.5 Q46.2 35.2 43 32 Z" fill="url(#gabHair)" stroke="#46300f" stroke-width="1.4" stroke-linejoin="round"/>+ <path d="M43.8 31.4 Q47.2 33.4 49.8 36.6" fill="none" stroke="url(#gabGold)" stroke-width="2.6" stroke-linecap="round"/>+ <!-- pointed elven ears, high and springy -->+ <path d="M18 29.5 L0 20.5 L17 40.5 Z" fill="#e7b384" stroke="#46300f" stroke-width="1.4" stroke-linejoin="round"/>+ <path d="M46 29.5 L64 20.5 L47 40.5 Z" fill="#e7b384" stroke="#46300f" stroke-width="1.4" stroke-linejoin="round"/>+ <path d="M15.4 28.2 L6 23.6" fill="none" stroke="#c98a5c" stroke-width="1.2" stroke-linecap="round"/>+ <path d="M48.6 28.2 L58 23.6" fill="none" stroke="#c98a5c" stroke-width="1.2" stroke-linecap="round"/>+ <!-- face: strong jaw, slightly narrowed mouth corner -->+ <path d="M17 30 Q17 13 32 13 Q47 13 47 30 L47 38.5 Q47 48 41 53.5 Q36.5 57 32 57 Q27.5 57 23 53.5 Q17 48 17 38.5 Z" fill="url(#gabFace)" stroke="#46300f" stroke-width="1.5"/>+ <!-- shading: form shadow on both sides and a jaw shadow, no blush -->+ <g clip-path="url(#gabFaceClip)">+ <ellipse cx="17.2" cy="34" rx="6.6" ry="18" fill="#c98a5c" opacity=".28"/>+ <ellipse cx="46.8" cy="34" rx="6.6" ry="18" fill="#c98a5c" opacity=".28"/>+ <path d="M22 50 Q32 58 42 50 L42 57 L22 57 Z" fill="#c98a5c" opacity=".22"/>+ </g>+ <!-- fringe: swept from his left to his right in three sharp sections, tips over the brow -->+ <path d="M16.5 26 Q15.5 12 32 11 Q48.5 12 47.5 26 L44.5 20 Q43.8 16 41 17.2 L36 23 L34 16.5 Q31 15 28 16.8 L25.5 22 L21.8 16.5 Q19.5 16.2 18.6 20.5 Z" fill="url(#gabHair)" stroke="#46300f" stroke-width="1.4" stroke-linejoin="round"/>+ <path d="M37.5 15.5 L32.5 22.5" fill="none" stroke="#d0a633" stroke-width="1.1" stroke-linecap="round"/>+ <path d="M27 15.8 L24.4 21" fill="none" stroke="#d0a633" stroke-width="1" stroke-linecap="round"/>+ <!-- single restrained crown highlight -->+ <path d="M22.5 16.5 Q32 11 41.5 16.5" fill="none" stroke="#fff6d2" stroke-width="1.4" stroke-linecap="round" opacity=".45"/>+ <!-- determined brows: heavy, low over the eyes, driven slightly inward -->+ <path d="M20.2 24.4 Q25 22 29.9 24.9" fill="none" stroke="#d0a633" stroke-width="2.6" stroke-linecap="round"/>+ <path d="M34.1 24.9 Q39 22 43.8 24.4" fill="none" stroke="#d0a633" stroke-width="2.6" stroke-linecap="round"/>+ <!-- eyes: shallower and half-lidded, a straight lower edge, gaze steady and off-centre -->+ <path d="M21.4 30 Q25.4 27.2 29.7 29.8 Q25.8 32.8 21.4 30 Z" fill="#fffdf4" stroke="#46300f" stroke-width=".8"/>+ <path d="M34.3 29.8 Q38.6 27.2 42.6 30 Q38.2 32.8 34.3 29.8 Z" fill="#fffdf4" stroke="#46300f" stroke-width=".8"/>+ <circle cx="26.2" cy="30.3" r="2.35" fill="url(#gabIris)"/>+ <circle cx="38.9" cy="30.3" r="2.35" fill="url(#gabIris)"/>+ <circle cx="26.3" cy="30.4" r="1.05" fill="#0c1822"/>+ <circle cx="39" cy="30.4" r="1.05" fill="#0c1822"/>+ <circle cx="25.3" cy="29.4" r=".8" fill="#fffefa"/>+ <circle cx="38" cy="29.4" r=".8" fill="#fffefa"/>+ <!-- upper lid line sits on the iris: that contact is what reads as focus -->+ <path d="M21 29.8 Q25.4 26.9 30.1 29.6" fill="none" stroke="#46300f" stroke-width="1.35" stroke-linecap="round"/>+ <path d="M33.9 29.6 Q38.6 26.9 43 29.8" fill="none" stroke="#46300f" stroke-width="1.35" stroke-linecap="round"/>+ <!-- under-eye line, faint: fatigue, not age -->+ <path d="M22.6 32.6 Q25.6 33.8 28.6 33" fill="none" stroke="#c98a5c" stroke-width=".85" stroke-linecap="round" opacity=".55"/>+ <path d="M35.4 33 Q38.4 33.8 41.4 32.6" fill="none" stroke="#c98a5c" stroke-width=".85" stroke-linecap="round" opacity=".55"/>+ <!-- small upturned nose -->+ <path d="M31.4 34.8 Q31 38.6 34 39.2" fill="none" stroke="#c98a5c" stroke-width="1.3" stroke-linecap="round"/>+ <!-- the smirk: closed, asymmetric, corner pulled up on his left only -->+ <path d="M24.2 45.4 Q29.6 46.8 34.4 45.6 Q37.6 44.7 40.2 41.4" fill="none" stroke="#46300f" stroke-width="1.6" stroke-linecap="round"/>+ <path d="M39.4 43.6 Q41.8 43.2 42.8 41.4" fill="none" stroke="#c98a5c" stroke-width="1" stroke-linecap="round" opacity=".85"/>+ <!-- brow scar, a short healed line on his right brow -->+ <path d="M23 20.6 L26.4 23.4" fill="none" stroke="#c07f57" stroke-width="1.1" stroke-linecap="round" opacity=".65"/>+ <!-- elven circlet with a leaf gem, worn over the fringe -->+ <path d="M18.6 22.4 Q32 16.6 45.4 22.4" fill="none" stroke="url(#gabGold)" stroke-width="1.7"/>+ <path d="M32 16 l2.5 3.9 -2.5 3.9 -2.5 -3.9 Z" fill="url(#gabGem)" stroke="#2a6144" stroke-width="1"/>+ <path d="M31.2 17.6 l1.1 1.6" fill="none" stroke="#eafff2" stroke-width=".8" stroke-linecap="round" opacity=".8"/>+ <!-- cloak collar along the bottom edge, gold clasp, leather strap over one shoulder -->+ <path d="M-7 63 Q-3 53 13 53 L51 53 Q67 53 71 63 Z" fill="url(#gabCloak)" stroke="#46300f" stroke-width="1.4" stroke-linejoin="round"/>+ <path d="M28 53 L32 59 L23 59 Z" fill="#eef3e6" stroke="#46300f" stroke-width="1.1"/>+ <path d="M45 53.5 Q56 55.5 64 61" fill="none" stroke="#7d5730" stroke-width="2.8" stroke-linecap="round"/>+ <circle cx="36" cy="55" r="1.8" fill="url(#gabGold)" stroke="#46300f" stroke-width=".85"/></svg></div><div class="hero-info">- <div class="hero-name">Faelar Brightarrow</div>+ <div class="hero-name">Gabriel</div><div class="bar hp-bar"><div id="hp-fill"></div><span id="hp-text">50/50</span></div><div class="bar xp-bar"><div id="xp-fill"></div><span id="xp-text">Lv 1</span></div></div>@@ -72,6 +155,7 @@<p class="subtitle">A dungeon crawler made with ODS on the RTX Spark</p><p class="lore">One elf. One bow. Endless brutes.<br>Run, draw, and loose arrows through great halls of the ashland — <b>grab hearts</b> to mend your wounds and <b>quivers</b> to keep your string singin', then loot, level, and outrun your way to the Cinderfall.</p>+ <p class="lore">Break the Hollow Crown and the realms <b>fold back on themselves</b>: every circuit of six brings <b>half again as many foes</b>, <b>hardier bosses</b> and <b>realm-6 reinforcements</b> from the first hall onward. The quest never ends — it is only ever a matter of how far Gabriel gets.</p><button id="btn-start" class="big-btn" type="button">🏹 Draw Your Bow</button><div class="controls-hint"><h3>Controls</h3>@@ -84,7 +168,7 @@<li>Clicking away from the game pauses it automatically</li></ul><div class="controls-objective">- Clear every brute in the arena to open the way onward — <b>6 realms</b>, each with its own boss, then <b>Mount Cinderfall</b> and the Hollow Crown.+ Clear every brute in the arena to open the way onward — <b>6 realms</b>, each with its own boss, then <b>Mount Cinderfall</b> and the Hollow Crown. Fall the Crown and <b>Continue</b> into the next circuit: more brutes, tougher bosses, faster reinforcements — forever.</div></div><div class="title-footer">@@ -112,13 +196,14 @@</div></div>- <!-- Victory -->+ <!-- Victory / circuit checkpoint. Re-shown after every six realms with a metal tier that+ deepens each loop (bronze → silver → gold); its button continues the endless run. --><div id="screen-win" class="screen hidden"><div class="panel">- <h2>🌋 The Quest is Done!</h2>- <p class="panel-sub">The Hollow Crown is broken, and the elven realms begin their long twilight.</p>+ <h2 id="win-title">🌋 The Quest is Done!</h2>+ <p class="panel-sub" id="win-sub">The Hollow Crown is broken, and the elven realms begin their long twilight.</p><div id="win-stats" class="over-stats"></div>- <button id="btn-again" class="big-btn" type="button">↻ Play Again</button>+ <button id="btn-again" class="big-btn" type="button">➤ Continue the Quest</button></div></div>diff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/legacy.js b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/legacy.jsindex 237232ce1..22ca98d72 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/legacy.js+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/legacy.js@@ -80,7 +80,9 @@ function drawProp(g, kind, x, y, time) {// path seeded a deterministic RNG from x/y. That offset double image is why the firelight never// lined up with the fire pits. Only the live-animated kinds (web, torch) are drawn dynamically.if (kind === "brazier") return;- const z = ZONES[(typeof G !== "undefined" && G) ? G.zone : 0] || ZONES[0];+ // G.zone counts up through the endless loop (realm 7 is index 6), so it has to be wrapped back+ // into ZONES or this lookup returns undefined past the first circuit.+ const z = ZONES[(typeof G !== "undefined" && G) ? realmIndex(G.zone) : 0] || ZONES[0];g.save(); g.translate(x, y);// Seeded from the prop's own position, so the same pile draws identically every frame. This was// Math.random(), which re-rolled every fragment and skull 60 times a second - the rock pilesdiff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/style.css b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/style.cssindex 5bbbc12ab..ac0283703 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/style.css+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/style.css@@ -12,6 +12,11 @@ html, body { height: 100%; background: #050303; overflow: hidden; font-family: ".hud-left { display: flex; flex-direction: column; gap: 8px; }.hero-badge { display: flex; gap: 10px; align-items: center; background: linear-gradient(180deg, rgba(24,12,8,.8), rgba(10,4,3,.85)); border: 1px solid rgba(200,150,70,.4); border-radius: 6px; padding: 8px 14px 8px 8px; box-shadow: 0 4px 14px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,200,120,.12); }.hero-emoji { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.8)); }+/* The hero badge portrait is inline SVG, not an emoji glyph: font-size does not size it. Setting+ both dimensions keeps it from growing to fill the flex line, and shape-rendering is also set on+ the element itself for engines that ignore the CSS property. The viewBox is a wide crop (76x57)+ because the badge is mostly face, so the box follows that aspect: 68x52 rather than a square. */+.hero-emoji svg { display: block; width: 68px; height: 52px; shape-rendering: geometricPrecision; }.hero-info { min-width: 190px; }.hero-name { color: #e8c27a; font-weight: bold; font-size: 13px; letter-spacing: .5px; text-shadow: 0 1px 2px #000; margin-bottom: 4px; font-variant: small-caps; }.bar { position: relative; height: 14px; border-radius: 4px; background: rgba(0,0,0,.75); border: 1px solid rgba(180,140,80,.35); overflow: hidden; margin-bottom: 5px; box-shadow: inset 0 2px 6px rgba(0,0,0,.8); }@@ -199,3 +204,47 @@ h1 {#arrow-label { color: #dfe9ff; font-size: 13px; letter-spacing: 1px; text-shadow: 0 1px 2px #000; margin-top: 3px; font-weight: bold; }#arrow-label.low-ammo { color: #ff8a5e; animation: ammoPulse 1s infinite; }@keyframes ammoPulse { 50% { opacity: .45; } }++/* ---------- quest-victory tiers for the endless loop ----------+ The victory panel reappears after every circuit of six realms. Its metal deepens per loop —+ bronze (the as-shipped look, deliberately a no-op), then silver, then gold — by recolouring the+ panel frame, title, stat chips and the Continue button together. The base .panel/.big-btn+ styling stays the bronze default, so loop 1 is byte-identical to before. */+#screen-win .panel.victory-silver {+ background: linear-gradient(180deg, rgba(24,27,34,.96), rgba(8,10,14,.98));+ border-color: rgba(206,216,232,.5);+ box-shadow: 0 0 70px rgba(180,200,225,.24), 0 20px 60px rgba(0,0,0,.8), inset 0 1px 0 rgba(232,240,250,.16);+}+#screen-win .panel.victory-silver h2 {+ color: #e6ecf6;+ text-shadow: 0 0 22px rgba(206,220,240,.65), 0 2px 3px #000;+}+#screen-win .panel.victory-silver .panel-sub { color: #cfd8e6; }+#screen-win .panel.victory-silver .over-stats .chip {+ background: rgba(200,215,235,.12); border-color: rgba(206,216,232,.42); color: #e8eef8;+}+#screen-win .panel.victory-silver #btn-again.big-btn {+ color: #f6f9ff;+ background: linear-gradient(180deg, #6d7787, #2f3541);+ border-color: #c3cede;+ box-shadow: 0 6px 0 #1d222b, 0 12px 26px rgba(0,0,0,.75), inset 0 1px 0 rgba(240,246,255,.34);+}+#screen-win .panel.victory-gold {+ background: linear-gradient(180deg, rgba(34,24,7,.96), rgba(13,8,2,.98));+ border-color: rgba(255,203,88,.62);+ box-shadow: 0 0 84px rgba(255,176,40,.3), 0 20px 60px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,226,150,.2);+}+#screen-win .panel.victory-gold h2 {+ color: #ffd45f;+ text-shadow: 0 0 26px rgba(255,196,60,.75), 0 2px 3px #000;+}+#screen-win .panel.victory-gold .panel-sub { color: #f3dcae; }+#screen-win .panel.victory-gold .over-stats .chip {+ background: rgba(255,203,88,.14); border-color: rgba(255,203,88,.5); color: #ffe9b8;+}+#screen-win .panel.victory-gold #btn-again.big-btn {+ color: #2b1c02;+ background: linear-gradient(180deg, #ffd45f, #b07a10);+ border-color: #ffe9a6; text-shadow: 0 1px 0 rgba(255,240,190,.5);+ box-shadow: 0 6px 0 #5c3d05, 0 12px 28px rgba(0,0,0,.75), 0 0 26px rgba(255,203,88,.45), inset 0 1px 0 rgba(255,246,205,.5);+}diff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/ui.js b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/ui.jsindex b008b2497..c5317355c 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/ui.js+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/ui.js@@ -135,7 +135,7 @@ function aiDue(i) { return (i % AI_SLICE) === _aiCursor; }// but the crowd's inward drive from enemyAI runs every single frame while the push that answers it// ran on the same 1-in-6 stagger: attraction 6x/6, repulsion 1x/6. Under a swarm the brutes and hounds// therefore converge on a shared overlap at the hero and never recover, which is the "they melt into-// one stacked heap around Faelar" report. The per-entity work in the separation pass is a bucket+// one stacked heap around Gabriel" report. The per-entity work in the separation pass is a bucket// lookup plus a handful of cheap comparisons -- far cheaper than the LOS and path work the AI slice// exists to ration -- so the crowd pass now runs against every enemy every frame. Only the expensive// AI passes stay sliced.@@ -365,7 +365,7 @@ const SEP_NEAR = [];function enemySeparation() {const list = G.enemies;SEP.reset();- // Hero body radius for separation, in the same units as e.r. Faelar's drawn body is about 11 px+ // Hero body radius for separation, in the same units as e.r. Gabriel's drawn body is about 11 px// wide, plus the hero art's 2 px stroke half-width, so ~13 px is his real footprint - the same// 12-16 px the rest of the codebase treats him as (hurtHero knocks him back with moveEnt(P, 12, …)// and spawns clear him with a 16 px radius). The pack used to push only against each other, which@@ -668,7 +668,7 @@ function update(dt) {if (G.waveTimer > 2.2) {G.waveTimer = 0;if ((G.waveNum || 0) < 2) spawnWave();- else { G.wave = "preboss"; G.waveTimer = 2.2; announce("A presence stirs…", ZONES[G.zone].boss.name + " approaches"); }+ else { G.wave = "preboss"; G.waveTimer = 2.2; announce("A presence stirs…", ZONES[realmIndex(G.zone)].boss.name + " approaches"); }}} else if (G.wave === "fight") { G.waveTimer = 0; } else if (G.wave === "preboss") {G.waveTimer -= dt; if (G.waveTimer <= 0) spawnBoss();@@ -679,17 +679,23 @@ function update(dt) {// Guarded on the boss being alive, so a boss killed on the same frame as a timer expiry// cannot spawn a wave into the "cleared" celebration.if (G.boss) {- G.bossReinT = (G.bossReinT === undefined ? BOSS_REINFRESH_S : G.bossReinT) - dt;+ // The fallback on a missing clock also honours the loop rule, so a boss that somehow starts+ // without an explicit timer still gets realm-6 pacing in loop 2+ instead of the slow one.+ const reinLoop = loopNumber(G.zone);+ G.bossReinT = (G.bossReinT === undefined ? bossReinIntervalS(G.boss.kind, reinLoop) : G.bossReinT) - dt;if (G.bossReinT <= 0) {const final = G.boss.kind === FINAL_BOSS_KIND;- G.bossReinT = final ? FINAL_BOSS_REINFRESH_S : BOSS_REINFRESH_S;+ G.bossReinT = bossReinIntervalS(G.boss.kind, reinLoop);spawnReinforceWave(final);}}} else if (G.wave === "cleared") {G.waveTimer += dt;if (G.waveTimer > 3.4) {- if (G.zone >= ZONES.length - 1) { gameOver(true); }+ // Finishing realm 6 completes a circuit: the quest panel opens as it always did, but its+ // button now continues into the next, harder loop instead of restarting the game. The run+ // only ever truly ends when Gabriel falls, so the endless game is "how far can you go".+ if (realmIndex(G.zone) >= REALM_COUNT - 1) { questVictory(); }else { continueJourney(); }}}@@ -768,6 +774,9 @@ function update(dt) {if (dr < 26) {pk.t = 0;if (pk.kind === "gold") { G.gold += pk.val; AudioSys.coin(); popText(P.x, P.y - 66, "+" + pk.val + " 🪙", "#ffd76b"); }+ // pk.val is already blessing-scaled — every arrow source resolves its value through+ // arrowDrop() at drop time — so the pickup adds it as-is. Multiplying here too would apply+ // the blessing twice, which is exactly the bug class this comment exists to prevent.else if (pk.kind === "arrows") { P.arrows += pk.val; AudioSys.loot(); popText(P.x, P.y - 66, "+" + pk.val + " arrows", "#dfe9ff"); }else { P.hp = Math.min(P.maxHp, P.hp + pk.val); AudioSys.potion(); popText(P.x, P.y - 66, "+" + pk.val + " HP", "#7dff8a"); }updateHud();@@ -842,7 +851,7 @@ function hexToRgb(h) {// It used to be 2R+4 wide with the gradient at (R+2, R+2). Those two agree with each other, so// the gradient was still dead-centre in its own canvas, but every caller subtracted only R+2,// leaving the centre 4px right and 4px below the point it was supposed to light - the uniform-// "lights lined up by their top-left corner" offset on Faelar and every fire pit alike. The+// "lights lined up by their top-left corner" offset on Gabriel and every fire pit alike. The// magnitude was constant because it came from the sprite padding, not from any per-light position,// which is why nothing was fixed by nudging the hero/brazier anchor values earlier.// The +4 pad was never load-bearing: the gradient reaches alpha 0 at radius R and the arc is@@ -950,7 +959,7 @@ try {// The warm torch wash is keyed "__warm" at its build site, and the cache lookup there is by that// same key, so the prewarm has to use it too. It used to prewarm under key "255,168,74", which no// caller ever reads: the expensive 800px rasterisation still landed on the first frame that showed- // Faelar, which is the hitch this block exists to prevent.+ // Gabriel, which is the hitch this block exists to prevent.if (!GLOW_hero.__warm) GLOW_hero.__warm = glowSpritePair(WARM_TORCH, HERO_GLOW_R, .13, [[.2, "rgba(" + WARM_TORCH + ",.1)"], [.5, "rgba(" + WARM_TORCH + ",.05)"], [.78, "rgba(" + WARM_TORCH + ",.017)"], [1, "rgba(" + WARM_TORCH + ",0)"]], .038);} catch (ePrewarm) { /* falls back to lazy build */ }// The hit-flash sprite cache that used to live here is gone with the flash. glowSpriteWhite had no@@ -982,7 +991,7 @@ function vignetteSprite(w, h) {const x = c.getContext("2d");if (!x) return _VIG = null;const rg = x.createRadialGradient(w * .5, h * .5, 0, w * .5, h * .5, Math.max(w, h) * .72);- // Fully clear core, so nothing films over the middle where Faelar and the fires are doing the+ // Fully clear core, so nothing films over the middle where Gabriel and the fires are doing the// work. Stops are explicit because a default 0-alpha start and a 1-alpha end would darken the// entire viewport, which is the haze this is meant to replace.// Clear core, so nothing washes the middle where the hero and the fires are doing the work.@@ -1004,7 +1013,9 @@ function renderBase() {g.lineCap = "butt"; g.lineJoin = "miter"; g.lineWidth = 1;g.imageSmoothingEnabled = true;if (G.shake > 0) g.translate(G.shX || 0, G.shY || 0);- const zc = (ZONES[clamp(G.zone | 0, 0, ZONES.length - 1)] || ZONES[0]).wall;+ // clamp() kept the old six-realm game in range; with the endless loop the zone index has to be+ // wrapped with realmIndex() or every circuit past the first picks the last realm's palette.+ const zc = (ZONES[realmIndex(G.zone)] || ZONES[0]).wall;// solid backdrop: if a draw call throws mid-frame, the screen shows stone, never a// canvas-wide gradient fill (the old "whole screen turns one solid colour" bug)g.fillStyle = typeof zc === "string" ? zc : "#241f24"; g.fillRect(0, 0, W, H);@@ -1092,7 +1103,7 @@ function _lightPass(g) {// Corner falloff over the light mask. The veil is a per-light mask, and in a large hall it can// leave the far corners only veil-dark, which reads as a flat evenly-lit plane instead of a// torchlit room. This is a blit of the cached offscreen gradient, not a coloured fillRect on the- // visible canvas, and it is fully transparent across the middle, so it cannot film over Faelar+ // visible canvas, and it is fully transparent across the middle, so it cannot film over Gabriel// or the fires the way a screen-wide ambient lift does.try {const vig = vignetteSprite(W, H);@@ -1109,7 +1120,7 @@ function renderWorld(g) {// arena backdrop (fallback fill if nothing is baked)if (D) {- g.fillStyle = ZONES[clamp(G.zone | 0, 0, ZONES.length - 1)].floor;+ g.fillStyle = ZONES[realmIndex(G.zone)].floor;g.fillRect(0, 0, D.wpx, D.hpx);}@@ -1144,7 +1155,7 @@ function renderWorld(g) {// Sorting on the raw floor line is right for entities of comparable height and wrong for a// 200 px boss: Skarnax's feet sit at his own y, while the elf standing "just above" him has a// slightly smaller y and therefore painted *last*, i.e. on top of the boss's whole body. What- // the owner saw was Faelar completely hidden behind Skarnax's flank even though he is standing+ // the owner saw was Gabriel completely hidden behind Skarnax's flank even though he is standing// north of him. The comparison has to use the feet line of whatever is actually being painted:// a tall sprite whose visible mass is well above its origin should not occlude a smaller entity// that is genuinely further from the camera. So each entity sorts on its own baseline (y), and@@ -1205,12 +1216,12 @@ function renderOverlay(g) {// drawn from the feet up (body near -24, head near -45), so a halo centred on P.y hung// below him and read as a glow off to the bottom-right. Shake is applied by the world// pass, so re-add it here or the light detaches from him while the screen shakes.- // Anchor on Faelar's visual centre. drawFaelar is drawn feet-up from P.y: body ellipse centred+ // Anchor on Gabriel's visual centre. drawElf is drawn feet-up from P.y: body ellipse centred// about -10 (spanning -30..10) and head about -28, so the sprite occupies roughly y-38..y+10// and its centre is ~-14. The old -26/-27 put the bright core on his chest while his sprite// centre sat lower, so the glow looked detached from him.const hx = P.x - G.camX + (G.shX || 0), hy = P.y - G.camY - 14 + (G.shY || 0);- const warm = (ZONES[clamp(G.zone | 0, 0, ZONES.length - 1)].accent) || "#ffaa50";+ const warm = (ZONES[realmIndex(G.zone)].accent) || "#ffaa50";// halo pass: cached sprite blits only. No createRadialGradient and no full-viewport// fill here - a gradient built and rasterised every frame was a large part of the cost// in big fights, and "lighter" combined with any screen-covering fill is what made the@@ -1294,13 +1305,19 @@ function renderBanners(g) {}const pulse2 = .6 + Math.sin(G.t * 5) * .3;g.fillStyle = `rgba(255,205,84,${pulse2})`; g.font = "bold 15px 'Trebuchet MS'"; g.textAlign = "center";- g.fillText("➡ Onward to " + (G.zone >= ZONES.length - 1 ? "the Cinderfall" : ZONES[Math.min(G.zone + 1, ZONES.length - 1)].name), W / 2, H - 26);+ // Past realm 6 the next realm wraps to the start of the circuit, so the sign points at realm 1+ // (or names the crossing when this is the last realm before the quest panel).+ const nextIdx = realmIndex(G.zone) + 1;+ const onward = nextIdx >= REALM_COUNT+ ? "the next circuit of " + REALM_COUNT + " realms"+ : ZONES[nextIdx].name;+ g.fillText("➡ Onward to " + onward, W / 2, H - 26);}- // aim reticle showing where Faelar is shooting+ // aim reticle showing where Gabriel is shootingif (G.state === "play") {// `|| 0` here coerced a legitimate PI (aim-left) to 0 via string truthiness, snapping the- // reticle onto Faelar instead of to his left. Aim now defaults to the direction he is facing.+ // reticle onto Gabriel instead of to his left. Aim now defaults to the direction he is facing.const sa = Number.isFinite(P.shootAng) ? P.shootAng : (P.face >= 0 ? 0 : Math.PI);const ax = P.x - G.camX + Math.cos(sa) * 110, ay = P.y - G.camY - 16 + Math.sin(sa) * 110;g.save(); g.globalAlpha = .5 + Math.sin(G.t * 6) * .15;@@ -1544,7 +1561,7 @@ const MOTES = Array.from({ length: 46 }, (_, i) => ({sp: 6 + (i % 7) * 3.5, sway: 10 + (i % 9) * 4, ph: i * .7,}));function drawMotes(g) {- const z = ZONES[G.zone], c = z.accent || "#cbb89a";+ const z = ZONES[realmIndex(G.zone)], c = z.accent || "#cbb89a";const hot = !!z.lava;g.save();g.globalCompositeOperation = "lighter";@@ -1566,7 +1583,7 @@ function drawHeroEnt(g, time) {shadow(g, P.x, P.y, 16);// hero: always fully opaque (a stray globalAlpha anywhere must never be able to hide him)g.save(); g.globalAlpha = 1; g.translate(P.x, P.y);- try { drawFaelar(g, P, time); } catch (err) {+ try { drawElf(g, P, time); } catch (err) {// visible emergency elf: the hero must never be invisible because of a draw faultg.globalAlpha = 1;g.fillStyle = "#5f9a52"; g.beginPath(); g.ellipse(0, -10, 14, 20, 0, 0, TAU); g.fill();@@ -1753,8 +1770,10 @@ function updateHud() {const wl = HUDc.wl;const wt = G.boss ? "⚔ Boss battle!" : G.wave === "fight" ? "Foes: " + G.enemies.length : G.wave === "preboss" ? "Brace yourself…" : "Path clear — keep moving!";if (wl.__v !== wt) { wl.textContent = wt; wl.__v = wt; }- const zoneIdx = Math.min(G.zone + 1, ZONES.length);- const zl = HUDc.zl, zt = (G.zone + 1) + "/" + ZONES.length + " · " + ZONES[G.zone].name;+ // Realm number is the position inside the circuit, so it reads 1..6 forever; the loop is only+ // shown once the player has gone past the first six realms.+ const lp = loopNumber(G.zone);+ const zl = HUDc.zl, zt = (realmIndex(G.zone) + 1) + "/" + REALM_COUNT + " · " + ZONES[realmIndex(G.zone)].name + (lp > 1 ? " · Loop " + lp : "");if (zl.__v !== zt) { zl.textContent = zt; zl.__v = zt; }}@@ -1814,11 +1833,67 @@ function continueJourney() {showScreen(null); G.state = "play";}+/* The quest panel at the end of a circuit of six realms. It used to be a terminal "you win"+ screen wired to Play Again; now it is a checkpoint. The same panel appears every time all six+ realms fall, its button reads Continue and the run goes on into the next loop, so the only end+ is dying. Each successive circuit gets a more precious metal for the panel and button: bronze+ (as shipped), silver, gold, and gold from then on. */+function questVictory() {+ // "winstate" (not "win") so the Enter shortcut can tell a checkpoint apart from a real game+ // over, and so nothing that treats "over" as "this run is finished" counts a checkpoint as one.+ G.state = "winstate";+ hud.classList.add("hidden"); bossWrap.classList.add("hidden");+ const clearedLoops = loopNumber(G.zone); // circuits completed, counting this one+ const tier = VICTORY_TIERS[victoryTierIndex(clearedLoops)];+ const mins = Math.floor(G.elapsed / 60), secs = Math.floor(G.elapsed % 60);+ const winPanel = document.querySelector("#screen-win .panel");+ if (winPanel) winPanel.classList.remove("victory-bronze", "victory-silver", "victory-gold");+ if (winPanel) winPanel.classList.add(tier.cls);+ const h = $("win-title");+ if (h) {+ h.textContent = clearedLoops <= 1+ ? "🌋 The Quest is Done!"+ : "🌋 The Quest is Done — Again!";+ }+ const sub = $("win-sub");+ if (sub) {+ sub.textContent = clearedLoops <= 1+ ? "The Hollow Crown is broken, and the elven realms begin their long twilight."+ : `${tier.name} proof of it: ${clearedLoops} circuits of the six realms cleared. The realms reshape themselves behind Gabriel, and the shadow re-forms ahead — braver, bolder, and thicker than before.`;+ }+ $("win-stats").innerHTML =+ `<span class="chip">🪙 Gold: ${G.gold}</span>` ++ `<span class="chip">💀 Slain: ${G.kills}</span>` ++ `<span class="chip">⭐ Level ${P.lvl}</span>` ++ `<span class="chip">🗺️ ${REALM_COUNT}/${REALM_COUNT} realms · Circuit ${clearedLoops}</span>` ++ `<span class="chip">⏱️ ${mins}m ${secs}s</span>`;+ const btn = $("btn-again");+ if (btn) btn.textContent = "➤ Continue — Circuit " + (clearedLoops + 1);+ AudioSys.win();+ showScreen("win");+}++// Continue from the quest panel: straight on into the next loop at realm 1. Everything the player+// earned carries over — level, boons, gold, quiver — only the crowd and the bosses get tougher.+function continueQuest() {+ clearPendingShots();+ if (typeof AI_GEN === "number") AI_GEN++; // same bookkeeping startGame() does for pending shots+ const winPanel = document.querySelector("#screen-win .panel");+ if (winPanel) winPanel.classList.remove("victory-bronze", "victory-silver", "victory-gold");+ G.zone++; // crosses into the next circuit; realmIndex() wraps to realm 1+ G.enemies = []; G.projectiles = []; G.pickups = []; G.boss = null; G.escorts = [];+ G.particles.length = 0; G.texts.length = 0;+ bossWrap.classList.add("hidden");+ startZone(); updateHud();+ showScreen(null); G.state = "play";+}+function gameOver(win) {G.state = "over";hud.classList.add("hidden"); bossWrap.classList.add("hidden");const mins = Math.floor(G.elapsed / 60), secs = Math.floor(G.elapsed % 60);- const stats = `<span class="chip">🪙 Gold: ${G.gold}</span><span class="chip">💀 Slain: ${G.kills}</span><span class="chip">⭐ Level ${P.lvl}</span><span class="chip">🗺️ Realm ${Math.min(G.zone + 1, ZONES.length)}/${ZONES.length}</span><span class="chip">⏱️ ${mins}m ${secs}s</span>`;+ const lp = loopNumber(G.zone);+ const stats = `<span class="chip">🪙 Gold: ${G.gold}</span><span class="chip">💀 Slain: ${G.kills}</span><span class="chip">⭐ Level ${P.lvl}</span><span class="chip">🗺️ Realm ${realmIndex(G.zone) + 1}/${REALM_COUNT}${lp > 1 ? " · Loop " + lp : ""}</span><span class="chip">⏱️ ${mins}m ${secs}s</span>`;if (win) {AudioSys.win();$("win-stats").innerHTML = stats;@@ -1839,7 +1914,9 @@ function gameOver(win) {// ---------- buttons ----------$("btn-start").addEventListener("click", startGame);$("btn-retry").addEventListener("click", startGame);-$("btn-again").addEventListener("click", startGame);+// The victory button continues the endless run rather than restarting it. It is reached only from+// the quest panel, which questVictory() raises, so Continue is always the right verb here.+$("btn-again").addEventListener("click", continueQuest);$("btn-resume").addEventListener("click", togglePause);diff --git a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/world.js b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/world.jsindex 3a160bd25..41437e941 100644--- a/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/world.js+++ b/ods/extensions/services/pixel-agent/example-projects/elf-of-doom/world.js@@ -98,7 +98,7 @@ const WEB_SLOW_T = 2.2;// everything the lights do not reach.//// Tuned back toward the old look after the mask overshot. A 330px pool in a ~1100x700 hall left a-// small lit disc around Faelar and murky edges everywhere else, i.e. a fog-of-war instead of a+// small lit disc around Gabriel and murky edges everywhere else, i.e. a fog-of-war instead of a// torchlit hall. Three dials, all deliberately weaker than they were:// HERO_GLOW_R - reach of his light. Wider than a screen would lift the whole arena flat; a// little over half the viewport width reads as one torch in a room.@@ -124,7 +124,7 @@ const LIGHT_DARK = .40; // opacity of the shadow over unlit floor// alpha is (LIGHT_DARK - LIGHT_AMB). It is kept above 0 only so a huge hall never goes fully// black where no torch can ever reach.const LIGHT_AMB = .03; // ceiling on that shadow: the darkest unlit floor keeps this much-// 1.0 in the very centre is what bleached Faelar and his immediate surroundings: the mask fully+// 1.0 in the very centre is what bleached Gabriel and his immediate surroundings: the mask fully// erased the shadow there, so the additive warm pass landed on unshadowed stone. .74 leaves about// a quarter of the veil under him, which is what keeps his cloak, hair and the floor under his// boots deep while still reading as "the light is coming from him".@@ -136,6 +136,43 @@ const BOSS_REINFRESH_S = 60;const FINAL_BOSS_REINFRESH_S = 30;const FINAL_BOSS_KIND = "hollowcrown";+/* ---------- endless quest: the six realms repeat forever ----------+ Clearing realm 6 no longer ends the run. The quest-victory panel still appears, its button+ now reads Continue, and the next realm is realm 1 again with:+ · +50% more enemies at every spawn (wave, boss escort, boss reinforcements),+ · +50% more boss health,+ · boss reinforcements already on the realm-6 cadence from the first boss of the loop.+ Realm 6's interval is the ceiling forever: deeper loops raise crowd size and boss bulk only,+ never the clock. Enemy damage and ordinary wave-enemy HP stay at their loop values, so no+ loop becomes instantly lethal — the pressure is numbers and a 1.5x-bulk boss, not a one-hit+ wall.+ Loop 1 multiplies by exactly 1, so a first pass plays as it always did. */+const REALM_COUNT = 6; // realms per loop: always 1..6+const LOOP_ENEMY_SCALE = 1.5; // x1.5 foes per completed loop+const LOOP_BOSS_HP_SCALE = 1.5; // x1.5 boss HP per completed loop+// G.zone keeps counting upward (0, 1, 2 ...) and is never wrapped, so one value encodes both the+// layout played and how deep the loop is. realmIndex() picks the ZONES entry; loopNumber() is 1+// on the first pass, 2 after the first full circuit, and so on.+function realmIndex(zone) { return ((zone | 0) % REALM_COUNT); }+function loopNumber(zone) { return Math.floor((zone | 0) / REALM_COUNT) + 1; }+function loopEnemyMul(loop) { return Math.pow(LOOP_ENEMY_SCALE, Math.max(0, (loop | 0) - 1)); }+function loopBossHpMul(loop) { return Math.pow(LOOP_BOSS_HP_SCALE, Math.max(0, (loop | 0) - 1)); }+// Boss-reinforcement cadence for a realm/loop pair. From loop 2 on every boss — not just the+// Hollow Crown — uses the fast realm-6 interval, and that interval is never shortened further.+function bossReinIntervalS(kind, loop) {+ return (kind === FINAL_BOSS_KIND || (loop | 0) > 1) ? FINAL_BOSS_REINFRESH_S : BOSS_REINFRESH_S;+}+// Quest-victory panel tier, one step per completed circuit: as-shipped bronze, then silver, then+// gold. Deeper loops keep the gold treatment rather than inventing new metals.+const VICTORY_TIERS = [+ { name: "Bronze", cls: "victory-bronze" },+ { name: "Silver", cls: "victory-silver" },+ { name: "Gold", cls: "victory-gold" },+];+function victoryTierIndex(completedLoops) {+ return clamp((completedLoops | 0) - 1, 0, VICTORY_TIERS.length - 1);+}+// ---------- loot rarity ----------const RARITY = {common: { name: "Common", color: "#cfc4b0", mul: 1 },@@ -254,4 +291,4 @@ function shadowBlob(g, x, y, r) {g.fillStyle = gr;g.beginPath(); g.ellipse(x, y, r, r * .45, 0, 0, TAU); g.fill();}-function legSwing(t, speed) { const p = t * speed; return [Math.sin(p) * 5, Math.sin(p + Math.PI) * 5]; }\ No newline at end of file+function legSwing(t, speed) { const p = t * speed; return [Math.sin(p) * 5, Math.sin(p + Math.PI) * 5]; }diff --git a/ods/installers/lib/pixel-example-projects.py b/ods/installers/lib/pixel-example-projects.pyindex 24a6b87ea..b0f019ce1 100644--- a/ods/installers/lib/pixel-example-projects.py+++ b/ods/installers/lib/pixel-example-projects.py@@ -55,15 +55,15 @@ RENAME_EXCL = 0x4# files are exactly the bytes published at https://odsspark.com/game/.EXAMPLES = {'elf-of-doom': {- 'README.md': 'a7d4e1a0d6ac4e3477d17b4f3de4a42ff4f3da998e36d0c9450d57875abe8944',- 'chars.js': '161b08c8a331fef5f09ac45e6ade2cff62e03316ba7c6ac197adf8147af629db',+ 'README.md': '8e46f14d7566c21328c7f9131b5028ffe826be7c2e6e3ca404074b95d1d178f6',+ 'chars.js': 'bcd13d1ab63cfbc89822269af9ae31dbbfbfade1d7323d8560e98b1765075fd4','dungeon.js': '80dfc2e0517cb89bce4f445d75e6a85a4a9c2317893a6762d87666b5b136004c',- 'engine.js': 'f50a91ae535f3d0f91e0f632f956babcfedaf3f423d351c31e12186fe13e3663',- 'index.html': 'af1c8b2b0a9f4e3ec4f5c6389078cf0b3a187a53badd451006ce24b737fd9906',- 'legacy.js': '0d33ded8670f4113f47baba1325ed52247305cbb9a0c92271aa7c8ef0c498165',- 'style.css': 'e063614db72fbc5c607bd4c79d4e2e967a0e5deceb3962f0a50f045e55197ee9',- 'ui.js': '5d0138ba4517d812359d4dd474f6febccf4dc703870412234a092cf8a04ef7f1',- 'world.js': 'b783175e2514607383a1f70e7b444bad5448f0cfc6d70915e9f2bf07a2ece4a7',+ 'engine.js': '28d1834030d568facac7e3b99ac781a41daeb2c9b78d8275710bb2e0604f2c98',+ 'index.html': '20225cbbb4076b2915fbc7efc039eea4f2b553e0f5bf4f9fd93c1e053502d4c3',+ 'legacy.js': '41957b2172491e3c11bdc805124ad3f7df7b9eedf5547e627596dc82f244d719',+ 'style.css': '2364f00be5b34cde47d4ba83a73daabc8118f8c2163ffcb2206e4092557f9a6d',+ 'ui.js': 'bedf4836a067eece5f52d2a7490e80c4ba89d898d170e2f5c443b7aa2aa7962b',+ 'world.js': '66f98f14ef4c99002d4c5dbe14f0f4e8107327570b7fc6973688f4f36bb9c8c0',},}PINNED_NAMES = frozenset(name for files in EXAMPLES.values() for name in files)diff --git a/ods/tests/test_pixel_example_projects.py b/ods/tests/test_pixel_example_projects.pyindex cb31d12c2..bf095b16a 100644--- a/ods/tests/test_pixel_example_projects.py+++ b/ods/tests/test_pixel_example_projects.py@@ -39,14 +39,14 @@ MACOS_INSTALLER = ROOT / 'installers/macos/install-macos.sh'# The game files as Portal wrote them and https://odsspark.com/game/ serves# them. This second pin means changing the game takes two deliberate edits.PUBLISHED = {- 'chars.js': '161b08c8a331fef5f09ac45e6ade2cff62e03316ba7c6ac197adf8147af629db',+ 'chars.js': 'bcd13d1ab63cfbc89822269af9ae31dbbfbfade1d7323d8560e98b1765075fd4','dungeon.js': '80dfc2e0517cb89bce4f445d75e6a85a4a9c2317893a6762d87666b5b136004c',- 'engine.js': 'f50a91ae535f3d0f91e0f632f956babcfedaf3f423d351c31e12186fe13e3663',- 'index.html': 'af1c8b2b0a9f4e3ec4f5c6389078cf0b3a187a53badd451006ce24b737fd9906',- 'legacy.js': '0d33ded8670f4113f47baba1325ed52247305cbb9a0c92271aa7c8ef0c498165',- 'style.css': 'e063614db72fbc5c607bd4c79d4e2e967a0e5deceb3962f0a50f045e55197ee9',- 'ui.js': '5d0138ba4517d812359d4dd474f6febccf4dc703870412234a092cf8a04ef7f1',- 'world.js': 'b783175e2514607383a1f70e7b444bad5448f0cfc6d70915e9f2bf07a2ece4a7',+ 'engine.js': '28d1834030d568facac7e3b99ac781a41daeb2c9b78d8275710bb2e0604f2c98',+ 'index.html': '20225cbbb4076b2915fbc7efc039eea4f2b553e0f5bf4f9fd93c1e053502d4c3',+ 'legacy.js': '41957b2172491e3c11bdc805124ad3f7df7b9eedf5547e627596dc82f244d719',+ 'style.css': '2364f00be5b34cde47d4ba83a73daabc8118f8c2163ffcb2206e4092557f9a6d',+ 'ui.js': 'bedf4836a067eece5f52d2a7490e80c4ba89d898d170e2f5c443b7aa2aa7962b',+ 'world.js': '66f98f14ef4c99002d4c5dbe14f0f4e8107327570b7fc6973688f4f36bb9c8c0',}WARNING = 'WARN: Portal is ready, but ODS could not add its Elf of Doom example project: '# Not a Discord invite: tests/test-help-links.sh rejects any other invite.