|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <meta name="theme-color" content="#10182e" /> |
| 7 | + <title>Orbit Courier — Effect Machine Platformer</title> |
| 8 | + </head> |
| 9 | + <body> |
| 10 | + <main class="app-shell"> |
| 11 | + <header class="hero"> |
| 12 | + <div> |
| 13 | + <p class="eyebrow">@typeonce/effect-machine · playable example</p> |
| 14 | + <h1>Orbit Courier</h1> |
| 15 | + <p class="lede">A tiny platformer where every pose is a typed state.</p> |
| 16 | + </div> |
| 17 | + <div class="status-light"><span></span> machine online</div> |
| 18 | + </header> |
| 19 | + |
| 20 | + <section class="demo-grid"> |
| 21 | + <div class="game-card"> |
| 22 | + <svg id="game" viewBox="0 0 640 360" role="img" aria-label="Playable platformer scene"> |
| 23 | + <defs> |
| 24 | + <linearGradient id="sky" x1="0" y1="0" x2="0" y2="1"> |
| 25 | + <stop offset="0" stop-color="#10182e" /> |
| 26 | + <stop offset="1" stop-color="#213751" /> |
| 27 | + </linearGradient> |
| 28 | + </defs> |
| 29 | + <rect width="640" height="360" fill="url(#sky)" /> |
| 30 | + <g class="stars" fill="#d9fff7"> |
| 31 | + <circle cx="72" cy="58" r="1.5" /> |
| 32 | + <circle cx="158" cy="112" r="1" /> |
| 33 | + <circle cx="282" cy="52" r="1" /> |
| 34 | + <circle cx="390" cy="92" r="1.5" /> |
| 35 | + <circle cx="520" cy="48" r="1" /> |
| 36 | + <circle cx="584" cy="138" r="1.5" /> |
| 37 | + </g> |
| 38 | + <path |
| 39 | + class="skyline" |
| 40 | + d="M0 324v-38h40v-18h34v27h38v-46h46v37h48v-24h38v34h42v-52h50v42h44v-30h44v40h45v-64h44v54h40v-28h40v36h47v40z" |
| 41 | + /> |
| 42 | + <rect class="ground" y="324" width="640" height="36" /> |
| 43 | + <rect class="ground-top" y="324" width="640" height="5" /> |
| 44 | + <rect class="wall" y="112" width="6" height="212" /> |
| 45 | + <rect class="wall" x="634" y="112" width="6" height="212" /> |
| 46 | + |
| 47 | + <g id="player" data-mode="Standing"> |
| 48 | + <g id="player-pose"> |
| 49 | + <rect class="body" width="30" height="30" rx="5" /> |
| 50 | + <rect class="face" x="5" y="6" width="20" height="13" rx="2" /> |
| 51 | + <circle class="eye" cx="11" cy="12" r="2" /> |
| 52 | + <circle class="eye" cx="20" cy="12" r="2" /> |
| 53 | + <path class="scarf" d="M2 20h27v5H17l-7 5 2-5H2z" /> |
| 54 | + </g> |
| 55 | + </g> |
| 56 | + </svg> |
| 57 | + <div class="controls" aria-label="Controls"> |
| 58 | + <span><kbd>A</kbd><kbd>D</kbd> move</span> |
| 59 | + <span><kbd>W</kbd>/<kbd>Space</kbd> jump ×2</span> |
| 60 | + <span><kbd>S</kbd> duck / dive</span> |
| 61 | + <span><kbd>R</kbd> reset</span> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + |
| 65 | + <aside class="debug-card"> |
| 66 | + <div class="panel-heading"> |
| 67 | + <span>live statechart</span> |
| 68 | + </div> |
| 69 | + |
| 70 | + <div class="chart" id="chart"> |
| 71 | + <div class="chart-root"><span>Character</span><small>parallel</small></div> |
| 72 | + <div class="regions"> |
| 73 | + <section> |
| 74 | + <h2>locomotion</h2> |
| 75 | + <div class="branch"> |
| 76 | + <h3 data-node="Grounded">Grounded</h3> |
| 77 | + <div class="state-row"> |
| 78 | + <span data-node="Standing">Standing</span> |
| 79 | + <span data-node="Running">Running</span> |
| 80 | + <span data-node="Ducking">Ducking</span> |
| 81 | + <span data-node="Landing">Landing</span> |
| 82 | + </div> |
| 83 | + </div> |
| 84 | + <div class="branch"> |
| 85 | + <h3 data-node="Airborne">Airborne</h3> |
| 86 | + <div class="parallel-label">parallel regions</div> |
| 87 | + <div class="nested-region"> |
| 88 | + <small>motion</small> |
| 89 | + <div class="state-row"> |
| 90 | + <span data-node="Jumping">Jumping</span> |
| 91 | + <span data-node="Falling">Falling</span> |
| 92 | + <span data-node="Diving">Diving</span> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + <div class="nested-region"> |
| 96 | + <small>air jump</small> |
| 97 | + <div class="state-row"> |
| 98 | + <span data-node="AirJumpGroundLock">ground lock</span> |
| 99 | + <span data-node="AirJumpWallLock">wall lock</span> |
| 100 | + <span data-node="AirJumpReady">ready</span> |
| 101 | + <span data-node="AirJumpSpent">spent</span> |
| 102 | + </div> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + </section> |
| 106 | + <section> |
| 107 | + <h2>facing</h2> |
| 108 | + <div class="state-row facing-row"> |
| 109 | + <span data-node="Left">Left</span> |
| 110 | + <span data-node="Right">Right</span> |
| 111 | + </div> |
| 112 | + </section> |
| 113 | + <section> |
| 114 | + <h2>wall contact</h2> |
| 115 | + <div class="state-row"> |
| 116 | + <span data-node="NoWall">No wall</span> |
| 117 | + <span data-node="LeftWall">Left wall</span> |
| 118 | + <span data-node="RightWall">Right wall</span> |
| 119 | + </div> |
| 120 | + </section> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + |
| 124 | + <dl class="telemetry"> |
| 125 | + <div> |
| 126 | + <dt>active</dt> |
| 127 | + <dd id="active-mode">Standing · NoWall · Right</dd> |
| 128 | + </div> |
| 129 | + <div> |
| 130 | + <dt>state-local data</dt> |
| 131 | + <dd><code id="state-data">{}</code></dd> |
| 132 | + </div> |
| 133 | + <div> |
| 134 | + <dt>last protocol event</dt> |
| 135 | + <dd><code id="last-event">machine started</code></dd> |
| 136 | + </div> |
| 137 | + </dl> |
| 138 | + </aside> |
| 139 | + </section> |
| 140 | + |
| 141 | + <p class="note"> |
| 142 | + A small adapter owns coordinates and gravity. The machine owns legal behavior, and the box simply transforms to |
| 143 | + show its active state. Wall contact is tracked explicitly, so floor-corner jumps stay ordinary. |
| 144 | + </p> |
| 145 | + </main> |
| 146 | + <script type="module" src="/src/main.ts"></script> |
| 147 | + </body> |
| 148 | +</html> |
0 commit comments