JavaScript must be enabled to play.
Browser lacks capabilities required to play.
Upgrade or switch to another browser.
Loading…
<div id="game"></div> <<script>> Game.noiseCount = 0; Game.reverseMode = false; Game.grassRoles = null; Game.riverLastBandOrder = null; Game.riverOrderBag = null; Game.toggleTimeMode = function () { Game.timeMultiplier = (Game.timeMultiplier === 1) ? 1.5 : 1; const label = document.getElementById("time-mode-label"); if (label) label.textContent = (Game.timeMultiplier === 1.5) ? "Extended Time: ON" : "Extended Time: OFF"; }; const timeLabel = (Game.timeMultiplier === 1.5) ? "Extended Time: ON" : "Extended Time: OFF"; const waypointCount = 5; let waypointsSvg = ""; for (let i = 0; i < waypointCount; i += 1) { const x = 20 + (i / waypointCount) * 220; waypointsSvg += '<circle cx="' + x + '" cy="20" r="5" fill="rgba(255,255,255,0.35)" />'; } Game.render( '<style>' + '@keyframes dotPulse {' + '0%, 100% { opacity: 0.6; r: 6; }' + '50% { opacity: 1; r: 8; }' + '}' + '.you-marker {' + 'animation: dotPulse 1.6s ease-in-out infinite;' + '}' + '.time-toggle-tag {' + 'position: absolute;' + 'top: 16px;' + 'right: 16px;' + 'font-size: 11px;' + 'padding: 5px 10px;' + 'border: 1px solid rgba(255,255,255,0.35);' + 'border-radius: 12px;' + 'background: rgba(255,255,255,0.05);' + 'color: rgba(255,255,255,0.75);' + 'cursor: pointer;' + 'z-index: 30;' + 'letter-spacing: 0.5px;' + '}' + '.time-toggle-tag:hover {' + 'background: rgba(255,255,255,0.15);' + '}' + '</style>' + '<div class="scene mtw-start">' + '<div class="time-toggle-tag" onclick="Game.toggleTimeMode()">' + '<span id="time-mode-label">' + timeLabel + '</span>' + '</div>' + '<div class="center-message" style="gap: 10px;">' + '<div class="title title-glow" style="position:static; margin-bottom: 4px; font-size: 44px; letter-spacing: 8px;">MOVE THE WORLD</div>' + '<svg width="300" height="40" viewBox="0 0 300 40" style="margin: 4px auto; display: block;">' + '<line x1="20" y1="20" x2="280" y2="20" stroke="rgba(255,255,255,0.25)" stroke-width="2" stroke-dasharray="4,5" />' + waypointsSvg + '<circle class="you-marker" cx="20" cy="20" r="6" fill="white" />' + '<text x="280" y="27" text-anchor="middle" font-size="22">\uD83D\uDC3B</text>' + '</svg>' + '<div style="letter-spacing: 3px; line-height: 1.4; opacity: 0.85; font-size: 20px; font-weight: bold; margin-top: 8px; margin-bottom: 8px;">' + 'CAN\'T GO OVER IT.<br>CAN\'T GO UNDER IT.' + '</div>' + '<button class="btn mtw-begin" onclick="Game.go(\'Grass\')">CLICK TO BEGIN →</button>' + '</div>' + '<div class="mtw-start-credit">RICH SCHICCATANO · SCHICCATANO.COM</div>' + '</div>' ); <</script>> <<silently>>[[Grass]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "GRASS", duration: 22000, build: function (scene) { const reverse = Game.reverseMode; const positions = [25, 38, 50, 62, 75]; if (!document.getElementById("grass-intro-kf")) { const styleTag = document.createElement("style"); styleTag.id = "grass-intro-kf"; styleTag.textContent = "@keyframes youDotWalkIn { 0% { opacity: 0; transform: translate(-50%,20px); } 40% { opacity: 1; transform: translate(-50%,0); } 75% { opacity: 1; } 100% { opacity: 0; } }" + "@keyframes bladeIntroPulse { 0%,100% { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); } 50% { filter: drop-shadow(0 0 14px rgba(255,255,255,0.8)); } }"; document.head.appendChild(styleTag); } const horizonGlimpse = document.createElement("div"); horizonGlimpse.style.position = "absolute"; horizonGlimpse.style.left = "0"; horizonGlimpse.style.right = "0"; horizonGlimpse.style.top = "30%"; horizonGlimpse.style.height = "18%"; horizonGlimpse.style.background = "linear-gradient(rgba(140,150,120,0.25), rgba(140,150,120,0))"; horizonGlimpse.style.zIndex = "1"; horizonGlimpse.style.opacity = "0"; horizonGlimpse.style.transition = "opacity 1.2s ease"; scene.appendChild(horizonGlimpse); const caveSilhouette = document.createElement("div"); caveSilhouette.style.position = "absolute"; caveSilhouette.style.left = "50%"; caveSilhouette.style.top = "32%"; caveSilhouette.style.width = "44px"; caveSilhouette.style.height = "30px"; caveSilhouette.style.transform = "translate(-50%,-50%)"; caveSilhouette.style.borderRadius = "50% 50% 45% 45% / 70% 70% 30% 30%"; caveSilhouette.style.background = "radial-gradient(circle, #000000 55%, rgba(0,0,0,0) 100%)"; caveSilhouette.style.boxShadow = "0 0 12px 3px rgba(90,110,130,0.15)"; caveSilhouette.style.zIndex = "1"; caveSilhouette.style.opacity = "0"; caveSilhouette.style.transition = "opacity 1.2s ease"; scene.appendChild(caveSilhouette); requestAnimationFrame(function () { setTimeout(function () { horizonGlimpse.style.opacity = "1"; caveSilhouette.style.opacity = "1"; }, 200); setTimeout(function () { horizonGlimpse.style.opacity = "0"; caveSilhouette.style.opacity = "0"; }, 2200); }); let roles; if (Game.grassRoles) { roles = Game.grassRoles; } else { roles = ["decoy", "decoy", "toppleable", "toppleable", "final-blocker"]; for (let i = roles.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); const tmp = roles[i]; roles[i] = roles[j]; roles[j] = tmp; } Game.grassRoles = roles; } let unlocked = false, cleared = false; const toppledSet = new Set(); let finalBlade = null; const toppleableBlades = []; const allBlades = []; function makeBlade(x, cls) { const g = document.createElement("div"); g.className = "grass " + cls; g.style.left = x + "%"; g.style.animationDuration = (2.2 + Math.random() * 1.2) + "s"; g.style.animationDelay = (Math.random() * -2) + "s"; g.style.animation += ", bladeIntroPulse 0.7s ease-in-out 2"; scene.appendChild(g); return g; } function toppleFall(blade, e) { const rect = blade.getBoundingClientRect(); const localX = e.clientX - rect.left; const direction = (localX < rect.width / 2) ? "left" : "right"; blade.classList.remove("ready"); blade.classList.add("fallen-" + direction); if (Game.Sound) Game.Sound.tick(); } function isFallen(b) { return b.classList.contains("fallen-left") || b.classList.contains("fallen-right"); } function shakeRefuse(blade) { blade.classList.add("disturbed"); setTimeout(function () { blade.classList.remove("disturbed"); }, 300); } function attachDecoy(blade) { const ant1 = document.createElement("div"); ant1.className = "ant ant-a"; ant1.textContent = "\uD83D\uDC1C"; const ant2 = document.createElement("div"); ant2.className = "ant ant-b"; ant2.textContent = "\uD83D\uDC1C"; blade.appendChild(ant1); blade.appendChild(ant2); blade.addEventListener("pointerdown", function () { if (isFallen(blade)) return; shakeRefuse(blade); }); } function finishGrass() { cleared = true; const remaining = allBlades.filter(function (b) { return !isFallen(b); }); remaining.forEach(function (b, idx) { setTimeout(function () { b.classList.remove("ready"); b.classList.add(idx % 2 === 0 ? "fallen-left" : "fallen-right"); }, idx * 160); }); const totalWait = remaining.length * 160 + 650; setTimeout(function () { if (reverse) { Game.advanceDirect("Win", 0); } else { Game.advance("River"); } }, totalWait); } positions.forEach(function (x, i) { const role = roles[i]; const blade = makeBlade(x, role); allBlades.push(blade); if (role === "decoy") { attachDecoy(blade); } else if (role === "toppleable") { toppleableBlades.push(blade); } else if (role === "final-blocker") { finalBlade = blade; } }); if (!reverse) { toppleableBlades.forEach(function (blade) { blade.addEventListener("pointerdown", function (e) { if (isFallen(blade)) return; toppleFall(blade, e); toppledSet.add(blade); if (!unlocked && toppledSet.size >= toppleableBlades.length) { unlocked = true; finalBlade.classList.add("ready"); } }); }); finalBlade.addEventListener("pointerdown", function (e) { if (cleared) return; if (!unlocked) { shakeRefuse(finalBlade); return; } toppleFall(finalBlade, e); finishGrass(); }); } else { finalBlade.addEventListener("pointerdown", function (e) { if (unlocked || cleared) return; toppleFall(finalBlade, e); unlocked = true; toppleableBlades.forEach(function (b) { b.classList.add("ready"); }); }); toppleableBlades.forEach(function (blade) { blade.addEventListener("pointerdown", function (e) { if (cleared) return; if (!unlocked) { shakeRefuse(blade); return; } if (isFallen(blade)) return; toppleFall(blade, e); toppledSet.add(blade); if (toppledSet.size >= toppleableBlades.length) { finishGrass(); } }); }); } } }); <</script>> <<silently>>[[River]][[Win]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "RIVER", duration: 19000, build: function (scene) { const reverse = Game.reverseMode; const EASE = { small: 0.5, medium: 0.22, large: 0.09 }; const HEIGHT_PCT = { small: 14, medium: 20, large: 27 }; const RIVER_TOP = 20; const order = reverse ? ["large", "medium", "small"] : ["small", "medium", "large"]; const ALL_PERMS = [ ["small","medium","large"], ["small","large","medium"], ["medium","small","large"], ["medium","large","small"], ["large","small","medium"], ["large","medium","small"] ]; function drawRiverOrder() { if (!Game.riverOrderBag || Game.riverOrderBag.length === 0) { let bag = ALL_PERMS.slice(); for (let i = bag.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); const tmp = bag[i]; bag[i] = bag[j]; bag[j] = tmp; } if (Game.riverLastBandOrder && bag.length > 1 && bag[0].join(",") === Game.riverLastBandOrder) { const tmp = bag[0]; bag[0] = bag[1]; bag[1] = tmp; } Game.riverOrderBag = bag; } const next = Game.riverOrderBag.shift(); Game.riverLastBandOrder = next.join(","); return next; } const shuffledSizes = drawRiverOrder(); const bands = {}; let cursor = RIVER_TOP; shuffledSizes.forEach(function (size) { const el = document.createElement("div"); el.className = "stream-band band-" + size; el.style.top = cursor + "%"; el.style.height = HEIGHT_PCT[size] + "%"; scene.appendChild(el); bands[size] = { el: el, top: cursor, height: HEIGHT_PCT[size] }; cursor += HEIGHT_PCT[size]; }); let expectedIndex = 0; const rockStartX = { small: 30, medium: 50, large: 70 }; const rocks = {}; ["small", "medium", "large"].forEach(function (size) { const el = document.createElement("div"); el.className = "river-rock rock-" + size; el.style.left = rockStartX[size] + "%"; el.style.top = "90%"; el.dataset.startX = rockStartX[size]; el.dataset.startY = 90; scene.appendChild(el); rocks[size] = el; attachDrag(el, size); }); function attachDrag(el, size) { let dragging = false; let targetX = parseFloat(el.style.left); let targetY = parseFloat(el.style.top); const ease = EASE[size]; let rafId = null; function updateTarget(e) { const rect = scene.getBoundingClientRect(); targetX = Math.max(4, Math.min(96, ((e.clientX - rect.left) / rect.width) * 100)); targetY = Math.max(4, Math.min(96, ((e.clientY - rect.top) / rect.height) * 100)); } function loop() { if (!dragging) { rafId = null; return; } const curX = parseFloat(el.style.left); const curY = parseFloat(el.style.top); el.style.left = (curX + (targetX - curX) * ease) + "%"; el.style.top = (curY + (targetY - curY) * ease) + "%"; rafId = requestAnimationFrame(loop); } el.addEventListener("pointerdown", function (e) { if (el.classList.contains("locked")) return; dragging = true; el.classList.add("lifted"); el.setPointerCapture(e.pointerId); updateTarget(e); if (!rafId) rafId = requestAnimationFrame(loop); }); el.addEventListener("pointermove", function (e) { if (!dragging) return; updateTarget(e); }); el.addEventListener("pointerup", function () { if (!dragging) return; dragging = false; el.classList.remove("lifted"); el.style.left = targetX + "%"; el.style.top = targetY + "%"; tryPlace(el, size); }); } function tryPlace(el, size) { const elY = parseFloat(el.style.top); let placed = false; Object.keys(bands).forEach(function (bandSize) { if (placed) return; const band = bands[bandSize]; if (elY >= band.top && elY <= band.top + band.height) { placed = true; if (bandSize === size && order.indexOf(size) === expectedIndex) { el.classList.add("locked"); if (Game.Sound) Game.Sound.tick(); el.style.top = (band.top + band.height / 2) + "%"; el.style.left = "50%"; band.el.classList.add("blocked"); expectedIndex++; if (expectedIndex >= order.length) { setTimeout(function () { Game.advance(reverse ? "Grass" : "Mud"); }, 600); } } else { Game.penalize(300); snapBack(el); } } }); if (!placed) snapBack(el); } function snapBack(el) { el.classList.add("snapping"); el.style.left = el.dataset.startX + "%"; el.style.top = el.dataset.startY + "%"; setTimeout(function () { el.classList.remove("snapping"); }, 350); } } }); <</script>> <<silently>>[[Mud]][[Grass]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "MUD", duration: 20000, build: function (scene) { const reverse = Game.reverseMode; scene.insertAdjacentHTML('beforeend', '<svg width="0" height="0" style="position:absolute">' + '<filter id="goo">' + '<feGaussianBlur in="SourceGraphic" stdDeviation="8" result="blur" />' + '<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo" />' + '<feBlend in="SourceGraphic" in2="goo" />' + '</filter>' + '</svg>' ); const mud = document.createElement("div"); mud.id = "mud"; mud.style.background = "linear-gradient(#6b4a2a, #241708)"; scene.appendChild(mud); const gooLayer = document.createElement("div"); gooLayer.className = "goo-layer"; mud.appendChild(gooLayer); const blob = document.createElement("div"); blob.className = "goo-blob"; blob.style.width = "56px"; blob.style.height = "48px"; blob.style.borderRadius = "58% 42% 47% 53% / 55% 48% 52% 45%"; blob.style.zIndex = "5"; gooLayer.appendChild(blob); const startY = reverse ? 14 : 86; const endY = reverse ? 86 : 10; let curY = startY; blob.style.top = curY + "%"; let dragging = false, lastY = null, lastTime = null, completed = false; let lastFlourish = 0; // Both journey directions progress from 0 to 100%. const RESISTANCE = 0.5; const SLIP_SPEED_THRESHOLD = 1.1; const SLIP_PENALTY = 250; const SLIP_LOSS_PCT = 8; function spawnDroplets(count) { for (let i = 0; i < count; i += 1) { const drop = document.createElement("div"); const dx = (Math.random() * 2 - 1) * 24; const dy = (Math.random() * 2 - 1) * 20; drop.style.position = "absolute"; drop.style.left = "50%"; drop.style.top = curY + "%"; drop.style.width = (3 + Math.random() * 3) + "px"; drop.style.height = (3 + Math.random() * 3) + "px"; drop.style.background = "#6b4a2a"; drop.style.borderRadius = "50%"; drop.style.zIndex = "5"; drop.style.transition = "transform .4s ease-out, opacity .4s ease-out"; gooLayer.appendChild(drop); requestAnimationFrame(function () { drop.style.transform = "translate(" + dx + "px, " + dy + "px)"; drop.style.opacity = "0"; }); setTimeout(function () { drop.remove(); }, 420); } } function spawnTrail() { const t = document.createElement("div"); t.className = "goo-trail"; t.style.top = curY + "%"; gooLayer.appendChild(t); setTimeout(function () { t.remove(); }, 550); } function showFlourish() { const line = document.createElement("div"); line.className = "squelch-line"; line.textContent = "Squelch squerch!"; if (Game.Sound) Game.Sound.tick(); line.style.top = (curY - 6) + "%"; scene.appendChild(line); setTimeout(function () { line.remove(); }, 900); } function maybeFlourish() { const progressPct = Math.round(Math.abs((curY - startY) / (endY - startY)) * 100); if (progressPct - lastFlourish >= 20) { lastFlourish = progressPct; showFlourish(); } } blob.addEventListener("pointerdown", function (e) { if (completed) return; dragging = true; lastY = e.clientY; lastTime = performance.now(); blob.setPointerCapture(e.pointerId); blob.classList.add("gripping"); }); blob.addEventListener("pointermove", function (e) { if (!dragging || completed) return; const rect = mud.getBoundingClientRect(); const now = performance.now(); const dt = now - lastTime; const dyPx = e.clientY - lastY; const speed = Math.abs(dyPx) / Math.max(dt, 1); if (speed > SLIP_SPEED_THRESHOLD) { dragging = false; blob.classList.remove("gripping"); blob.classList.add("slip"); Game.penalize(SLIP_PENALTY); curY = reverse ? Math.max(startY, curY - SLIP_LOSS_PCT) : Math.min(startY, curY + SLIP_LOSS_PCT); blob.style.top = curY + "%"; spawnDroplets(4); setTimeout(function () { blob.classList.remove("slip"); }, 300); return; } const dyPct = (dyPx / rect.height) * 100 * RESISTANCE; const lo = Math.min(startY, endY); const hi = Math.max(startY, endY); curY = Math.max(lo, Math.min(hi, curY + dyPct)); blob.style.top = curY + "%"; spawnTrail(); if (Math.random() < 0.3) spawnDroplets(1); maybeFlourish(); lastY = e.clientY; lastTime = now; const reached = reverse ? curY >= endY : curY <= endY; if (reached && !completed) { completed = true; blob.classList.add(reverse ? "submerged" : "escaped"); setTimeout(function () { Game.advance(reverse ? "River" : "Forest"); }, 600); } }); blob.addEventListener("pointerup", function () { dragging = false; blob.classList.remove("gripping"); }); } }); <</script>> <<silently>>[[Forest]][[River]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "FOREST", duration: 20000, build: function (scene) { const reverse = Game.reverseMode; scene.style.background = "linear-gradient(165deg, #16220f 0%, #0a1007 45%, #0d0906 75%, #1a120a 100%)"; const svgNS = "http://www.w3.org/2000/svg"; const rootSvg = document.createElementNS(svgNS, "svg"); rootSvg.setAttribute("viewBox", "0 0 400 300"); rootSvg.setAttribute("preserveAspectRatio", "none"); rootSvg.style.position = "absolute"; rootSvg.style.inset = "0"; rootSvg.style.width = "100%"; rootSvg.style.height = "100%"; rootSvg.style.pointerEvents = "none"; scene.appendChild(rootSvg); function drawTaperedBranch(x, y, angle, length, startWidth, endWidth, startOpacity, endOpacity, segments) { let curX = x, curY = y, curAngle = angle; for (let i = 0; i < segments; i += 1) { const t = i / segments; const segLen = length / segments; const bend = (Math.random() * 0.35 - 0.175); curAngle += bend; const nextX = curX + Math.sin(curAngle) * segLen; const nextY = curY + Math.cos(curAngle) * segLen; const w = startWidth + (endWidth - startWidth) * t; const o = startOpacity + (endOpacity - startOpacity) * t; const line = document.createElementNS(svgNS, "line"); line.setAttribute("x1", curX); line.setAttribute("y1", curY); line.setAttribute("x2", nextX); line.setAttribute("y2", nextY); line.setAttribute("stroke", "rgba(222,178,102," + o + ")"); line.setAttribute("stroke-width", Math.max(0.6, w)); line.setAttribute("stroke-linecap", "round"); rootSvg.appendChild(line); curX = nextX; curY = nextY; } return { x: curX, y: curY, angle: curAngle }; } function buildRoot(x, y, angle, length, width, depth, maxDepth) { if (depth > maxDepth) return; const opacityStart = Math.max(0.2, 0.65 - depth * 0.08); const opacityEnd = Math.max(0.15, opacityStart - 0.1); const widthEnd = width * 0.72; const segCount = 3 + depth; const end = drawTaperedBranch(x, y, angle, length, width, widthEnd, opacityStart, opacityEnd, segCount); if (depth < maxDepth) { const childCount = depth === 0 ? 2 : (Math.random() < 0.7 ? 2 : 1); for (let c = 0; c < childCount; c += 1) { const spread = (0.35 + Math.random() * 0.5) * (c === 0 ? 1 : -1) * (depth === 0 ? 1.4 : 1); buildRoot(end.x, end.y, end.angle + spread, length * 0.74, widthEnd, depth + 1, maxDepth); } } } buildRoot(200, 58, 0.35, 46, 5.5, 0, 6); buildRoot(200, 58, -0.35, 46, 5.5, 0, 6); buildRoot(200, 58, 0, 30, 4, 0, 5); const cover = document.createElement("div"); cover.style.position = "absolute"; cover.style.inset = "0"; scene.appendChild(cover); function dropIn(el, landXPct, landYPct, delayMs, durationMs) { el.style.left = landXPct + "%"; el.style.top = "-15%"; el.style.transition = "none"; requestAnimationFrame(function () { setTimeout(function () { el.style.transition = "top " + durationMs + "ms cubic-bezier(.3,.6,.4,1)"; el.style.top = landYPct + "%"; }, delayMs); }); } const LEAF_EMOJI = ["\uD83C\uDF42", "\uD83C\uDF41"]; if (!reverse) { const CLEAR_RADIUS = 55; const DRAG_START_THRESHOLD = 6; const leaves = []; const TOTAL_LEAVES = 55; for (let i = 0; i < TOTAL_LEAVES; i += 1) { const leaf = document.createElement("div"); leaf.textContent = LEAF_EMOJI[Math.floor(Math.random() * LEAF_EMOJI.length)]; leaf.style.position = "absolute"; leaf.style.fontSize = (18 + Math.random() * 14) + "px"; leaf.style.transform = "translate(-50%,-50%) rotate(" + (Math.random() * 360) + "deg)"; cover.appendChild(leaf); const landX = 4 + Math.random() * 92; const landY = 6 + Math.random() * 88; dropIn(leaf, landX, landY, i * 12, 500 + Math.random() * 300); leaves.push(leaf); } setTimeout(function () { leaves.forEach(function (leaf) { leaf.style.transition = "transform .35s ease, opacity .35s ease"; }); }, 1400); let cleared = 0, completed = false, pointerDown = false, dragging = false, downX = 0, downY = 0; function tryClear(clientX, clientY) { leaves.forEach(function (leaf) { if (leaf.dataset.cleared === "yes") return; const r = leaf.getBoundingClientRect(); const cx = r.left + r.width / 2; const cy = r.top + r.height / 2; const d = Math.hypot(clientX - cx, clientY - cy); if (d < CLEAR_RADIUS) { leaf.dataset.cleared = "yes"; leaf.style.transition = "transform .35s ease, opacity .35s ease"; leaf.style.transform = "translate(-50%,-50%) translate(" + (Math.random() * 80 - 40) + "px," + (60 + Math.random() * 40) + "px) rotate(" + (Math.random() * 360) + "deg)"; leaf.style.opacity = "0"; cleared += 1; if (Game.Sound) Game.Sound.tick(); } }); if (cleared >= leaves.length && !completed) { completed = true; setTimeout(function () { Game.advance("Snow"); }, 400); } } cover.addEventListener("pointerdown", function (e) { if (completed) return; pointerDown = true; dragging = false; downX = e.clientX; downY = e.clientY; }); cover.addEventListener("pointermove", function (e) { if (completed || !pointerDown) return; if (!dragging) { const dist = Math.hypot(e.clientX - downX, e.clientY - downY); if (dist < DRAG_START_THRESHOLD) return; dragging = true; } tryClear(e.clientX, e.clientY); }); cover.addEventListener("pointerup", function () { pointerDown = false; dragging = false; }); cover.addEventListener("pointercancel", function () { pointerDown = false; dragging = false; }); } else { const totalSpots = 6; const spots = []; const spotXs = [12, 28, 44, 60, 76, 90]; const CATCH_RADIUS_PCT = 22; spotXs.forEach(function (sx, i) { const landY = 15 + Math.random() * 70; const fp = document.createElement("div"); fp.textContent = "\uD83D\uDC63"; fp.style.position = "absolute"; fp.style.fontSize = "38px"; fp.style.transform = "translate(-50%,-50%) rotate(" + (Math.random() * 40 - 20) + "deg)"; fp.style.pointerEvents = "none"; cover.appendChild(fp); dropIn(fp, sx, landY, i * 90, 500); setTimeout(function () { fp.style.transition = "opacity .3s ease"; }, 700 + i * 90); spots.push({ x: sx, y: landY, el: fp, covered: false }); }); let coveredCount = 0, completed = false; const pileXs = [16, 32, 48, 64, 80, 92]; pileXs.forEach(function (sx, i) { const pile = document.createElement("div"); pile.textContent = LEAF_EMOJI[Math.floor(Math.random() * LEAF_EMOJI.length)]; pile.style.position = "absolute"; pile.style.fontSize = "40px"; pile.style.cursor = "grab"; pile.style.touchAction = "none"; pile.style.zIndex = "6"; pile.style.transform = "translate(-50%,-50%)"; cover.appendChild(pile); dropIn(pile, sx, 50, i * 90 + 200, 500); pile.addEventListener("pointerdown", function (e) { e.preventDefault(); pile.style.zIndex = "12"; pile.style.cursor = "grabbing"; function onMove(ev) { const rect = scene.getBoundingClientRect(); const x = ((ev.clientX - rect.left) / rect.width) * 100; const y = ((ev.clientY - rect.top) / rect.height) * 100; pile.style.left = x + "%"; pile.style.top = y + "%"; } function onUp() { document.removeEventListener("pointermove", onMove); document.removeEventListener("pointerup", onUp); pile.style.zIndex = "6"; pile.style.cursor = "grab"; const curX = parseFloat(pile.style.left); const curY = parseFloat(pile.style.top); let matched = false; let bestDist = Infinity, bestSpot = null; spots.forEach(function (spot) { if (spot.covered) return; const dist = Math.hypot(curX - spot.x, curY - spot.y); if (dist < CATCH_RADIUS_PCT && dist < bestDist) { bestDist = dist; bestSpot = spot; } }); if (bestSpot) { matched = true; bestSpot.covered = true; bestSpot.el.style.opacity = "0"; pile.style.transition = "left .15s ease, top .15s ease, opacity .2s ease"; pile.style.left = bestSpot.x + "%"; pile.style.top = bestSpot.y + "%"; setTimeout(function () { pile.style.opacity = "0"; }, 120); coveredCount += 1; if (Game.Sound) Game.Sound.tick(); if (coveredCount >= totalSpots && !completed) { completed = true; setTimeout(function () { Game.advance("Mud"); }, 500); } } if (!matched) { pile.style.transition = "left .3s ease, top .3s ease"; pile.style.left = curX + "%"; pile.style.top = curY + "%"; } } document.addEventListener("pointermove", onMove); document.addEventListener("pointerup", onUp); }); }); } } }); <</script>> <<silently>>[[Snow]][[Mud]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "SNOWSTORM", duration: 12000, build: function (scene) { const reverse = Game.reverseMode; scene.style.background = "radial-gradient(circle at 50% 50%, #2a3038 0%, #14181d 60%, #05070a 100%)"; let kfCounter = 0; function injectKeyframe(cssText) { kfCounter += 1; const name = "kfsnow" + kfCounter; const styleTag = document.createElement("style"); styleTag.textContent = "@keyframes " + name + " { " + cssText + " }"; document.head.appendChild(styleTag); return name; } if (!document.getElementById("snow-igloo-keyframes-v4")) { const styleTag = document.createElement("style"); styleTag.id = "snow-igloo-keyframes-v4"; styleTag.textContent = "@keyframes arrowPulseLeft { 0%,100% { transform: translate(-50%,-50%) translateX(0); opacity: .5; } 50% { transform: translate(-50%,-50%) translateX(-8px); opacity: 1; } }" + "@keyframes arrowPulseRight { 0%,100% { transform: translate(-50%,-50%) translateX(0); opacity: .5; } 50% { transform: translate(-50%,-50%) translateX(8px); opacity: 1; } }"; document.head.appendChild(styleTag); } const svgNS = "http://www.w3.org/2000/svg"; const flakeLayer = document.createElement("div"); flakeLayer.style.position = "absolute"; flakeLayer.style.inset = "0"; flakeLayer.style.pointerEvents = "none"; flakeLayer.style.zIndex = "1"; flakeLayer.style.overflow = "hidden"; scene.appendChild(flakeLayer); for (let i = 0; i < 40; i += 1) { const flake = document.createElement("div"); flake.textContent = "\u2726"; flake.style.position = "absolute"; flake.style.left = (Math.random() * 100) + "%"; flake.style.top = "-5%"; flake.style.fontSize = (10 + Math.random() * 16) + "px"; flake.style.color = "rgba(255,255,255,0.7)"; const driftX = (Math.random() * 60 - 30); const kfName = injectKeyframe( "0% { transform: translate(0,-10%); } 100% { transform: translate(" + driftX + "px, 110vh); }" ); flake.style.animation = kfName + " " + (4 + Math.random() * 4) + "s linear infinite"; flake.style.animationDelay = (Math.random() * -8) + "s"; flakeLayer.appendChild(flake); } const REVERSALS_NEEDED = 8; const MIN_DX = 5; let lastX = null, lastDir = 0, hasDir = false, reversals = 0, dragging = false, completed = false; const meterWrap = document.createElement("div"); meterWrap.style.position = "absolute"; meterWrap.style.left = "50%"; meterWrap.style.top = "18%"; meterWrap.style.width = "180px"; meterWrap.style.height = "10px"; meterWrap.style.transform = "translateX(-50%)"; meterWrap.style.border = "1px solid rgba(255,255,255,.4)"; meterWrap.style.borderRadius = "5px"; meterWrap.style.overflow = "hidden"; meterWrap.style.zIndex = "8"; scene.appendChild(meterWrap); const meterFill = document.createElement("div"); meterFill.style.width = "0%"; meterFill.style.height = "100%"; meterFill.style.background = reverse ? "rgba(140,180,255,.9)" : "rgba(255,255,255,.9)"; meterWrap.appendChild(meterFill); const arrowL = document.createElement("div"); arrowL.textContent = "\u2B9C"; arrowL.style.position = "absolute"; arrowL.style.left = "18%"; arrowL.style.top = "50%"; arrowL.style.fontSize = "26px"; arrowL.style.color = "rgba(255,255,255,0.8)"; arrowL.style.zIndex = "9"; arrowL.style.pointerEvents = "none"; arrowL.style.animation = "arrowPulseLeft 1.1s ease-in-out infinite"; scene.appendChild(arrowL); const arrowR = document.createElement("div"); arrowR.textContent = "\u2B9E"; arrowR.style.position = "absolute"; arrowR.style.left = "82%"; arrowR.style.top = "50%"; arrowR.style.fontSize = "26px"; arrowR.style.color = "rgba(255,255,255,0.8)"; arrowR.style.zIndex = "9"; arrowR.style.pointerEvents = "none"; arrowR.style.animation = "arrowPulseRight 1.1s ease-in-out infinite"; scene.appendChild(arrowR); function registerDirection(dir) { let isReversal = false; if (hasDir && (dir * lastDir) < 0) { isReversal = true; } lastDir = dir; hasDir = true; return isReversal; } function buildMoundPath() { const bumps = 5; let d = "M 8 130 "; for (let i = 0; i <= bumps; i += 1) { const x = 8 + (i / bumps) * 214; const y = 45 + Math.sin(i * 1.4 + Math.random()) * 14 + (Math.random() * 6 - 3); d += "L " + x + " " + y + " "; } d += "L 222 130 Z"; return d; } function makeMoundElement(fillColor) { const wrap = document.createElement("div"); wrap.style.position = "absolute"; wrap.style.left = "50%"; wrap.style.top = "50%"; wrap.style.width = "230px"; wrap.style.height = "150px"; wrap.style.transform = "translate(-50%,-50%)"; wrap.style.zIndex = "6"; wrap.style.overflow = "visible"; const svg = document.createElementNS(svgNS, "svg"); svg.setAttribute("viewBox", "0 0 230 150"); svg.style.width = "100%"; svg.style.height = "100%"; svg.style.overflow = "visible"; const shadow = document.createElementNS(svgNS, "ellipse"); shadow.setAttribute("cx", "115"); shadow.setAttribute("cy", "132"); shadow.setAttribute("rx", "95"); shadow.setAttribute("ry", "10"); shadow.setAttribute("fill", "rgba(0,0,0,0.3)"); svg.appendChild(shadow); const mound = document.createElementNS(svgNS, "path"); mound.setAttribute("d", buildMoundPath()); mound.setAttribute("fill", fillColor); mound.setAttribute("stroke", "rgba(150,180,200,0.4)"); mound.setAttribute("stroke-width", "1.5"); svg.appendChild(mound); wrap.appendChild(svg); return { wrap: wrap, svg: svg, mound: mound }; } if (!reverse) { const moundObj = makeMoundElement("url(#moundGradient)"); const defs = document.createElementNS(svgNS, "defs"); const grad = document.createElementNS(svgNS, "linearGradient"); grad.setAttribute("id", "moundGradient"); grad.setAttribute("x1", "0%"); grad.setAttribute("y1", "0%"); grad.setAttribute("x2", "0%"); grad.setAttribute("y2", "100%"); const stop1 = document.createElementNS(svgNS, "stop"); stop1.setAttribute("offset", "0%"); stop1.setAttribute("stop-color", "#f8fbfc"); const stop2 = document.createElementNS(svgNS, "stop"); stop2.setAttribute("offset", "100%"); stop2.setAttribute("stop-color", "#c9dce6"); grad.appendChild(stop1); grad.appendChild(stop2); defs.appendChild(grad); moundObj.svg.insertBefore(defs, moundObj.svg.firstChild); scene.appendChild(moundObj.wrap); moundObj.wrap.style.cursor = "grab"; moundObj.wrap.style.touchAction = "none"; const cracks = []; for (let i = 0; i < 6; i += 1) { const crack = document.createElementNS(svgNS, "line"); const cx = 40 + Math.random() * 150; const cy = 60 + Math.random() * 50; crack.setAttribute("x1", cx); crack.setAttribute("y1", cy); crack.setAttribute("x2", cx + (Math.random() * 30 - 15)); crack.setAttribute("y2", cy + 14 + Math.random() * 18); crack.setAttribute("stroke", "rgba(90,120,140,0.6)"); crack.setAttribute("stroke-width", "2"); crack.setAttribute("opacity", "0"); moundObj.svg.appendChild(crack); cracks.push(crack); } moundObj.wrap.addEventListener("pointerdown", function (e) { if (completed) return; dragging = true; lastX = e.clientX; hasDir = false; moundObj.wrap.setPointerCapture(e.pointerId); moundObj.wrap.style.cursor = "grabbing"; }); moundObj.wrap.addEventListener("pointermove", function (e) { if (!dragging || completed) return; const dx = e.clientX - lastX; if (Math.abs(dx) > MIN_DX) { const dir = dx > 0 ? 1 : -1; const wasReversal = registerDirection(dir); lastX = e.clientX; if (wasReversal) { reversals += 1; if (Game.Sound) Game.Sound.tick(); moundObj.wrap.style.transform = "translate(-50%,-50%) rotate(" + (dir * 3) + "deg)"; const pct = Math.min(100, (reversals / REVERSALS_NEEDED) * 100); meterFill.style.width = pct + "%"; const crackIdx = Math.floor((reversals / REVERSALS_NEEDED) * cracks.length); for (let i = 0; i < crackIdx && i < cracks.length; i += 1) { cracks[i].setAttribute("opacity", "1"); } if (reversals >= REVERSALS_NEEDED) { completed = true; meterWrap.style.transition = "opacity .3s ease"; meterWrap.style.opacity = "0"; arrowL.style.opacity = "0"; arrowR.style.opacity = "0"; for (let i = 0; i < 10; i += 1) { const cdx = (Math.random() * 2 - 1) * 140; const cdy = (Math.random() * 2 - 1) * 140; const crot = Math.random() * 360; const chunkKf = injectKeyframe( "to { opacity: 0; transform: translate(" + cdx + "px, " + cdy + "px) rotate(" + crot + "deg); }" ); const chunk = document.createElement("div"); chunk.style.position = "absolute"; chunk.style.left = "50%"; chunk.style.top = "50%"; chunk.style.width = "18px"; chunk.style.height = "18px"; chunk.style.background = "#f0f6f9"; chunk.style.borderRadius = "50%"; chunk.style.zIndex = "9"; chunk.style.animation = chunkKf + " .6s ease-out forwards"; scene.appendChild(chunk); } moundObj.wrap.style.transition = "opacity .3s ease"; moundObj.wrap.style.opacity = "0"; setTimeout(function () { Game.advance("Cave"); }, 700); } } } }); moundObj.wrap.addEventListener("pointerup", function () { dragging = false; moundObj.wrap.style.cursor = "grab"; if (!completed) moundObj.wrap.style.transform = "translate(-50%,-50%)"; }); } else { const domeMask = document.createElement("div"); domeMask.style.position = "absolute"; domeMask.style.left = "50%"; domeMask.style.top = "50%"; domeMask.style.width = "230px"; domeMask.style.height = "150px"; domeMask.style.transform = "translate(-50%,-50%)"; domeMask.style.border = "2px dashed rgba(180,210,230,0.4)"; domeMask.style.borderRadius = "20% 20% 8% 8%"; domeMask.style.overflow = "hidden"; domeMask.style.cursor = "grab"; domeMask.style.touchAction = "none"; domeMask.style.zIndex = "6"; scene.appendChild(domeMask); const gridCols = 4, gridRows = 2; const cellW = 230 / gridCols; const cellH = 150 / gridRows; const blocks = []; const slotOrder = []; for (let r = 0; r < gridRows; r += 1) { for (let c = 0; c < gridCols; c += 1) { slotOrder.push({ row: r, col: c }); } } for (let i = slotOrder.length - 1; i > 0; i -= 1) { const j = Math.floor(Math.random() * (i + 1)); const tmp = slotOrder[i]; slotOrder[i] = slotOrder[j]; slotOrder[j] = tmp; } slotOrder.forEach(function (slot) { const block = document.createElement("div"); block.style.position = "absolute"; block.style.width = (cellW - 2) + "px"; block.style.height = (cellH - 2) + "px"; block.style.left = (slot.col * cellW) + "px"; block.style.top = (slot.row * cellH) + "px"; block.style.background = "linear-gradient(#e4eef4, #b9d0dd)"; block.style.border = "1px solid rgba(120,150,170,0.4)"; block.style.boxShadow = "0 2px 4px rgba(0,0,0,.3)"; const angle = Math.random() * Math.PI * 2; const dist = 260 + Math.random() * 120; const offX = Math.cos(angle) * dist; const offY = Math.sin(angle) * dist; const rot = Math.random() * 360; block.style.transform = "translate(" + offX + "px," + offY + "px) rotate(" + rot + "deg)"; block.style.transition = "transform .5s cubic-bezier(.3,.9,.4,1)"; block.style.zIndex = "6"; domeMask.appendChild(block); blocks.push(block); }); domeMask.addEventListener("pointerdown", function (e) { if (completed) return; dragging = true; lastX = e.clientX; hasDir = false; domeMask.setPointerCapture(e.pointerId); domeMask.style.cursor = "grabbing"; }); domeMask.addEventListener("pointermove", function (e) { if (!dragging || completed) return; const dx = e.clientX - lastX; if (Math.abs(dx) > MIN_DX) { const dir = dx > 0 ? 1 : -1; const wasReversal = registerDirection(dir); lastX = e.clientX; if (wasReversal) { reversals += 1; if (Game.Sound) Game.Sound.tick(); domeMask.style.transform = "translate(-50%,-50%) rotate(" + (dir * 2) + "deg)"; const pct = Math.min(100, (reversals / REVERSALS_NEEDED) * 100); meterFill.style.width = pct + "%"; if (reversals <= blocks.length) { blocks[reversals - 1].style.transform = "translate(0,0) rotate(0deg)"; } if (reversals >= REVERSALS_NEEDED) { completed = true; meterWrap.style.transition = "opacity .3s ease"; meterWrap.style.opacity = "0"; arrowL.style.opacity = "0"; arrowR.style.opacity = "0"; domeMask.style.borderColor = "transparent"; setTimeout(function () { Game.advance("Forest"); }, 1200); } } } }); domeMask.addEventListener("pointerup", function () { dragging = false; domeMask.style.cursor = "grab"; if (!completed) domeMask.style.transform = "translate(-50%,-50%)"; }); } } }); <</script>> <<silently>>[[Cave]][[Forest]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "CAVE", duration: 22000, build: function (scene) { const cave = document.createElement("div"); cave.id = "cave"; scene.appendChild(cave); const light = document.createElement("div"); light.id = "flashlight"; light.style.left = "50%"; light.style.top = "72%"; cave.appendChild(light); const torchEmoji = document.createElement("div"); torchEmoji.textContent = "\uD83D\uDD26"; torchEmoji.style.position = "absolute"; torchEmoji.style.left = "50%"; torchEmoji.style.top = "72%"; torchEmoji.style.fontSize = "30px"; torchEmoji.style.transform = "translate(-50%,-50%) scaleY(-1)"; torchEmoji.style.zIndex = "5"; torchEmoji.style.pointerEvents = "none"; cave.appendChild(torchEmoji); const REVEAL_RADIUS = 55; const REVEAL_MS_NEEDED = 1800; const DECAY_RATE = 0.6; const DRIFT_INTERVAL_MS = 1800; const EYE_SIZE = 20; const shapeCount = 4; const MIN_DISTANCE_PCT = 26; const realIndex = Math.floor(Math.random() * shapeCount); const shapes = []; let completed = false, choiceTriggered = false, last = performance.now(); let lastRevealCue = 0; function randomSpot() { return { x: 15 + Math.random() * 70, y: 15 + Math.random() * 60 }; } function randomSpotAvoiding(existingSpots) { for (let attempt = 0; attempt < 30; attempt++) { const candidate = randomSpot(); let ok = true; for (let i = 0; i < existingSpots.length; i++) { const d = Math.hypot(candidate.x - existingSpots[i].x, candidate.y - existingSpots[i].y); if (d < MIN_DISTANCE_PCT) { ok = false; break; } } if (ok) return candidate; } return randomSpot(); } for (let i = 0; i < shapeCount; i++) { const el = document.createElement("div"); el.className = "cave-shadow"; cave.appendChild(el); const eyeL = document.createElement("div"); eyeL.style.position = "absolute"; eyeL.style.left = "32%"; eyeL.style.top = "45%"; eyeL.style.width = EYE_SIZE + "px"; eyeL.style.height = EYE_SIZE + "px"; eyeL.style.borderRadius = "50%"; eyeL.style.transform = "translate(-50%,-50%)"; eyeL.style.opacity = "0"; eyeL.style.pointerEvents = "none"; el.appendChild(eyeL); const eyeR = document.createElement("div"); eyeR.style.position = "absolute"; eyeR.style.left = "68%"; eyeR.style.top = "45%"; eyeR.style.width = EYE_SIZE + "px"; eyeR.style.height = EYE_SIZE + "px"; eyeR.style.borderRadius = "50%"; eyeR.style.transform = "translate(-50%,-50%)"; eyeR.style.opacity = "0"; eyeR.style.pointerEvents = "none"; el.appendChild(eyeR); shapes.push({ el: el, eyeL: eyeL, eyeR: eyeR, isReal: i === realIndex, revealTime: 0 }); } (function placeInitial() { const placed = []; shapes.forEach(function (s) { const spot = randomSpotAvoiding(placed); placed.push(spot); s.el.style.left = spot.x + "%"; s.el.style.top = spot.y + "%"; }); })(); function driftAll() { if (completed) return; const placed = []; shapes.forEach(function (s) { const spot = randomSpotAvoiding(placed); placed.push(spot); s.el.style.left = spot.x + "%"; s.el.style.top = spot.y + "%"; }); setTimeout(driftAll, DRIFT_INTERVAL_MS); } setTimeout(driftAll, DRIFT_INTERVAL_MS); function updateLightFeel(frac) { light.style.background = "radial-gradient(circle, rgba(255,255,255," + (0.28 + frac * 0.35) + ") 0%, rgba(255,255,255,.1) 55%, transparent 75%)"; light.style.boxShadow = "0 0 " + (35 + frac * 70) + "px " + (10 + frac * 35) + "px rgba(255,255,255," + (0.15 + frac * 0.45) + ")"; light.style.transform = "translate(-50%, -50%) scale(" + (1 + frac * 0.2) + ")"; } function updateEyes(shape, frac) { const alpha = Math.pow(frac, 0.4); [shape.eyeL, shape.eyeR].forEach(function (eye) { eye.style.opacity = alpha.toFixed(2); eye.style.background = "radial-gradient(circle, rgba(255,40,40,1), rgba(120,0,0,0.9) 70%)"; eye.style.boxShadow = "0 0 " + (alpha * 22) + "px rgba(255,30,30," + alpha + ")"; }); } function checkCompletion(realFrac) { if (realFrac >= 1 && !completed) { completed = true; Game.pauseDanger(); updateLightFeel(1); choiceTriggered = true; bearJumpscare(function () { showChoicePrompt(function (choice) { if (choice === "run") { Game.reverseMode = true; Game.advanceDirect("Snow", 0); } else { Game.advanceDirect("Final", 0); } }); }); } } function bearJumpscare(callback) { if (!document.getElementById("jumpscare-shake-kf")) { const styleTag = document.createElement("style"); styleTag.id = "jumpscare-shake-kf"; styleTag.textContent = "@keyframes jumpscareShake {" + "0% { transform: translate(0,0); }" + "20% { transform: translate(-10px,6px); }" + "40% { transform: translate(9px,-7px); }" + "60% { transform: translate(-8px,-5px); }" + "80% { transform: translate(7px,6px); }" + "100% { transform: translate(0,0); }" + "}" + "@keyframes redFlashPulse {" + "0%,100% { opacity: 0; }" + "50% { opacity: 0.55; }" + "}"; document.head.appendChild(styleTag); } const overlay = document.createElement("div"); overlay.style.position = "fixed"; overlay.style.top = "0"; overlay.style.left = "0"; overlay.style.right = "0"; overlay.style.bottom = "0"; overlay.style.background = "#000"; overlay.style.zIndex = "9999"; overlay.style.display = "flex"; overlay.style.alignItems = "center"; overlay.style.justifyContent = "center"; overlay.style.opacity = "0"; overlay.style.transition = "opacity .05s ease"; document.body.appendChild(overlay); const redFlash = document.createElement("div"); redFlash.style.position = "absolute"; redFlash.style.inset = "0"; redFlash.style.background = "radial-gradient(circle, rgba(180,0,0,0.6) 0%, rgba(120,0,0,0.15) 55%, transparent 80%)"; redFlash.style.opacity = "0"; redFlash.style.pointerEvents = "none"; overlay.appendChild(redFlash); const eyeStage = document.createElement("div"); eyeStage.style.position = "absolute"; eyeStage.style.display = "flex"; eyeStage.style.alignItems = "center"; eyeStage.style.justifyContent = "center"; eyeStage.style.gap = "40px"; eyeStage.style.opacity = "1"; eyeStage.style.transition = "opacity .3s ease"; overlay.appendChild(eyeStage); [0, 1].forEach(function () { const eye = document.createElement("div"); eye.style.width = "40px"; eye.style.height = "40px"; eye.style.borderRadius = "50%"; eye.style.background = "radial-gradient(circle, rgba(255,40,40,1), rgba(120,0,0,0.9) 70%)"; eye.style.boxShadow = "0 0 60px rgba(255,30,30,0.9)"; eye.style.transition = "width .4s cubic-bezier(.34,1.4,.5,1), height .4s cubic-bezier(.34,1.4,.5,1)"; eyeStage.appendChild(eye); setTimeout(function () { eye.style.width = "220px"; eye.style.height = "220px"; }, 100); }); const bearStage = document.createElement("div"); bearStage.textContent = "\uD83D\uDC3B"; bearStage.style.position = "absolute"; bearStage.style.fontSize = "300px"; bearStage.style.filter = "brightness(0.6) contrast(1.3) drop-shadow(0 0 50px rgba(255,20,20,0.6))"; bearStage.style.opacity = "0"; bearStage.style.transform = "scale(0.85)"; bearStage.style.transition = "opacity .3s ease, transform .3s cubic-bezier(.3,1.6,.6,1)"; overlay.appendChild(bearStage); requestAnimationFrame(function () { overlay.style.transition = "opacity .04s ease"; overlay.style.opacity = "1"; }); overlay.style.animation = "jumpscareShake 0.5s ease-in-out 3"; redFlash.style.animation = "redFlashPulse 0.35s ease-in-out 5"; setTimeout(function () { eyeStage.style.opacity = "0"; bearStage.style.opacity = "1"; bearStage.style.transform = "scale(1.05)"; overlay.style.animation = ""; void overlay.offsetWidth; overlay.style.animation = "jumpscareShake 0.35s ease-in-out 2"; redFlash.style.animation = ""; void redFlash.offsetWidth; redFlash.style.animation = "redFlashPulse 0.25s ease-in-out 3"; }, 900); setTimeout(function () { overlay.style.transition = "opacity .3s ease"; overlay.style.opacity = "0"; setTimeout(function () { overlay.remove(); callback(); }, 320); }, 1500); } function showChoicePrompt(callback) { const overlay = document.createElement("div"); overlay.style.position = "fixed"; overlay.style.top = "0"; overlay.style.left = "0"; overlay.style.right = "0"; overlay.style.bottom = "0"; overlay.style.background = "#000"; overlay.style.zIndex = "9999"; overlay.style.display = "flex"; overlay.style.alignItems = "center"; overlay.style.justifyContent = "center"; overlay.style.gap = "70px"; overlay.style.opacity = "0"; overlay.style.transition = "opacity .3s ease"; document.body.appendChild(overlay); const runBtn = document.createElement("div"); runBtn.textContent = "\uD83C\uDFC3"; runBtn.style.fontSize = "70px"; runBtn.style.cursor = "pointer"; runBtn.style.filter = "drop-shadow(0 0 10px rgba(255,255,255,.4))"; runBtn.style.transition = "transform .15s ease"; const standBtn = document.createElement("div"); standBtn.textContent = "\uD83E\uDDD8"; standBtn.style.fontSize = "70px"; standBtn.style.cursor = "pointer"; standBtn.style.filter = "drop-shadow(0 0 10px rgba(255,255,255,.4))"; standBtn.style.transition = "transform .15s ease"; [runBtn, standBtn].forEach(function (btn) { btn.addEventListener("pointerenter", function () { btn.style.transform = "scale(1.15)"; }); btn.addEventListener("pointerleave", function () { btn.style.transform = "scale(1)"; }); }); overlay.appendChild(runBtn); overlay.appendChild(standBtn); requestAnimationFrame(function () { overlay.style.opacity = "1"; }); let armed = false; setTimeout(function () { armed = true; }, 400); function choose(val) { if (!armed) return; overlay.style.transition = "opacity .3s ease"; overlay.style.opacity = "0"; setTimeout(function () { overlay.remove(); callback(val); }, 320); } runBtn.addEventListener("pointerdown", function () { choose("run"); }); standBtn.addEventListener("pointerdown", function () { choose("stand"); }); } scene.addEventListener("pointermove", function (e) { if (completed) return; const rect = scene.getBoundingClientRect(); const xPct = ((e.clientX - rect.left) / rect.width) * 100; const yPct = ((e.clientY - rect.top) / rect.height) * 100; light.style.left = xPct + "%"; light.style.top = yPct + "%"; torchEmoji.style.left = xPct + "%"; torchEmoji.style.top = yPct + "%"; const now = performance.now(); const elapsed = Math.min(now - last, 80); last = now; let realFrac = 0; shapes.forEach(function (s) { const r = s.el.getBoundingClientRect(); const sx = r.left + r.width / 2; const sy = r.top + r.height / 2; const d = Math.hypot(e.clientX - sx, e.clientY - sy); const inLight = d < REVEAL_RADIUS; if (s.isReal) { if (inLight) { s.revealTime += elapsed; } else { s.revealTime = Math.max(0, s.revealTime - elapsed * DECAY_RATE); } realFrac = Math.max(0, Math.min(1, s.revealTime / REVEAL_MS_NEEDED)); s.el.style.opacity = Math.max(0.55, 0.55 - realFrac * 0.3); updateEyes(s, realFrac); } else if (inLight) { s.el.style.filter = "brightness(2.2)"; setTimeout(function () { s.el.style.filter = ""; }, 220); } }); // Milestone ticks let the player hear that the right shadow is being uncovered. const cue = Math.min(3, Math.floor(realFrac * 4)); if (cue > lastRevealCue && !completed) { lastRevealCue = cue; if (Game.Sound) Game.Sound.tick(); } if (!completed) updateLightFeel(realFrac); checkCompletion(realFrac); }); } }); <</script>> <<silently>>[[Snow]][[Final]]<</silently>>
<div id="game"></div> <<script>> Game.startStage({ title: "STAND YOUR GROUND", duration: 11000, build: function (scene) { Game.pauseDanger(); scene.style.background = "#000"; if (!document.getElementById("stand-bear-pulse-kf")) { const styleTag = document.createElement("style"); styleTag.id = "stand-bear-pulse-kf"; styleTag.textContent = "@keyframes standBearBreathe { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.06); } }"; document.head.appendChild(styleTag); } const bear = document.createElement("div"); bear.textContent = "\uD83D\uDC3B"; bear.style.position = "absolute"; bear.style.left = "50%"; bear.style.top = "50%"; bear.style.transform = "translate(-50%,-50%)"; bear.style.fontSize = "130px"; bear.style.zIndex = "6"; bear.style.filter = "brightness(0.75) contrast(1.15)"; bear.style.animation = "standBearBreathe 1.6s ease-in-out infinite"; bear.style.transition = "filter .35s ease"; scene.appendChild(bear); const calmWrap = document.createElement("div"); calmWrap.style.position = "absolute"; calmWrap.style.left = "50%"; calmWrap.style.top = "18%"; calmWrap.style.width = "220px"; calmWrap.style.height = "12px"; calmWrap.style.transform = "translateX(-50%)"; calmWrap.style.border = "2px solid rgba(255,255,255,.5)"; calmWrap.style.borderRadius = "6px"; calmWrap.style.overflow = "hidden"; calmWrap.style.zIndex = "8"; calmWrap.style.transition = "opacity .3s ease"; scene.appendChild(calmWrap); const calmFill = document.createElement("div"); calmFill.style.width = "0%"; calmFill.style.height = "100%"; calmFill.style.background = "linear-gradient(90deg,#7fdc7f,#c8f0a0)"; calmWrap.appendChild(calmFill); const CALM_FILL_MS = 5500; const FLINCH_SETBACK_MS = 1400; const DOUBT_MOMENT_MS = 2750; let calmMs = 0; let succeeded = false; let doubtPlayed = false; let lastFrame = null; function playDoubtMoment() { bear.style.filter = "brightness(0.4) contrast(1.3)"; calmWrap.style.opacity = "0.35"; setTimeout(function () { bear.style.filter = "brightness(0.75) contrast(1.15)"; calmWrap.style.opacity = "1"; }, 500); } function loop(now) { if (succeeded) return; if (!lastFrame) lastFrame = now; const dt = now - lastFrame; lastFrame = now; calmMs = Math.min(CALM_FILL_MS, calmMs + dt); const frac = calmMs / CALM_FILL_MS; calmFill.style.width = (frac * 100) + "%"; if (!doubtPlayed && calmMs >= DOUBT_MOMENT_MS) { doubtPlayed = true; playDoubtMoment(); } if (calmMs >= CALM_FILL_MS) { succeeded = true; finishStand(); return; } requestAnimationFrame(loop); } requestAnimationFrame(loop); scene.addEventListener("pointerdown", function () { if (succeeded) return; calmMs = Math.max(0, calmMs - FLINCH_SETBACK_MS); Game.noiseCount += 1; const sceneEl = document.getElementById("scene"); if (sceneEl) { sceneEl.classList.remove("stumbling"); void sceneEl.offsetWidth; sceneEl.classList.add("stumbling"); } }); function finishStand() { calmWrap.style.transition = "opacity .3s ease"; calmWrap.style.opacity = "0"; bear.style.animation = ""; bear.style.transition = "opacity 1.6s ease-in, transform 1.6s ease-in, filter 1.6s ease-in"; bear.style.filter = "brightness(0.9) contrast(1) grayscale(0.3)"; bear.style.transform = "translate(-50%,-50%) scale(0.6)"; bear.style.opacity = "0.3"; setTimeout(function () { Game.braveVictory = true; Game.advance("Win"); }, 1600); } } }); <</script>> <<silently>>[[Win]]<</silently>>
<div id="game"></div> <<script>> if (Game.braveVictory) { Game.braveVictory = false; Game.render( '<style>' + '@keyframes happyBounce {' + '0%, 100% { transform: translateY(0) scale(1); }' + '50% { transform: translateY(-32px) scale(1.1); }' + '}' + '.happy-ball {' + 'font-size: 64px;' + 'line-height: 1;' + 'display: inline-block;' + 'animation: happyBounce 0.55s infinite ease-in-out;' + 'filter: drop-shadow(0 0 18px rgba(255,255,255,0.85));' + '}' + '</style>' + '<div class="scene">' + '<div class="center-message" style="gap: 8px;">' + '<div class="title title-glow" style="position:static; margin-bottom: 4px; font-size: 36px; letter-spacing: 6px;">YOU STOOD YOUR GROUND</div>' + '<div class="happy-ball">\u25CF</div>' + '<button class="btn" style="margin-top: 12px;" onclick="Game.go(\'Start\')">Play Again</button>' + '</div>' + '</div>' ); } else { showFinalScreen(); } function showFinalScreen() { const winMessage = "Noisy moments: " + Game.noiseCount; Game.render( '<style>' + '@keyframes bounce {' + '0%, 100% { transform: translateY(0); }' + '50% { transform: translateY(-24px); }' + '}' + '.bouncing-ball {' + 'font-size: 56px;' + 'line-height: 1;' + 'display: inline-block;' + 'animation: bounce 0.8s infinite ease-in-out;' + 'filter: drop-shadow(0 0 12px rgba(255,255,255,0.6));' + '}' + '</style>' + '<div class="scene">' + '<div class="center-message" style="gap: 8px;">' + '<div class="title title-glow" style="position:static; margin-bottom: 4px; font-size: 44px; letter-spacing: 8px;">SAFE AT LAST</div>' + '<div class="bouncing-ball">\u25CF</div>' + '<div style="font-size:14px;opacity:0.75;max-width:320px;text-align:center;margin-top:6px;">' + winMessage + '</div>' + '<button class="btn" style="margin-top: 12px;" onclick="Game.go(\'Start\')">Play Again</button>' + '</div>' + '</div>' ); } <</script>>