# Afterglow an original precision platformer (SimVX flagship demo). ```{raw} html ▶ Run in browser ``` **Tags:** `3d` `game` `platformer` `particles` `feel` `flagship` # Afterglow: original precision platformer (SimVX flagship demo) ![Afterglow](_assets/demos_afterglow/screenshots/cover.png) You are the Wisp, a fading mote of light climbing to relight the Aether Spire. Dash through resonance crystals, gather glow orbs to phase through light-gates, and ride springs and moving platforms ever upward across eighteen single-screen rooms. Every death is instant and every respawn is quick: precision is the whole game. Chase the light. Afterglow is the flagship demo for the SimVX engine and original IP. It is built as a clean split: a deterministic, headless-testable pure-logic 2D simulation (`afterglow/sim/`) presented by a lit, post-processed 3D "diorama" view (`afterglow/view/`), with GPU-particle game feel, a full menu flow, and persistent progression. The sim never imports the view or the assets, so the game's logic is fully unit-tested without a GPU (151 demo tests). ## Signature mechanics Three ideas, each taught by level design rather than text, then braided together: - **Dash through crystals (refills and chains).** The air-dash is a fixed-length burst you normally get once per grounded reset. Dashing *through* a resonance crystal refills the dash mid-air, so a line of crystals becomes a dash-chain: cross a gap no single dash could clear by refuelling at each crystal in turn. - **Glow orbs to timed glow to light-gates.** Touching a glow orb lights the Wisp for a few seconds. A light-gate is solid only while the Wisp glows, so the loop is: grab the orb, race to the gate, and cross before the glow fades. Later rooms put the orb and the gate far enough apart that you must dash-chain to arrive in time. - **Movement feel.** Variable-height jumps, coyote time and jump buffering, wall-slide and wall-jump, springs, and moving platforms. Tight, forgiving, and the foundation every other mechanic is layered on. Each room hides one optional shard tucked off the main path for an expert-only challenge, and tracks your best time and death count. ## Controls Every device feeds the *same* named input actions, so the simulation sees identical intent regardless of how you play. | Action | Keyboard | Gamepad | | ----------------- | ------------------- | ------------------ | | Move | Arrows / WASD | D-pad / left stick | | Aim up-dash | Up / W | Up | | Jump | Space | A | | Dash | Shift / J | X | | Restart room | R | - | | Pause / back | Escape | Start | **Web and mobile touch.** On a small or portrait viewport the game shows an on-screen overlay: a virtual joystick (movement and dash-aim) bottom-left and jump / dash buttons bottom-right. Touches arrive as left-clicks in the web runtime, so the virtual pad drives the exact same actions as a physical press. Everything is playable with mouse or touch alone. ## How to run Desktop (windowed): ```bash uv run python examples/demos/afterglow/main.py ``` Web export (single standalone HTML file): ```bash uv run simvx export web examples/demos/afterglow/main.py -o afterglow.html ``` Run the demo's logic tests (no GPU required): ```bash uv run --package simvx-core pytest examples/demos/afterglow/tests/ -q ``` ## The three worlds Eighteen rooms across three worlds, six rooms each, on a difficulty curve that hands you one new idea at a time and then asks you to combine them: 1. **The Glade** (movement). Run, variable jump, coyote/buffer over gaps, wall-slide and wall-jump, then a climb that combines all of it. No dash, crystals, orbs, or gates yet. 2. **The Caverns** (the dash and crystals). The air-dash alone, then over a gap, then resonance crystals for a single mid-air refill, then a two-crystal chain, then a constellation that demands a full dash-chain. 3. **The Aether Spire** (glow orbs and light-gates). Glow orbs and timed light-gates introduced gently, then combined with dash-chains so you must reach a gate fast and cross it before the glow fades, ending on a finale that braids every mechanic together. ## Placeholder assets All art and audio are generated procedurally in code under `afterglow/assets/` (`textures.py`, `sprite_gen.py`, `audio.py`): tileable PBR-ish tile textures, the Wisp sprite sheet, and synthesized SFX plus per-world ambient music (no copyrighted samples, no file I/O). They are deliberate placeholders. Because the simulation never imports the assets and the view consumes them through a single narrow contract, you can swap any of them for real PNGs or audio files without touching gameplay. ## Source ```{literalinclude} ../../examples/demos/afterglow/main.py :language: python :linenos: ```