@origingame/create-game 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/archetypes/README.md +99 -0
- package/archetypes/idle/.origin/setup +14 -0
- package/archetypes/idle/LICENSES.md +12 -0
- package/archetypes/idle/README.md +234 -0
- package/archetypes/idle/assets/audio/buy.wav +0 -0
- package/archetypes/idle/assets/audio/milestone.wav +0 -0
- package/archetypes/idle/assets/audio/nova.wav +0 -0
- package/archetypes/idle/assets/audio/orbit.wav +0 -0
- package/archetypes/idle/assets/audio/tap.wav +0 -0
- package/archetypes/idle/assets/audio/ui-close.ogt +9 -0
- package/archetypes/idle/assets/audio/ui-error.ogt +9 -0
- package/archetypes/idle/assets/audio/ui-open.ogt +9 -0
- package/archetypes/idle/assets/audio/ui-press.ogt +9 -0
- package/archetypes/idle/assets/audio/ui-success.ogt +9 -0
- package/archetypes/idle/assets/fonts/NotoSansSC-subset.ttf +0 -0
- package/archetypes/idle/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
- package/archetypes/idle/assets/fonts/OFL.txt +93 -0
- package/archetypes/idle/assets/fx/drift.ogt +21 -0
- package/archetypes/idle/assets/fx/milestone.ogt +21 -0
- package/archetypes/idle/assets/fx/nova.ogt +22 -0
- package/archetypes/idle/assets/fx/stars.ogt +20 -0
- package/archetypes/idle/assets/fx/tap.ogt +23 -0
- package/archetypes/idle/assets/looks/idle.ogt +17 -0
- package/archetypes/idle/assets/skins/sparkorb/ChakraPetch-BoldItalic.ttf +0 -0
- package/archetypes/idle/assets/skins/sparkorb/ChakraPetch-BoldItalic.ttf.ogt +9 -0
- package/archetypes/idle/assets/skins/sparkorb/LICENSES.md +19 -0
- package/archetypes/idle/assets/skins/sparkorb/OFL.txt +95 -0
- package/archetypes/idle/assets/skins/sparkorb/Orbitron-Medium.ttf +0 -0
- package/archetypes/idle/assets/skins/sparkorb/Orbitron-Medium.ttf.ogt +9 -0
- package/archetypes/idle/assets/skins/sparkorb/Rajdhani-Bold.ttf +0 -0
- package/archetypes/idle/assets/skins/sparkorb/Rajdhani-Bold.ttf.ogt +9 -0
- package/archetypes/idle/assets/skins/sparkorb/atlas.png +0 -0
- package/archetypes/idle/assets/skins/sparkorb/atlas.png.ogt +7 -0
- package/archetypes/idle/assets/skins/sparkorb/icons.png +0 -0
- package/archetypes/idle/assets/skins/sparkorb/icons.png.ogt +7 -0
- package/archetypes/idle/assets/skins/sparkorb/skin.ogt +113 -0
- package/archetypes/idle/assets/sprites/glow.png +0 -0
- package/archetypes/idle/assets/sprites/glow.png.ogt +8 -0
- package/archetypes/idle/assets/sprites/mote-crystal.png +0 -0
- package/archetypes/idle/assets/sprites/mote-crystal.png.ogt +7 -0
- package/archetypes/idle/assets/sprites/mote-ember.png +0 -0
- package/archetypes/idle/assets/sprites/mote-ember.png.ogt +7 -0
- package/archetypes/idle/assets/sprites/mote-star.png +0 -0
- package/archetypes/idle/assets/sprites/mote-star.png.ogt +7 -0
- package/archetypes/idle/assets/sprites/mote-storm.png +0 -0
- package/archetypes/idle/assets/sprites/mote-storm.png.ogt +7 -0
- package/archetypes/idle/assets/sprites/orb.png +0 -0
- package/archetypes/idle/assets/sprites/orb.png.ogt +7 -0
- package/archetypes/idle/assets/sprites/spark.png +0 -0
- package/archetypes/idle/assets/sprites/spark.png.ogt +7 -0
- package/archetypes/idle/assets/strings/en.ogt +62 -0
- package/archetypes/idle/assets/strings/zh-CN.ogt +62 -0
- package/archetypes/idle/gitattributes +22 -0
- package/archetypes/idle/host.d.ts +46 -0
- package/archetypes/idle/package.json +18 -0
- package/archetypes/idle/project.ogt +14 -0
- package/archetypes/idle/references/metal/card.png +0 -0
- package/archetypes/idle/references/metal/orbit.png +0 -0
- package/archetypes/idle/references/metal/title.png +0 -0
- package/archetypes/idle/src/components.ts +139 -0
- package/archetypes/idle/src/main.ts +247 -0
- package/archetypes/idle/src/numbers.ts +126 -0
- package/archetypes/idle/src/systems.ts +340 -0
- package/archetypes/idle/src/ui.ts +412 -0
- package/archetypes/idle/tests/away.og.ts +42 -0
- package/archetypes/idle/tests/flow.og.ts +57 -0
- package/archetypes/idle/tests/frames.og.ts +33 -0
- package/archetypes/idle/tests/frames.ts +134 -0
- package/archetypes/idle/tests/lib.ts +74 -0
- package/archetypes/idle/tests/milestone.og.ts +32 -0
- package/archetypes/idle/tests/nova.og.ts +52 -0
- package/archetypes/idle/tests/offline.og.ts +60 -0
- package/archetypes/idle/tests/pad.og.ts +55 -0
- package/archetypes/idle/tests/pause.og.ts +68 -0
- package/archetypes/idle/tests/phone.og.ts +50 -0
- package/archetypes/idle/tests/replay.og.ts +28 -0
- package/archetypes/idle/tools/make-assets.py +448 -0
- package/archetypes/idle/tools/oglite.py +285 -0
- package/archetypes/idle/tsconfig.json +17 -0
- package/archetypes/match3/.origin/setup +14 -0
- package/archetypes/match3/LICENSES.md +7 -0
- package/archetypes/match3/README.md +205 -0
- package/archetypes/match3/assets/audio/cascade.wav +0 -0
- package/archetypes/match3/assets/audio/clear.wav +0 -0
- package/archetypes/match3/assets/audio/lost.wav +0 -0
- package/archetypes/match3/assets/audio/refused.wav +0 -0
- package/archetypes/match3/assets/audio/select.wav +0 -0
- package/archetypes/match3/assets/audio/swap.wav +0 -0
- package/archetypes/match3/assets/audio/won.wav +0 -0
- package/archetypes/match3/assets/fonts/OFL.txt +93 -0
- package/archetypes/match3/assets/fonts/ui.ttf +0 -0
- package/archetypes/match3/assets/fonts/ui.ttf.ogt +11 -0
- package/archetypes/match3/assets/scenes/main.ogt +24 -0
- package/archetypes/match3/assets/sprites/backdrop.png +0 -0
- package/archetypes/match3/assets/sprites/board.ogt +21 -0
- package/archetypes/match3/assets/sprites/cells.ogt +7 -0
- package/archetypes/match3/assets/sprites/cells.png +0 -0
- package/archetypes/match3/assets/sprites/cells.png.ogt +7 -0
- package/archetypes/match3/assets/sprites/gems.ogt +75 -0
- package/archetypes/match3/assets/sprites/gems.png +0 -0
- package/archetypes/match3/assets/sprites/panel.png +0 -0
- package/archetypes/match3/assets/sprites/ring.png +0 -0
- package/archetypes/match3/gitattributes +22 -0
- package/archetypes/match3/host.d.ts +46 -0
- package/archetypes/match3/package.json +18 -0
- package/archetypes/match3/project.ogt +18 -0
- package/archetypes/match3/references/metal/cascade.png +0 -0
- package/archetypes/match3/references/metal/clearing.png +0 -0
- package/archetypes/match3/references/metal/dealt.png +0 -0
- package/archetypes/match3/src/art.ts +54 -0
- package/archetypes/match3/src/board.ts +112 -0
- package/archetypes/match3/src/components.ts +95 -0
- package/archetypes/match3/src/layout.ts +25 -0
- package/archetypes/match3/src/main.ts +199 -0
- package/archetypes/match3/src/systems.ts +631 -0
- package/archetypes/match3/tests/drag.og.ts +31 -0
- package/archetypes/match3/tests/endings.og.ts +40 -0
- package/archetypes/match3/tests/frames.og.ts +49 -0
- package/archetypes/match3/tests/frames.ts +134 -0
- package/archetypes/match3/tests/hidpi.og.ts +41 -0
- package/archetypes/match3/tests/lib.ts +64 -0
- package/archetypes/match3/tests/replay.og.ts +28 -0
- package/archetypes/match3/tests/sounds.og.ts +50 -0
- package/archetypes/match3/tests/swap.og.ts +67 -0
- package/archetypes/match3/tools/make-assets.py +404 -0
- package/archetypes/match3/tools/oglite.py +285 -0
- package/archetypes/match3/tsconfig.json +17 -0
- package/archetypes/rhythm/.origin/setup +14 -0
- package/archetypes/rhythm/LICENSES.md +13 -0
- package/archetypes/rhythm/README.md +235 -0
- package/archetypes/rhythm/assets/audio/bass0.wav +0 -0
- package/archetypes/rhythm/assets/audio/bass1.wav +0 -0
- package/archetypes/rhythm/assets/audio/bass2.wav +0 -0
- package/archetypes/rhythm/assets/audio/bass3.wav +0 -0
- package/archetypes/rhythm/assets/audio/chords0.wav +0 -0
- package/archetypes/rhythm/assets/audio/chords1.wav +0 -0
- package/archetypes/rhythm/assets/audio/chords2.wav +0 -0
- package/archetypes/rhythm/assets/audio/chords3.wav +0 -0
- package/archetypes/rhythm/assets/audio/clear.wav +0 -0
- package/archetypes/rhythm/assets/audio/click.wav +0 -0
- package/archetypes/rhythm/assets/audio/drums.wav +0 -0
- package/archetypes/rhythm/assets/audio/fail.wav +0 -0
- package/archetypes/rhythm/assets/audio/leadA.wav +0 -0
- package/archetypes/rhythm/assets/audio/leadB.wav +0 -0
- package/archetypes/rhythm/assets/audio/miss.wav +0 -0
- package/archetypes/rhythm/assets/audio/tap0.wav +0 -0
- package/archetypes/rhythm/assets/audio/tap1.wav +0 -0
- package/archetypes/rhythm/assets/audio/tap2.wav +0 -0
- package/archetypes/rhythm/assets/audio/ui-close.ogt +9 -0
- package/archetypes/rhythm/assets/audio/ui-error.ogt +9 -0
- package/archetypes/rhythm/assets/audio/ui-open.ogt +9 -0
- package/archetypes/rhythm/assets/audio/ui-press.ogt +9 -0
- package/archetypes/rhythm/assets/audio/ui-success.ogt +9 -0
- package/archetypes/rhythm/assets/charts/neon-pulse.ogt +919 -0
- package/archetypes/rhythm/assets/fonts/NotoSansSC-subset.ttf +0 -0
- package/archetypes/rhythm/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
- package/archetypes/rhythm/assets/fonts/OFL.txt +93 -0
- package/archetypes/rhythm/assets/fx/hit.ogt +22 -0
- package/archetypes/rhythm/assets/skins/lanebeat/ChakraPetch-Medium.ttf +0 -0
- package/archetypes/rhythm/assets/skins/lanebeat/ChakraPetch-Medium.ttf.ogt +9 -0
- package/archetypes/rhythm/assets/skins/lanebeat/JetBrainsMono-Regular.ttf +0 -0
- package/archetypes/rhythm/assets/skins/lanebeat/JetBrainsMono-Regular.ttf.ogt +9 -0
- package/archetypes/rhythm/assets/skins/lanebeat/LICENSES.md +17 -0
- package/archetypes/rhythm/assets/skins/lanebeat/OFL.txt +95 -0
- package/archetypes/rhythm/assets/skins/lanebeat/Orbitron-Bold.ttf +0 -0
- package/archetypes/rhythm/assets/skins/lanebeat/Orbitron-Bold.ttf.ogt +9 -0
- package/archetypes/rhythm/assets/skins/lanebeat/atlas.png +0 -0
- package/archetypes/rhythm/assets/skins/lanebeat/atlas.png.ogt +7 -0
- package/archetypes/rhythm/assets/skins/lanebeat/icons.png +0 -0
- package/archetypes/rhythm/assets/skins/lanebeat/icons.png.ogt +7 -0
- package/archetypes/rhythm/assets/skins/lanebeat/skin.ogt +110 -0
- package/archetypes/rhythm/assets/sprites/lane.png +0 -0
- package/archetypes/rhythm/assets/sprites/lane.png.ogt +7 -0
- package/archetypes/rhythm/assets/sprites/note.png +0 -0
- package/archetypes/rhythm/assets/sprites/note.png.ogt +7 -0
- package/archetypes/rhythm/assets/sprites/ring.png +0 -0
- package/archetypes/rhythm/assets/sprites/ring.png.ogt +7 -0
- package/archetypes/rhythm/assets/sprites/spark.png +0 -0
- package/archetypes/rhythm/assets/sprites/spark.png.ogt +7 -0
- package/archetypes/rhythm/assets/strings/en.ogt +61 -0
- package/archetypes/rhythm/assets/strings/zh-CN.ogt +61 -0
- package/archetypes/rhythm/gitattributes +22 -0
- package/archetypes/rhythm/host.d.ts +46 -0
- package/archetypes/rhythm/package.json +18 -0
- package/archetypes/rhythm/project.ogt +14 -0
- package/archetypes/rhythm/references/metal/highway.png +0 -0
- package/archetypes/rhythm/references/metal/results.png +0 -0
- package/archetypes/rhythm/references/metal/title.png +0 -0
- package/archetypes/rhythm/src/components.ts +147 -0
- package/archetypes/rhythm/src/main.ts +202 -0
- package/archetypes/rhythm/src/systems.ts +490 -0
- package/archetypes/rhythm/src/ui.ts +421 -0
- package/archetypes/rhythm/tests/band.og.ts +45 -0
- package/archetypes/rhythm/tests/calibrate.og.ts +49 -0
- package/archetypes/rhythm/tests/clear.og.ts +51 -0
- package/archetypes/rhythm/tests/fail.og.ts +40 -0
- package/archetypes/rhythm/tests/flow.og.ts +54 -0
- package/archetypes/rhythm/tests/frames.og.ts +35 -0
- package/archetypes/rhythm/tests/frames.ts +134 -0
- package/archetypes/rhythm/tests/lib.ts +123 -0
- package/archetypes/rhythm/tests/pad.og.ts +41 -0
- package/archetypes/rhythm/tests/pause.og.ts +77 -0
- package/archetypes/rhythm/tests/phone.og.ts +44 -0
- package/archetypes/rhythm/tests/replay.og.ts +27 -0
- package/archetypes/rhythm/tests/timing.og.ts +37 -0
- package/archetypes/rhythm/tools/make-assets.py +383 -0
- package/archetypes/rhythm/tools/oglite.py +285 -0
- package/archetypes/rhythm/tsconfig.json +17 -0
- package/archetypes/roguelike/.origin/setup +14 -0
- package/archetypes/roguelike/LICENSES.md +14 -0
- package/archetypes/roguelike/README.md +256 -0
- package/archetypes/roguelike/assets/ai/foe.ogt +28 -0
- package/archetypes/roguelike/assets/ai/guardian.ogt +26 -0
- package/archetypes/roguelike/assets/audio/bump.wav +0 -0
- package/archetypes/roguelike/assets/audio/drink.wav +0 -0
- package/archetypes/roguelike/assets/audio/fall.wav +0 -0
- package/archetypes/roguelike/assets/audio/hit.wav +0 -0
- package/archetypes/roguelike/assets/audio/hurt.wav +0 -0
- package/archetypes/roguelike/assets/audio/item.wav +0 -0
- package/archetypes/roguelike/assets/audio/kill.wav +0 -0
- package/archetypes/roguelike/assets/audio/pickup.wav +0 -0
- package/archetypes/roguelike/assets/audio/roar.wav +0 -0
- package/archetypes/roguelike/assets/audio/stairs.wav +0 -0
- package/archetypes/roguelike/assets/audio/step.ogt +9 -0
- package/archetypes/roguelike/assets/audio/telegraph.wav +0 -0
- package/archetypes/roguelike/assets/audio/tomb.wav +0 -0
- package/archetypes/roguelike/assets/audio/ui-close.ogt +9 -0
- package/archetypes/roguelike/assets/audio/ui-error.ogt +9 -0
- package/archetypes/roguelike/assets/audio/ui-open.ogt +9 -0
- package/archetypes/roguelike/assets/audio/ui-press.ogt +9 -0
- package/archetypes/roguelike/assets/audio/ui-success.ogt +9 -0
- package/archetypes/roguelike/assets/audio/won.wav +0 -0
- package/archetypes/roguelike/assets/fonts/NotoSansSC-subset.ttf +0 -0
- package/archetypes/roguelike/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
- package/archetypes/roguelike/assets/fonts/OFL.txt +93 -0
- package/archetypes/roguelike/assets/maps/dive.ogt +106 -0
- package/archetypes/roguelike/assets/skins/lampdive/DotGothic16-Regular.ttf +0 -0
- package/archetypes/roguelike/assets/skins/lampdive/DotGothic16-Regular.ttf.ogt +9 -0
- package/archetypes/roguelike/assets/skins/lampdive/LICENSES.md +16 -0
- package/archetypes/roguelike/assets/skins/lampdive/OFL.txt +93 -0
- package/archetypes/roguelike/assets/skins/lampdive/atlas.png +0 -0
- package/archetypes/roguelike/assets/skins/lampdive/atlas.png.ogt +7 -0
- package/archetypes/roguelike/assets/skins/lampdive/icons.png +0 -0
- package/archetypes/roguelike/assets/skins/lampdive/icons.png.ogt +7 -0
- package/archetypes/roguelike/assets/skins/lampdive/skin.ogt +115 -0
- package/archetypes/roguelike/assets/sprites/dive.ogt +50 -0
- package/archetypes/roguelike/assets/sprites/dive.png +0 -0
- package/archetypes/roguelike/assets/sprites/dive.png.ogt +7 -0
- package/archetypes/roguelike/assets/sprites/glow.png +0 -0
- package/archetypes/roguelike/assets/sprites/glow.png.ogt +7 -0
- package/archetypes/roguelike/assets/strings/en.ogt +57 -0
- package/archetypes/roguelike/assets/strings/zh-CN.ogt +57 -0
- package/archetypes/roguelike/assets/tiles/tomb.ogt +31 -0
- package/archetypes/roguelike/assets/tiles/tomb.png +0 -0
- package/archetypes/roguelike/assets/tiles/tomb.png.ogt +7 -0
- package/archetypes/roguelike/gitattributes +22 -0
- package/archetypes/roguelike/host.d.ts +46 -0
- package/archetypes/roguelike/package.json +18 -0
- package/archetypes/roguelike/project.ogt +14 -0
- package/archetypes/roguelike/references/metal/dive.png +0 -0
- package/archetypes/roguelike/references/metal/over.png +0 -0
- package/archetypes/roguelike/references/metal/title.png +0 -0
- package/archetypes/roguelike/src/art.ts +23 -0
- package/archetypes/roguelike/src/components.ts +169 -0
- package/archetypes/roguelike/src/dive.ts +144 -0
- package/archetypes/roguelike/src/foes.ts +174 -0
- package/archetypes/roguelike/src/main.ts +258 -0
- package/archetypes/roguelike/src/systems.ts +620 -0
- package/archetypes/roguelike/src/ui.ts +350 -0
- package/archetypes/roguelike/tests/flow.og.ts +54 -0
- package/archetypes/roguelike/tests/foes.og.ts +45 -0
- package/archetypes/roguelike/tests/frames.og.ts +32 -0
- package/archetypes/roguelike/tests/frames.ts +134 -0
- package/archetypes/roguelike/tests/lib.ts +83 -0
- package/archetypes/roguelike/tests/lose.og.ts +44 -0
- package/archetypes/roguelike/tests/pad.og.ts +54 -0
- package/archetypes/roguelike/tests/pause.og.ts +59 -0
- package/archetypes/roguelike/tests/phone.og.ts +54 -0
- package/archetypes/roguelike/tests/replay.og.ts +24 -0
- package/archetypes/roguelike/tests/win.og.ts +60 -0
- package/archetypes/roguelike/tools/make-assets.py +518 -0
- package/archetypes/roguelike/tools/oglite.py +285 -0
- package/archetypes/roguelike/tsconfig.json +17 -0
- package/archetypes/runner/.origin/setup +14 -0
- package/archetypes/runner/LICENSES.md +10 -0
- package/archetypes/runner/README.md +225 -0
- package/archetypes/runner/assets/audio/coin.wav +0 -0
- package/archetypes/runner/assets/audio/crash.wav +0 -0
- package/archetypes/runner/assets/audio/hold.ogt +9 -0
- package/archetypes/runner/assets/audio/jump.wav +0 -0
- package/archetypes/runner/assets/audio/start.wav +0 -0
- package/archetypes/runner/assets/fonts/OFL.txt +93 -0
- package/archetypes/runner/assets/fonts/ui.ttf +0 -0
- package/archetypes/runner/assets/fonts/ui.ttf.ogt +11 -0
- package/archetypes/runner/assets/maps/far.ogt +25 -0
- package/archetypes/runner/assets/maps/near.ogt +25 -0
- package/archetypes/runner/assets/maps/roofs.ogt +19 -0
- package/archetypes/runner/assets/scenes/main.ogt +35 -0
- package/archetypes/runner/assets/sprites/coin.ogt +11 -0
- package/archetypes/runner/assets/sprites/coin.png +0 -0
- package/archetypes/runner/assets/sprites/coin.png.ogt +7 -0
- package/archetypes/runner/assets/sprites/courier.ogt +32 -0
- package/archetypes/runner/assets/sprites/courier.png +0 -0
- package/archetypes/runner/assets/sprites/courier.png.ogt +7 -0
- package/archetypes/runner/assets/sprites/props.ogt +21 -0
- package/archetypes/runner/assets/sprites/props.png +0 -0
- package/archetypes/runner/assets/sprites/props.png.ogt +7 -0
- package/archetypes/runner/assets/sprites/sky.png +0 -0
- package/archetypes/runner/assets/sprites/sky.png.ogt +7 -0
- package/archetypes/runner/assets/tiles/city.ogt +18 -0
- package/archetypes/runner/assets/tiles/city.png +0 -0
- package/archetypes/runner/assets/tiles/city.png.ogt +7 -0
- package/archetypes/runner/gitattributes +22 -0
- package/archetypes/runner/host.d.ts +46 -0
- package/archetypes/runner/package.json +18 -0
- package/archetypes/runner/project.ogt +18 -0
- package/archetypes/runner/references/metal/frames-coin.png +0 -0
- package/archetypes/runner/references/metal/frames-crash.png +0 -0
- package/archetypes/runner/references/metal/frames-title.png +0 -0
- package/archetypes/runner/src/art.ts +57 -0
- package/archetypes/runner/src/components.ts +94 -0
- package/archetypes/runner/src/main.ts +241 -0
- package/archetypes/runner/src/systems.ts +553 -0
- package/archetypes/runner/tests/coins.og.ts +30 -0
- package/archetypes/runner/tests/flow.og.ts +72 -0
- package/archetypes/runner/tests/frames.og.ts +37 -0
- package/archetypes/runner/tests/frames.ts +134 -0
- package/archetypes/runner/tests/jump.og.ts +44 -0
- package/archetypes/runner/tests/lib.ts +42 -0
- package/archetypes/runner/tests/records.og.ts +43 -0
- package/archetypes/runner/tests/replay.og.ts +36 -0
- package/archetypes/runner/tests/sounds.og.ts +43 -0
- package/archetypes/runner/tests/tune.og.ts +36 -0
- package/archetypes/runner/tools/make-assets.py +603 -0
- package/archetypes/runner/tools/oglite.py +285 -0
- package/archetypes/runner/tsconfig.json +17 -0
- package/archetypes/third-person/.origin/setup +14 -0
- package/archetypes/third-person/LICENSES.md +23 -0
- package/archetypes/third-person/README.md +249 -0
- package/archetypes/third-person/assets/ai/sentinel-east.ogt +69 -0
- package/archetypes/third-person/assets/ai/sentinel-north.ogt +69 -0
- package/archetypes/third-person/assets/ai/sentinel-west.ogt +69 -0
- package/archetypes/third-person/assets/anims/humanoid-clips.glb +0 -0
- package/archetypes/third-person/assets/audio/alarm.wav +0 -0
- package/archetypes/third-person/assets/audio/dawn.wav +0 -0
- package/archetypes/third-person/assets/audio/grab.wav +0 -0
- package/archetypes/third-person/assets/audio/ignite.wav +0 -0
- package/archetypes/third-person/assets/audio/jump.wav +0 -0
- package/archetypes/third-person/assets/audio/night.wav +0 -0
- package/archetypes/third-person/assets/audio/splash.wav +0 -0
- package/archetypes/third-person/assets/audio/step.ogt +9 -0
- package/archetypes/third-person/assets/audio/ui-close.ogt +9 -0
- package/archetypes/third-person/assets/audio/ui-error.ogt +9 -0
- package/archetypes/third-person/assets/audio/ui-open.ogt +9 -0
- package/archetypes/third-person/assets/audio/ui-press.ogt +9 -0
- package/archetypes/third-person/assets/audio/ui-success.ogt +9 -0
- package/archetypes/third-person/assets/audio/vale.wav +0 -0
- package/archetypes/third-person/assets/fonts/NotoSansSC-subset.ttf +0 -0
- package/archetypes/third-person/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
- package/archetypes/third-person/assets/fonts/OFL.txt +93 -0
- package/archetypes/third-person/assets/fx/burst.ogt +25 -0
- package/archetypes/third-person/assets/fx/fire.ogt +24 -0
- package/archetypes/third-person/assets/fx/smoke.ogt +24 -0
- package/archetypes/third-person/assets/fx/splash.ogt +24 -0
- package/archetypes/third-person/assets/luts/teal-orange.cube +4917 -0
- package/archetypes/third-person/assets/models/stout.glb +0 -0
- package/archetypes/third-person/assets/models/strider.glb +0 -0
- package/archetypes/third-person/assets/models/strider.glb.ogt +9 -0
- package/archetypes/third-person/assets/nav/vale.ogt +43 -0
- package/archetypes/third-person/assets/rigs/strider.ogt +6 -0
- package/archetypes/third-person/assets/skins/ember/Cinzel-Bold.ttf +0 -0
- package/archetypes/third-person/assets/skins/ember/Cinzel-Bold.ttf.ogt +9 -0
- package/archetypes/third-person/assets/skins/ember/LICENSES.md +13 -0
- package/archetypes/third-person/assets/skins/ember/Newsreader-Medium.ttf +0 -0
- package/archetypes/third-person/assets/skins/ember/Newsreader-Medium.ttf.ogt +9 -0
- package/archetypes/third-person/assets/skins/ember/OFL.txt +94 -0
- package/archetypes/third-person/assets/skins/ember/atlas.png +0 -0
- package/archetypes/third-person/assets/skins/ember/atlas.png.ogt +7 -0
- package/archetypes/third-person/assets/skins/ember/icons.png +0 -0
- package/archetypes/third-person/assets/skins/ember/icons.png.ogt +7 -0
- package/archetypes/third-person/assets/skins/ember/skin.ogt +109 -0
- package/archetypes/third-person/assets/strings/en.ogt +47 -0
- package/archetypes/third-person/assets/strings/zh-CN.ogt +47 -0
- package/archetypes/third-person/assets/terrain/vale-control.png +0 -0
- package/archetypes/third-person/assets/terrain/vale.ogt +42 -0
- package/archetypes/third-person/assets/terrain/vale.png +0 -0
- package/archetypes/third-person/assets/textures/decals.png +0 -0
- package/archetypes/third-person/assets/textures/flame.png +0 -0
- package/archetypes/third-person/assets/textures/smoke.png +0 -0
- package/archetypes/third-person/assets/textures/spark.png +0 -0
- package/archetypes/third-person/assets/textures/terrain-grass.png +0 -0
- package/archetypes/third-person/assets/textures/terrain-path.png +0 -0
- package/archetypes/third-person/assets/textures/terrain-rock.png +0 -0
- package/archetypes/third-person/assets/textures/terrain-sand.png +0 -0
- package/archetypes/third-person/gitattributes +22 -0
- package/archetypes/third-person/host.d.ts +46 -0
- package/archetypes/third-person/package.json +18 -0
- package/archetypes/third-person/project.ogt +14 -0
- package/archetypes/third-person/references/metal/beacon.png +0 -0
- package/archetypes/third-person/references/metal/dawn.png +0 -0
- package/archetypes/third-person/references/metal/title.png +0 -0
- package/archetypes/third-person/references/webgl2/beacon.png +0 -0
- package/archetypes/third-person/src/anim.ts +87 -0
- package/archetypes/third-person/src/beacons.ts +80 -0
- package/archetypes/third-person/src/components.ts +148 -0
- package/archetypes/third-person/src/hero.ts +293 -0
- package/archetypes/third-person/src/main.ts +164 -0
- package/archetypes/third-person/src/sentinels.ts +159 -0
- package/archetypes/third-person/src/sound.ts +66 -0
- package/archetypes/third-person/src/ui.ts +451 -0
- package/archetypes/third-person/src/world.ts +212 -0
- package/archetypes/third-person/tests/flow.og.ts +70 -0
- package/archetypes/third-person/tests/frames.og.ts +35 -0
- package/archetypes/third-person/tests/frames.ts +134 -0
- package/archetypes/third-person/tests/hitstop.og.ts +26 -0
- package/archetypes/third-person/tests/lib.ts +87 -0
- package/archetypes/third-person/tests/lose.og.ts +44 -0
- package/archetypes/third-person/tests/pause.og.ts +64 -0
- package/archetypes/third-person/tests/phone.og.ts +65 -0
- package/archetypes/third-person/tests/replay.og.ts +32 -0
- package/archetypes/third-person/tests/restart.og.ts +28 -0
- package/archetypes/third-person/tests/sentinels.og.ts +48 -0
- package/archetypes/third-person/tests/win.og.ts +62 -0
- package/archetypes/third-person/tools/make-assets.py +353 -0
- package/archetypes/third-person/tools/oglite.py +285 -0
- package/archetypes/third-person/tsconfig.json +17 -0
- package/archetypes/topdown/.origin/setup +14 -0
- package/archetypes/topdown/LICENSES.md +10 -0
- package/archetypes/topdown/README.md +235 -0
- package/archetypes/topdown/assets/ai/slime.ogt +49 -0
- package/archetypes/topdown/assets/audio/coin.wav +0 -0
- package/archetypes/topdown/assets/audio/door.wav +0 -0
- package/archetypes/topdown/assets/audio/hit.wav +0 -0
- package/archetypes/topdown/assets/audio/hurt.wav +0 -0
- package/archetypes/topdown/assets/audio/key.wav +0 -0
- package/archetypes/topdown/assets/audio/step.ogt +9 -0
- package/archetypes/topdown/assets/fonts/OFL.txt +93 -0
- package/archetypes/topdown/assets/fonts/ui.ttf +0 -0
- package/archetypes/topdown/assets/fonts/ui.ttf.ogt +9 -0
- package/archetypes/topdown/assets/maps/tomb.tmj +2183 -0
- package/archetypes/topdown/assets/sprites/hero.ogt +58 -0
- package/archetypes/topdown/assets/sprites/hero.png +0 -0
- package/archetypes/topdown/assets/sprites/hero.png.ogt +7 -0
- package/archetypes/topdown/assets/sprites/items.ogt +15 -0
- package/archetypes/topdown/assets/sprites/items.png +0 -0
- package/archetypes/topdown/assets/sprites/items.png.ogt +7 -0
- package/archetypes/topdown/assets/sprites/slime.ogt +17 -0
- package/archetypes/topdown/assets/sprites/slime.png +0 -0
- package/archetypes/topdown/assets/sprites/slime.png.ogt +7 -0
- package/archetypes/topdown/assets/tiles/dungeon.ogt +65 -0
- package/archetypes/topdown/assets/tiles/dungeon.png +0 -0
- package/archetypes/topdown/assets/tiles/dungeon.png.ogt +7 -0
- package/archetypes/topdown/gitattributes +22 -0
- package/archetypes/topdown/host.d.ts +46 -0
- package/archetypes/topdown/package.json +18 -0
- package/archetypes/topdown/project.ogt +14 -0
- package/archetypes/topdown/references/metal/crit.png +0 -0
- package/archetypes/topdown/references/metal/dash.png +0 -0
- package/archetypes/topdown/references/metal/east.png +0 -0
- package/archetypes/topdown/references/metal/start.png +0 -0
- package/archetypes/topdown/src/art.ts +48 -0
- package/archetypes/topdown/src/components.ts +128 -0
- package/archetypes/topdown/src/main.ts +275 -0
- package/archetypes/topdown/src/systems.ts +503 -0
- package/archetypes/topdown/tests/ai.og.ts +64 -0
- package/archetypes/topdown/tests/combat.og.ts +72 -0
- package/archetypes/topdown/tests/door.og.ts +62 -0
- package/archetypes/topdown/tests/flee.og.ts +49 -0
- package/archetypes/topdown/tests/frames.og.ts +45 -0
- package/archetypes/topdown/tests/frames.ts +134 -0
- package/archetypes/topdown/tests/lib.ts +71 -0
- package/archetypes/topdown/tests/replay.og.ts +40 -0
- package/archetypes/topdown/tests/walk.og.ts +46 -0
- package/archetypes/topdown/tools/make-assets.py +623 -0
- package/archetypes/topdown/tools/oglite.py +285 -0
- package/archetypes/topdown/tsconfig.json +17 -0
- package/archetypes/tower-defense/.origin/setup +14 -0
- package/archetypes/tower-defense/LICENSES.md +15 -0
- package/archetypes/tower-defense/README.md +240 -0
- package/archetypes/tower-defense/assets/ai/plant.ogt +16 -0
- package/archetypes/tower-defense/assets/audio/clear.wav +0 -0
- package/archetypes/tower-defense/assets/audio/frost.wav +0 -0
- package/archetypes/tower-defense/assets/audio/leak.wav +0 -0
- package/archetypes/tower-defense/assets/audio/lost.wav +0 -0
- package/archetypes/tower-defense/assets/audio/night.wav +0 -0
- package/archetypes/tower-defense/assets/audio/plant.wav +0 -0
- package/archetypes/tower-defense/assets/audio/pop.wav +0 -0
- package/archetypes/tower-defense/assets/audio/thorn.wav +0 -0
- package/archetypes/tower-defense/assets/audio/ui-close.ogt +9 -0
- package/archetypes/tower-defense/assets/audio/ui-error.ogt +9 -0
- package/archetypes/tower-defense/assets/audio/ui-open.ogt +9 -0
- package/archetypes/tower-defense/assets/audio/ui-press.ogt +9 -0
- package/archetypes/tower-defense/assets/audio/ui-success.ogt +9 -0
- package/archetypes/tower-defense/assets/audio/wave.wav +0 -0
- package/archetypes/tower-defense/assets/audio/won.wav +0 -0
- package/archetypes/tower-defense/assets/fonts/NotoSansSC-subset.ttf +0 -0
- package/archetypes/tower-defense/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
- package/archetypes/tower-defense/assets/fonts/OFL.txt +93 -0
- package/archetypes/tower-defense/assets/fx/fireflies.ogt +21 -0
- package/archetypes/tower-defense/assets/fx/pop.ogt +21 -0
- package/archetypes/tower-defense/assets/maps/garden.ogt +91 -0
- package/archetypes/tower-defense/assets/skins/pathguard/Fredoka-SemiBold.ttf +0 -0
- package/archetypes/tower-defense/assets/skins/pathguard/Fredoka-SemiBold.ttf.ogt +9 -0
- package/archetypes/tower-defense/assets/skins/pathguard/LICENSES.md +13 -0
- package/archetypes/tower-defense/assets/skins/pathguard/LilitaOne-Regular.ttf +0 -0
- package/archetypes/tower-defense/assets/skins/pathguard/LilitaOne-Regular.ttf.ogt +9 -0
- package/archetypes/tower-defense/assets/skins/pathguard/OFL.txt +94 -0
- package/archetypes/tower-defense/assets/skins/pathguard/atlas.png +0 -0
- package/archetypes/tower-defense/assets/skins/pathguard/atlas.png.ogt +7 -0
- package/archetypes/tower-defense/assets/skins/pathguard/icons.png +0 -0
- package/archetypes/tower-defense/assets/skins/pathguard/icons.png.ogt +7 -0
- package/archetypes/tower-defense/assets/skins/pathguard/skin.ogt +111 -0
- package/archetypes/tower-defense/assets/sprites/garden.ogt +66 -0
- package/archetypes/tower-defense/assets/sprites/garden.png +0 -0
- package/archetypes/tower-defense/assets/sprites/garden.png.ogt +7 -0
- package/archetypes/tower-defense/assets/sprites/glow.png +0 -0
- package/archetypes/tower-defense/assets/sprites/glow.png.ogt +7 -0
- package/archetypes/tower-defense/assets/sprites/ring.png +0 -0
- package/archetypes/tower-defense/assets/sprites/ring.png.ogt +7 -0
- package/archetypes/tower-defense/assets/sprites/spark.png +0 -0
- package/archetypes/tower-defense/assets/sprites/spark.png.ogt +7 -0
- package/archetypes/tower-defense/assets/strings/en.ogt +47 -0
- package/archetypes/tower-defense/assets/strings/zh-CN.ogt +47 -0
- package/archetypes/tower-defense/assets/tiles/garden.ogt +10 -0
- package/archetypes/tower-defense/assets/tiles/garden.png +0 -0
- package/archetypes/tower-defense/assets/tiles/garden.png.ogt +7 -0
- package/archetypes/tower-defense/gitattributes +22 -0
- package/archetypes/tower-defense/host.d.ts +46 -0
- package/archetypes/tower-defense/package.json +18 -0
- package/archetypes/tower-defense/project.ogt +14 -0
- package/archetypes/tower-defense/references/metal/end.png +0 -0
- package/archetypes/tower-defense/references/metal/title.png +0 -0
- package/archetypes/tower-defense/references/metal/wave.png +0 -0
- package/archetypes/tower-defense/src/art.ts +24 -0
- package/archetypes/tower-defense/src/components.ts +156 -0
- package/archetypes/tower-defense/src/main.ts +253 -0
- package/archetypes/tower-defense/src/systems.ts +658 -0
- package/archetypes/tower-defense/src/ui.ts +382 -0
- package/archetypes/tower-defense/tests/flow.og.ts +56 -0
- package/archetypes/tower-defense/tests/frames.og.ts +31 -0
- package/archetypes/tower-defense/tests/frames.ts +134 -0
- package/archetypes/tower-defense/tests/lib.ts +81 -0
- package/archetypes/tower-defense/tests/lose.og.ts +40 -0
- package/archetypes/tower-defense/tests/maze.og.ts +53 -0
- package/archetypes/tower-defense/tests/pad.og.ts +41 -0
- package/archetypes/tower-defense/tests/pause.og.ts +59 -0
- package/archetypes/tower-defense/tests/phone.og.ts +49 -0
- package/archetypes/tower-defense/tests/replay.og.ts +28 -0
- package/archetypes/tower-defense/tests/win.og.ts +58 -0
- package/archetypes/tower-defense/tools/make-assets.py +640 -0
- package/archetypes/tower-defense/tools/oglite.py +285 -0
- package/archetypes/tower-defense/tsconfig.json +17 -0
- package/bin/create.ts +496 -0
- package/looks/catalogue.json +1871 -0
- package/package.json +31 -4
- package/template/.origin/setup +14 -0
- package/template/LICENSES.md +23 -0
- package/template/README.md +37 -0
- package/template/assets/ai/guard.ogt +48 -0
- package/template/assets/audio/blip.wav +0 -0
- package/template/assets/audio/click.ogt +9 -0
- package/template/assets/fonts/NotoSansSC-Regular-subset.ttf +0 -0
- package/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
- package/template/assets/fonts/OFL.txt +93 -0
- package/template/assets/looks/origin-game.ogt +12 -0
- package/template/assets/models/dropship.glb +0 -0
- package/template/assets/models/walker.glb +0 -0
- package/template/assets/nav/yard.ogt +27 -0
- package/template/assets/scenes/main.ogt +34 -0
- package/template/assets/strings/en.ogt +14 -0
- package/template/assets/textures/stone.png +0 -0
- package/template/assets/textures/stone_n.png +0 -0
- package/template/assets/textures/stone_n.png.ogt +7 -0
- package/template/gitattributes +22 -0
- package/template/package.json +18 -0
- package/template/project.ogt +25 -0
- package/template/src/main.ts +246 -0
- package/template/tests/guard.og.ts +67 -0
- package/template/tests/smoke.og.ts +43 -0
- package/template/tsconfig.json +17 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Ember Vale, the third-person archetype (3D profile): dusk is falling on
|
|
2
|
+
// a lake vale and four beacons stand dark on its knolls. Walk, run, wade
|
|
3
|
+
// and jump the strider there (og.CharacterController on the terrain), hold
|
|
4
|
+
// F by a beacon to kindle it (the hand reaches into the bowl through an
|
|
5
|
+
// og.IkChain) and light all four before night. Three stone sentinels walk
|
|
6
|
+
// their rounds on the navmesh (og.nav) and think with behaviour trees
|
|
7
|
+
// (og.ai): one that sees you calls the alarm and runs you down, and its
|
|
8
|
+
// grab costs a heart. Three hearts gone, or night, ends the run; every
|
|
9
|
+
// beacon lit wins it. Then the summary, and again.
|
|
10
|
+
//
|
|
11
|
+
// `start` loads the strings, the skin and the sounds, builds the vale
|
|
12
|
+
// (src/world.ts) and spawns the hero (src/hero.ts), the sentinels
|
|
13
|
+
// (src/sentinels.ts) and the voices (src/sound.ts). The beacons are in
|
|
14
|
+
// src/beacons.ts, the screens and the run's clock in src/ui.ts and the
|
|
15
|
+
// state in src/components.ts.
|
|
16
|
+
|
|
17
|
+
import { og } from "@origingame/engine";
|
|
18
|
+
import type { World } from "@origingame/engine";
|
|
19
|
+
import { BEACONS, Game, Phase, Prefs, Tuning } from "./components.ts";
|
|
20
|
+
import { Beacons, catchBeacon } from "./beacons.ts";
|
|
21
|
+
import { FEET, HeroMove, spawnHero, STAND, View } from "./hero.ts";
|
|
22
|
+
import { alarm, grab, Sentinels, SENTINELS, spawnSentinels } from "./sentinels.ts";
|
|
23
|
+
import { spawnVoices, Voices } from "./sound.ts";
|
|
24
|
+
import { LANGUAGES, startRun, toTitle, Ui } from "./ui.ts";
|
|
25
|
+
import { BEACON_AT, buildVale, ground, HOURS, must, setHour } from "./world.ts";
|
|
26
|
+
|
|
27
|
+
function start(world: World): void {
|
|
28
|
+
for (const l of LANGUAGES) must(og.i18n.load(world, `strings/${l.code}.ogt`));
|
|
29
|
+
const skin = must(og.load.skin(world, "skins/ember/skin.ogt"));
|
|
30
|
+
const sound = (path: string) => must(og.load.sound(world, path));
|
|
31
|
+
must(og.ui.configure(world, { skin, sounds: { press: sound("audio/ui-press.ogt"), open: sound("audio/ui-open.ogt"), close: sound("audio/ui-close.ogt"), error: sound("audio/ui-error.ogt"), success: sound("audio/ui-success.ogt") } }));
|
|
32
|
+
buildVale(world);
|
|
33
|
+
spawnHero(world);
|
|
34
|
+
spawnSentinels(world);
|
|
35
|
+
spawnVoices(world);
|
|
36
|
+
// Behind the title the vale is reset and its beacons burn.
|
|
37
|
+
toTitle(world, gameOf(world));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function gameOf(world: World) {
|
|
41
|
+
return must(world.resource(Game));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function num(s: string | undefined, what: string): number {
|
|
45
|
+
const n = Number(s);
|
|
46
|
+
if (s === undefined || !Number.isFinite(n)) throw new Error(`${what} is a number`);
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** `run`: start a run now, as Set out on the title does. */
|
|
51
|
+
function run(world: World): void {
|
|
52
|
+
startRun(world, gameOf(world));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** `warp:<beacon>` or `warp:<x>:<z>`: put the hero by a beacon (facing it) or on the ground at x, z. */
|
|
56
|
+
function warp(world: World, args: readonly string[]): void {
|
|
57
|
+
const g = gameOf(world);
|
|
58
|
+
let x: number;
|
|
59
|
+
let z: number;
|
|
60
|
+
if (args.length === 1) {
|
|
61
|
+
const b = BEACON_AT[num(args[0], "beacon")];
|
|
62
|
+
if (b === undefined) throw new Error(`beacons are 0 to ${BEACONS - 1}`);
|
|
63
|
+
// Where the hero stands to kindle it: STAND short of its centre, on the side of the lake.
|
|
64
|
+
const len = Math.hypot(b.x, b.z + 6);
|
|
65
|
+
x = b.x - (b.x / len) * STAND;
|
|
66
|
+
z = b.z - ((b.z + 6) / len) * STAND;
|
|
67
|
+
g.facing = Math.atan2(b.x - x, b.z - z);
|
|
68
|
+
} else {
|
|
69
|
+
x = num(args[0], "x");
|
|
70
|
+
z = num(args[1], "z");
|
|
71
|
+
}
|
|
72
|
+
const h = ground(world, g, x, z).height;
|
|
73
|
+
must(world.set(g.hero as unknown as never, og.Transform, { position: { x, y: h + FEET + 0.05, z } }));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** `light:<beacon>`: the beacon catches now, as kindling it does. */
|
|
77
|
+
function light(world: World, args: readonly string[]): void {
|
|
78
|
+
const g = gameOf(world);
|
|
79
|
+
if (g.phase !== Phase.Play) throw new Error("light needs a run (write run first)");
|
|
80
|
+
const i = num(args[0], "beacon");
|
|
81
|
+
if (i < 0 || i >= BEACONS) throw new Error(`beacons are 0 to ${BEACONS - 1}`);
|
|
82
|
+
catchBeacon(world, g, i);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** `hearts:<n>`: set the hearts left (0 ends the run, caught). */
|
|
86
|
+
function hearts(world: World, args: readonly string[]): void {
|
|
87
|
+
gameOf(world).hearts = num(args[0], "n");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** `dusk:<seconds>`: jump the run's clock to this many seconds played (night at Tuning.duskSeconds). */
|
|
91
|
+
function dusk(world: World, args: readonly string[]): void {
|
|
92
|
+
const g = gameOf(world);
|
|
93
|
+
g.time = num(args[0], "seconds");
|
|
94
|
+
if (g.phase === Phase.Title) setHour(world, HOURS.title);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** `viewport:<desktop|phone>`: lay the UI out for a phone in portrait. */
|
|
98
|
+
function viewport(world: World, args: readonly string[]): void {
|
|
99
|
+
const phone = { width: 390, height: 844, dpr: 3, safeArea: { left: 0, top: 47, right: 0, bottom: 34 }, coarsePointer: true, breakpoint: "phonePortrait" } as const;
|
|
100
|
+
og.ui.previewViewport(world, args[0] === "phone" ? phone : null);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** `language:<en|zh-CN>`. */
|
|
104
|
+
function language(world: World, args: readonly string[]): void {
|
|
105
|
+
const p = must(world.resource(Prefs));
|
|
106
|
+
const at = LANGUAGES.findIndex((l) => l.code === args[0]);
|
|
107
|
+
if (at < 0) throw new Error("write language:<en|zh-CN>");
|
|
108
|
+
p.language = at;
|
|
109
|
+
og.i18n.setLocale(world, LANGUAGES[at]!.code);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** `stale_record`: another device writes the record (the next write here is refused as stale and merged). */
|
|
113
|
+
function staleRecord(world: World): void {
|
|
114
|
+
must(og.platform.storeSet(world, { key: "record", value: { runs: 9, wins: 3, best: 200 } }));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export default og.game({
|
|
118
|
+
tick: 60,
|
|
119
|
+
seed: 1,
|
|
120
|
+
resources: [Game, Tuning, Prefs],
|
|
121
|
+
systems: [...og.systems.cameras, Ui, HeroMove, View, Sentinels, Beacons, Voices],
|
|
122
|
+
start,
|
|
123
|
+
commands: { run, warp, light, hearts, dusk, viewport, language, stale_record: staleRecord, alarm, grab },
|
|
124
|
+
commandHelp: {
|
|
125
|
+
run: { usage: "", doc: "Start a run now, as Set out does." },
|
|
126
|
+
warp: { usage: "<beacon> | <x>:<z>", doc: "Put the hero where it kindles a beacon (0 to 3), or on the ground at x, z." },
|
|
127
|
+
light: { usage: "<beacon>", doc: "The beacon catches now, as kindling it does (the fourth wins)." },
|
|
128
|
+
hearts: { usage: "<n>", doc: "Set the hearts left (0: the sentinels caught you)." },
|
|
129
|
+
dusk: { usage: "<seconds>", doc: "Jump the run's clock to this many seconds played (night falls at Tuning.duskSeconds)." },
|
|
130
|
+
viewport: { usage: "<desktop|phone>", doc: "Lay the UI out for a phone in portrait (390×844 at 3×)." },
|
|
131
|
+
language: { usage: "<en|zh-CN>", doc: "Switch the language as the settings do." },
|
|
132
|
+
stale_record: { usage: "", doc: "Another device writes the record, so this one's next write is refused as stale and merged." },
|
|
133
|
+
alarm: { usage: "<sentinel>", doc: "A sentinel (0 to 2: west, north, east; og.ai sends its entity) calls the alarm (its behaviour raises it on sight)." },
|
|
134
|
+
grab: { usage: "<sentinel>", doc: "A sentinel's grab (0 to 2: west, north, east; og.ai sends its entity; its behaviour raises it within reach): a heart, unless the hero is out of reach or was just grabbed." },
|
|
135
|
+
},
|
|
136
|
+
facts: (world) => {
|
|
137
|
+
const game = world.resource(Game);
|
|
138
|
+
if (!game.ok) return null;
|
|
139
|
+
const g = game.value;
|
|
140
|
+
return {
|
|
141
|
+
phase: ["title", "play", "over"][g.phase],
|
|
142
|
+
ending: ["none", "dawn", "night", "caught"][g.ending],
|
|
143
|
+
hearts: g.hearts,
|
|
144
|
+
lit: g.lit,
|
|
145
|
+
litMask: g.litMask,
|
|
146
|
+
time: Math.round(g.time * 10) / 10,
|
|
147
|
+
hour: Math.round(g.hour * 100) / 100,
|
|
148
|
+
near: g.near,
|
|
149
|
+
kindle: Math.round(g.kindle * 100) / 100,
|
|
150
|
+
wading: g.wading,
|
|
151
|
+
grounded: g.grounded,
|
|
152
|
+
speed: Math.round(g.speed * 100) / 100,
|
|
153
|
+
jumps: g.jumps,
|
|
154
|
+
splashes: g.splashes,
|
|
155
|
+
grabs: g.grabs,
|
|
156
|
+
alarms: g.alarms,
|
|
157
|
+
runs: g.runs,
|
|
158
|
+
wins: g.wins,
|
|
159
|
+
best: Math.round(g.best * 10) / 10,
|
|
160
|
+
sentinels: SENTINELS.length,
|
|
161
|
+
language: LANGUAGES[g.language]!.code,
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
});
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// The sentinels: three stone stouts walking their rounds of the lake path
|
|
2
|
+
// on the vale's navmesh (og.NavAgent), each thinking with its behaviour
|
|
3
|
+
// (og.ai, assets/ai/sentinel-<name>.ogt) and watching with og.Perception
|
|
4
|
+
// (sight, a cone, the terrain and the plinths hide the hero). Seen, a
|
|
5
|
+
// sentinel raises `alarm` and chases; within reach it raises `grab`: the
|
|
6
|
+
// hero loses a heart and is thrown back. The navmesh stops at the shore, so
|
|
7
|
+
// the lake is a refuge. Their walk is the library's clips retargeted onto
|
|
8
|
+
// the stout (src/anim.ts), its speed the graph's parameter.
|
|
9
|
+
|
|
10
|
+
import { og, defineSystem } from "@origingame/engine";
|
|
11
|
+
import type { Entity, World } from "@origingame/engine";
|
|
12
|
+
import { sentinelRig } from "./anim.ts";
|
|
13
|
+
import { Ending, Game, Phase, Sentinel, Sound, Tuning } from "./components.ts";
|
|
14
|
+
import { entity, FEET } from "./hero.ts";
|
|
15
|
+
import { ground, must } from "./world.ts";
|
|
16
|
+
|
|
17
|
+
/** The sentinels, by behaviour (assets/ai/sentinel-<name>.ogt). */
|
|
18
|
+
export const SENTINELS = ["west", "north", "east"] as const;
|
|
19
|
+
/** The stout's scale: a head taller than the hero. */
|
|
20
|
+
const BODY_SCALE = 1.25;
|
|
21
|
+
/** Seconds the hero is thrown back by a grab, and how long it cannot be grabbed again. */
|
|
22
|
+
const KNOCK = 0.35;
|
|
23
|
+
const SPARED = 1.6;
|
|
24
|
+
|
|
25
|
+
/** The first point of each sentinel's round (tools/make-assets.py ROUTES writes the rounds). */
|
|
26
|
+
const ROUND_STARTS = [{ x: -27, z: 12 }, { x: -20, z: -31 }, { x: 27, z: -22 }];
|
|
27
|
+
/** The behaviours' `alert` and `grab` states: indexes into BehaviourInfo.states, the same in all three. */
|
|
28
|
+
const ALERT_STATES = [1, 2];
|
|
29
|
+
/** Their first state, `patrol`. */
|
|
30
|
+
const PATROL = 0;
|
|
31
|
+
|
|
32
|
+
export function spawnSentinels(world: World): void {
|
|
33
|
+
const g = must(world.resource(Game));
|
|
34
|
+
const rig = sentinelRig(world);
|
|
35
|
+
const model = must(og.load.gltf(world, "models/stout.glb"));
|
|
36
|
+
const eyeLight = { color: { r: 1, g: 0.18, b: 0.08 }, intensity: 0, distance: 6, castShadow: false };
|
|
37
|
+
SENTINELS.forEach((name, i) => {
|
|
38
|
+
const mind = must(og.ai.load(world, `ai/sentinel-${name}.ogt`));
|
|
39
|
+
if (mind.states[PATROL] !== "patrol" || mind.states[1] !== "alert" || mind.states[2] !== "grab") throw new Error(`ai/sentinel-${name}.ogt: states ${mind.states.join(", ")}`);
|
|
40
|
+
const first = ROUND_STARTS[i]!;
|
|
41
|
+
const at = { x: first.x, y: ground(world, g, first.x, first.z).height, z: first.z };
|
|
42
|
+
const s = must(world.spawn({ name: `sentinel-${i}`, position: at }));
|
|
43
|
+
must(world.insert(s, og.NavAgent, { nav: g.nav as never, target: at, seeking: false, speed: 1.6, acceleration: 12, radius: 0.45, stopDistance: 0.3, faceMovement: true, turnSpeed: 6 }));
|
|
44
|
+
must(world.insert(s, og.AiAgent, { behaviour: mind.behaviour, active: true, thinkEvery: 2 }));
|
|
45
|
+
must(world.insert(s, og.Perception, { sight: 13, fov: 120, eyeHeight: 1.6, occlude: true, team: 2, memory: 3 }));
|
|
46
|
+
must(world.insert(s, Sentinel, { index: i }));
|
|
47
|
+
const body = must(world.instantiate(model, { name: `sentinel-${i}-body`, parent: s, scale: { x: BODY_SCALE, y: BODY_SCALE, z: BODY_SCALE } }));
|
|
48
|
+
must(world.insert(body, og.Skeleton, { asset: rig.skeleton, rootMotion: "off" }));
|
|
49
|
+
must(world.insert(body, og.AnimationGraph, { asset: rig.graph, speed: 1 }));
|
|
50
|
+
const eye = must(world.spawn({ name: `sentinel-${i}-eye`, parent: s, position: { x: 0, y: 2.05, z: 0.3 } }));
|
|
51
|
+
must(world.insert(eye, og.PointLight, eyeLight));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Puts the sentinels back at the start of their rounds, calm (a new run or
|
|
57
|
+
* the title). One that left its patrol (alert, grabbing or searching) is
|
|
58
|
+
* restarted (og.ai.restart: its machine afresh in `patrol`, its timers and
|
|
59
|
+
* blackboard reset); one still patrolling keeps its machine.
|
|
60
|
+
*/
|
|
61
|
+
function reset(world: World, g: { terrain: number }): void {
|
|
62
|
+
SENTINELS.forEach((_, i) => {
|
|
63
|
+
const s = entity(world, `sentinel-${i}`);
|
|
64
|
+
const first = ROUND_STARTS[i]!;
|
|
65
|
+
const at = { x: first.x, y: ground(world, g, first.x, first.z).height, z: first.z };
|
|
66
|
+
must(world.set(s, og.Transform, { position: at }));
|
|
67
|
+
must(world.set(s, og.NavAgent, { target: at, seeking: false }));
|
|
68
|
+
if (must(world.get(s, og.AiAgent)).state !== PATROL) must(og.ai.restart(world, s));
|
|
69
|
+
must(world.set(s, Sentinel, { alert: false }));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Per tick: the sentinels' sight and pace from Tuning, the graph's speed
|
|
75
|
+
* from how fast each walks, the body's feet on the terrain (the navmesh
|
|
76
|
+
* lies a little above or below it), and the eye's light while it chases.
|
|
77
|
+
*/
|
|
78
|
+
export const Sentinels = defineSystem(
|
|
79
|
+
"Sentinels",
|
|
80
|
+
{ reads: [Tuning], writes: [Game, Sentinel, og.AiAgent, og.NavAgent, og.Transform, og.Perception, og.AnimationGraph, og.PointLight], after: ["Hero"] },
|
|
81
|
+
(_q, time, world) => {
|
|
82
|
+
const g = must(world.resource(Game));
|
|
83
|
+
const t = must(world.resource(Tuning));
|
|
84
|
+
if (g.start) reset(world, g);
|
|
85
|
+
const pulse = 0.75 + 0.25 * Math.sin(time.elapsed * 9);
|
|
86
|
+
SENTINELS.forEach((_, i) => {
|
|
87
|
+
const s = entity(world, `sentinel-${i}`);
|
|
88
|
+
const nav = must(world.get(s, og.NavAgent));
|
|
89
|
+
const ai = must(world.get(s, og.AiAgent));
|
|
90
|
+
const me = must(world.get(s, Sentinel));
|
|
91
|
+
const p = must(world.get(s, og.Transform)).position;
|
|
92
|
+
const speed = Math.hypot(nav.velocity.x, nav.velocity.z);
|
|
93
|
+
const alert = g.phase === Phase.Play && ALERT_STATES.includes(ai.state);
|
|
94
|
+
if (alert !== me.alert || Math.abs(speed - me.speed) > 1e-3) must(world.set(s, Sentinel, { speed, alert }));
|
|
95
|
+
must(world.set(s, og.Perception, { sight: t.sight }));
|
|
96
|
+
const body = entity(world, `sentinel-${i}-body`);
|
|
97
|
+
must(world.set(body, og.AnimationGraph, { p0: speed }));
|
|
98
|
+
must(world.set(body, og.Transform, { position: { x: 0, y: ground(world, g, p.x, p.z).height - p.y, z: 0 } }));
|
|
99
|
+
must(world.set(entity(world, `sentinel-${i}-eye`), og.PointLight, { intensity: alert ? 14 * pulse : 0 }));
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The sentinel a command names: its index, 0 to 2 (SENTINELS' order, as a
|
|
106
|
+
* playtest types it), or its entity handle (what og.ai's `command` sends
|
|
107
|
+
* first; no sentinel's handle is that small).
|
|
108
|
+
*/
|
|
109
|
+
function sentinel(world: World, args: readonly string[]): { me: Entity; at: { x: number; y: number; z: number } } {
|
|
110
|
+
const n = Number(args[0]);
|
|
111
|
+
const me = (Number.isInteger(n) && n >= 0 && n < SENTINELS.length ? entity(world, `sentinel-${n}`) : n) as Entity;
|
|
112
|
+
const t = world.get(me, og.Transform);
|
|
113
|
+
if (!t.ok || !world.get(me, Sentinel).ok) throw new Error(`${args[0]} is not a sentinel (0 to ${SENTINELS.length - 1}, or a sentinel's entity)`);
|
|
114
|
+
return { me, at: t.value.position };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** `alarm <sentinel>`: it has seen the hero (its behaviour raises it entering `alert`). */
|
|
118
|
+
export function alarm(world: World, args: readonly string[]): void {
|
|
119
|
+
const { me, at } = sentinel(world, args);
|
|
120
|
+
const g = must(world.resource(Game));
|
|
121
|
+
if (g.phase !== Phase.Play || g.ending !== Ending.None) return;
|
|
122
|
+
const s = must(world.get(me, Sentinel));
|
|
123
|
+
must(world.set(me, Sentinel, { alarms: s.alarms + 1 }));
|
|
124
|
+
g.alarms += 1;
|
|
125
|
+
g.sfx |= Sound.Alarm;
|
|
126
|
+
must(og.render.floatingText(world, { text: "!", position: { x: at.x, y: at.y + 2.7, z: at.z }, size: 0.9, color: { r: 1, g: 0.3, b: 0.15 }, rise: 0.6, spread: 0, lifetime: 1 }));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* `grab <sentinel>`: it reached the hero (its behaviour raises it within
|
|
131
|
+
* reach). The hero loses a heart and is thrown back, the world holds for a
|
|
132
|
+
* beat, the screen flashes red and shakes; then the hero is spared a moment.
|
|
133
|
+
*/
|
|
134
|
+
export function grab(world: World, args: readonly string[]): void {
|
|
135
|
+
const { me, at } = sentinel(world, args);
|
|
136
|
+
const g = must(world.resource(Game));
|
|
137
|
+
if (g.phase !== Phase.Play || g.ending !== Ending.None || g.invulnerable > 0) return;
|
|
138
|
+
const hero = must(world.get(g.hero as unknown as Entity, og.Transform)).position;
|
|
139
|
+
if (Math.hypot(hero.x - at.x, hero.z - at.z) > 2.2 || hero.y - FEET > at.y + 1.5) return;
|
|
140
|
+
const s = must(world.get(me, Sentinel));
|
|
141
|
+
must(world.set(me, Sentinel, { grabs: s.grabs + 1 }));
|
|
142
|
+
const dx = hero.x - at.x;
|
|
143
|
+
const dz = hero.z - at.z;
|
|
144
|
+
const d = Math.max(0.01, Math.hypot(dx, dz));
|
|
145
|
+
g.hearts -= 1;
|
|
146
|
+
g.hurts += 1;
|
|
147
|
+
g.grabs += 1;
|
|
148
|
+
g.knock = KNOCK;
|
|
149
|
+
g.knockX = dx / d;
|
|
150
|
+
g.knockZ = dz / d;
|
|
151
|
+
g.invulnerable = SPARED;
|
|
152
|
+
g.sfx |= Sound.Grab;
|
|
153
|
+
const t = must(world.resource(Tuning));
|
|
154
|
+
if (t.hitStop > 0) must(og.time.hitStop(world, t.hitStop));
|
|
155
|
+
const post = must(world.resource(og.PostEffects));
|
|
156
|
+
post.flash = 0.45;
|
|
157
|
+
post.flashColor = { r: 0.8, g: 0.05, b: 0.02 };
|
|
158
|
+
must(og.camera.shake(world, 0.55));
|
|
159
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// The sounds: one voice per sound effect, played once when a system sets
|
|
2
|
+
// its bit in Game.sfx (a voice still playing is stopped this tick and
|
|
3
|
+
// started again on the next), and the vale's music, ducked under the
|
|
4
|
+
// effects, with a little of the valley's echo on them.
|
|
5
|
+
|
|
6
|
+
import { og, defineSystem } from "@origingame/engine";
|
|
7
|
+
import type { World } from "@origingame/engine";
|
|
8
|
+
import { Game, Sfx, Sound } from "./components.ts";
|
|
9
|
+
import { must } from "./world.ts";
|
|
10
|
+
|
|
11
|
+
export function spawnVoices(world: World): void {
|
|
12
|
+
const sound = (path: string) => must(og.load.sound(world, path));
|
|
13
|
+
const voices: [string, number, number][] = [
|
|
14
|
+
["audio/step.ogt", Sound.Step, 0.3],
|
|
15
|
+
["audio/jump.wav", Sound.Jump, 0.45],
|
|
16
|
+
["audio/splash.wav", Sound.Splash, 0.5],
|
|
17
|
+
["audio/ignite.wav", Sound.Ignite, 0.75],
|
|
18
|
+
["audio/alarm.wav", Sound.Alarm, 0.6],
|
|
19
|
+
["audio/grab.wav", Sound.Grab, 0.7],
|
|
20
|
+
["audio/dawn.wav", Sound.Dawn, 0.75],
|
|
21
|
+
["audio/night.wav", Sound.Night, 0.75],
|
|
22
|
+
];
|
|
23
|
+
for (const [path, bit, volume] of voices) {
|
|
24
|
+
const v = must(world.spawn({ name: `sfx-${bit}` }));
|
|
25
|
+
must(world.insert(v, og.AudioSource, { sound: sound(path), playing: false, bus: "sfx", volume, priority: 160 }));
|
|
26
|
+
must(world.insert(v, Sfx, { bit }));
|
|
27
|
+
}
|
|
28
|
+
const music = must(world.spawn({ name: "music" }));
|
|
29
|
+
must(world.insert(music, og.AudioSource, { sound: sound("audio/vale.wav"), bus: "music", loop: true, volume: 0.55, priority: 220 }));
|
|
30
|
+
const fx = must(world.spawn({ name: "music-bus" }));
|
|
31
|
+
must(world.insert(fx, og.AudioBusFx, { bus: "music", duck: true, duckBus: "sfx", duckDepth: 5, duckRelease: 0.6 }));
|
|
32
|
+
const echo = must(world.spawn({ name: "sfx-bus" }));
|
|
33
|
+
must(world.insert(echo, og.AudioBusFx, { bus: "sfx", reverb: 0.18 }));
|
|
34
|
+
// The touch HUD's Jump and Kindle: the skin's press sound on the ui bus,
|
|
35
|
+
// like every og.ui button, beside the jump's or the fire's own effect.
|
|
36
|
+
const tap = must(world.spawn({ name: `sfx-${Sound.Tap}` }));
|
|
37
|
+
must(world.insert(tap, og.AudioSource, { sound: sound("audio/ui-press.ogt"), playing: false, bus: "ui", volume: 0.5, priority: 150 }));
|
|
38
|
+
must(world.insert(tap, Sfx, { bit: Sound.Tap }));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Plays each requested sound once; steps and splashes vary their pitch a little. */
|
|
42
|
+
export const Voices = defineSystem("Voices", { writes: [Game, Sfx, og.AudioSource, og.Rng], after: ["Beacons", "Sentinels", "View"] }, (q, _time, world) => {
|
|
43
|
+
const g = must(world.resource(Game));
|
|
44
|
+
// The last system: every system has seen this tick's start.
|
|
45
|
+
g.start = false;
|
|
46
|
+
if (g.sfx === 0) return;
|
|
47
|
+
const rng = must(world.resource(og.Rng));
|
|
48
|
+
let left = g.sfx;
|
|
49
|
+
for (const a of q.archetypes()) {
|
|
50
|
+
const sfx = a.column(Sfx);
|
|
51
|
+
const src = a.column(og.AudioSource);
|
|
52
|
+
for (let i = 0; i < a.count; i++) {
|
|
53
|
+
const b = sfx.bit[i]!;
|
|
54
|
+
if ((g.sfx & b) === 0) continue;
|
|
55
|
+
if (src.playing[i]) {
|
|
56
|
+
src.playing[i] = 0;
|
|
57
|
+
} else {
|
|
58
|
+
src.playing[i] = 1;
|
|
59
|
+
sfx.plays[i] = sfx.plays[i]! + 1;
|
|
60
|
+
if (b === Sound.Step || b === Sound.Splash) src.pitch[i] = rng.range(0.9, 1.1);
|
|
61
|
+
left &= ~b;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
g.sfx = left;
|
|
66
|
+
});
|