@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,246 @@
|
|
|
1
|
+
// The game entry: its default export is og.game(...). `og run .` runs it
|
|
2
|
+
// headless with the probe; `og dev .` reloads it on every save; `og build .`
|
|
3
|
+
// bundles it for the play page.
|
|
4
|
+
//
|
|
5
|
+
// This is the hello of docs/design.md §3.2 (Health, Velocity, Move) grown
|
|
6
|
+
// into a scene: scenes/main.ogt (cooked from assets/scenes/main.ogt) spawns
|
|
7
|
+
// the ground, the dropship and the trickster before the first tick; `start`
|
|
8
|
+
// gives the ground its mesh and collider, drops a crate above it, puts the
|
|
9
|
+
// camera, the UI font and the string table (assets/strings/en.ogt) in
|
|
10
|
+
// place. The Start button of the menu panel (or S or Enter) starts the
|
|
11
|
+
// trickster spinning and lets the crate fall.
|
|
12
|
+
//
|
|
13
|
+
// A guard walks the yard: a state machine in assets/ai/guard.ogt (og.ai)
|
|
14
|
+
// patrols its post on the navmesh baked from assets/nav/yard.ogt (og.nav),
|
|
15
|
+
// sees the trickster only inside its view cone and not through the wall,
|
|
16
|
+
// raises the alarm and chases it, then searches and goes back.
|
|
17
|
+
//
|
|
18
|
+
// The frame's look is data: GameDesc.look names a file under assets/looks/
|
|
19
|
+
// that extends a preset of the style catalogue, applied before start runs.
|
|
20
|
+
|
|
21
|
+
import { og, defineComponent, defineResource, defineSystem, bool, f32, Vector3, SHAPE_BOX } from "@origingame/engine";
|
|
22
|
+
import type { World } from "@origingame/engine";
|
|
23
|
+
|
|
24
|
+
export const Health = defineComponent("Health", {
|
|
25
|
+
hp: f32(100, { min: 0, max: 1000, tunable: true, label: "Health" }),
|
|
26
|
+
max: f32(100),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Velocity = defineComponent("Velocity", { v: Vector3() });
|
|
30
|
+
|
|
31
|
+
/** Turns an entity about +Y; 0 until the player starts. */
|
|
32
|
+
export const Spin = defineComponent("Spin", {
|
|
33
|
+
speed: f32(0, { min: -10, max: 10, step: 0.1, unit: "rad", tunable: true, label: "Spin speed" }),
|
|
34
|
+
target: f32(1.5, { min: -10, max: 10, tunable: true, label: "Spin when started" }),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/** Whether the player has pressed Start. */
|
|
38
|
+
export const Run = defineResource("Run", { started: bool(), chimed: bool() });
|
|
39
|
+
|
|
40
|
+
/** The guard's alarms, raised by its machine's `alarm` command. */
|
|
41
|
+
export const Alarm = defineComponent("Alarm", { raised: f32(0) });
|
|
42
|
+
|
|
43
|
+
export const Move = defineSystem("Move", { reads: [Velocity], writes: [og.Transform] }, (q, time) => {
|
|
44
|
+
for (const a of q.archetypes()) {
|
|
45
|
+
const p = a.column(og.Transform).position;
|
|
46
|
+
const v = a.column(Velocity).v;
|
|
47
|
+
for (let i = 0; i < a.count; i++) {
|
|
48
|
+
p[i * 3] += v[i * 3] * time.dt;
|
|
49
|
+
p[i * 3 + 1] += v[i * 3 + 1] * time.dt;
|
|
50
|
+
p[i * 3 + 2] += v[i * 3 + 2] * time.dt;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The menu panel: the title, the trickster's state and the Start button.
|
|
57
|
+
* A click on Start (or S or Enter) starts the run; the button then reads
|
|
58
|
+
* "Started" and stays inert.
|
|
59
|
+
*/
|
|
60
|
+
export const Menu = defineSystem("Menu", { reads: [Spin, og.Input], writes: [Run] }, (q, _time, world) => {
|
|
61
|
+
const run = world.resource(Run);
|
|
62
|
+
const input = world.resource(og.Input);
|
|
63
|
+
if (!run.ok || !input.ok) return;
|
|
64
|
+
let speed = 0;
|
|
65
|
+
for (const a of q.archetypes()) if (a.count > 0) speed = a.column(Spin).speed[0]!;
|
|
66
|
+
const started = run.value.started;
|
|
67
|
+
og.ui.column("Hud", { padding: { left: 24, top: 24, right: 24, bottom: 24 } }, () => og.ui.panel("Menu", { padding: { left: 20, top: 16, right: 20, bottom: 16 } }, () => {
|
|
68
|
+
og.ui.label("Title", og.i18n.t(world, "menu.title"), { step: "displaySm" });
|
|
69
|
+
og.ui.label("Status", started ? og.i18n.t(world, "menu.spinning", { speed: speed.toFixed(1) }) : og.i18n.t(world, "menu.prompt"), { color: { token: started ? "accentInk" : "fgMuted" } });
|
|
70
|
+
const start = og.ui.button("Start", og.i18n.t(world, started ? "menu.started" : "menu.start"), { variant: "primary", size: "large", disabled: started });
|
|
71
|
+
if (!started && (start.clicked || input.value.pressed("KeyS") || input.value.pressed("Enter"))) run.value.started = true;
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/** Once started, every Spin turns at its target speed. */
|
|
76
|
+
export const StartSpin = defineSystem("StartSpin", { reads: [Run], writes: [Spin], after: ["Menu"] }, (q, _time, world) => {
|
|
77
|
+
const run = world.resource(Run);
|
|
78
|
+
if (!run.ok || !run.value.started) return;
|
|
79
|
+
for (const a of q.archetypes()) {
|
|
80
|
+
const s = a.column(Spin);
|
|
81
|
+
for (let k = 0; k < a.count; k++) if (s.speed[k] === 0) s.speed[k] = s.target[k]!;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/** Once started, held bodies (gravityScale 0) fall. */
|
|
86
|
+
export const Drop = defineSystem("Drop", { reads: [Run], writes: [og.RigidBody], after: ["Menu"] }, (q, _time, world) => {
|
|
87
|
+
const run = world.resource(Run);
|
|
88
|
+
if (!run.ok || !run.value.started) return;
|
|
89
|
+
for (const a of q.archetypes()) {
|
|
90
|
+
const g = a.column(og.RigidBody).gravityScale;
|
|
91
|
+
for (let k = 0; k < a.count; k++) if (g[k] === 0) g[k] = 1;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/** Once started, the crate's blip plays once (an AudioSource inserted held, released here). */
|
|
96
|
+
export const Chime = defineSystem("Chime", { writes: [Run, og.AudioSource], after: ["Menu"] }, (q, _time, world) => {
|
|
97
|
+
const run = world.resource(Run);
|
|
98
|
+
if (!run.ok || !run.value.started || run.value.chimed) return;
|
|
99
|
+
run.value.chimed = true;
|
|
100
|
+
for (const a of q.archetypes()) a.column(og.AudioSource).playing.fill(1);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/** Rotates by Spin.speed about +Y: q' = q * (axis-angle about Y). */
|
|
104
|
+
export const Rotate = defineSystem("Rotate", { reads: [Spin], writes: [og.Transform], after: ["StartSpin"] }, (q, time) => {
|
|
105
|
+
for (const a of q.archetypes()) {
|
|
106
|
+
const r = a.column(og.Transform).quaternion;
|
|
107
|
+
const s = a.column(Spin).speed;
|
|
108
|
+
for (let i = 0; i < a.count; i++) {
|
|
109
|
+
const half = (s[i] * time.dt) / 2;
|
|
110
|
+
// Small-angle rotation, renormalised: deterministic arithmetic only.
|
|
111
|
+
const sy = half - (half * half * half) / 6;
|
|
112
|
+
const cw = 1 - (half * half) / 2;
|
|
113
|
+
const x = r[i * 4], y = r[i * 4 + 1], z = r[i * 4 + 2], w = r[i * 4 + 3];
|
|
114
|
+
const nx = x * cw - z * sy, ny = y * cw + w * sy, nz = z * cw + x * sy, nw = w * cw - y * sy;
|
|
115
|
+
const n = Math.sqrt(nx * nx + ny * ny + nz * nz + nw * nw);
|
|
116
|
+
r[i * 4] = nx / n;
|
|
117
|
+
r[i * 4 + 1] = ny / n;
|
|
118
|
+
r[i * 4 + 2] = nz / n;
|
|
119
|
+
r[i * 4 + 3] = nw / n;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
function spawnWave(world: World, count: number): void {
|
|
125
|
+
const ship = og.load.gltf(world, "models/dropship.glb");
|
|
126
|
+
if (!ship.ok) throw new Error(ship.reason);
|
|
127
|
+
for (let i = 0; i < count; i++) {
|
|
128
|
+
const e = world.instantiate(ship.value, { name: `wave-${world.tick}-${i}`, position: { x: -4 + i * 1.5, y: 4, z: -3 } });
|
|
129
|
+
if (!e.ok) throw new Error(e.reason);
|
|
130
|
+
world.insert(e.value, Velocity, { v: { x: 0, y: -0.5, z: 0 } });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function must<T>(r: { ok: true; value: T } | { ok: false; reason: string }): T {
|
|
135
|
+
if (!r.ok) throw new Error(r.reason);
|
|
136
|
+
return r.value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export default og.game({
|
|
140
|
+
tick: 60,
|
|
141
|
+
seed: 1,
|
|
142
|
+
scenes: { main: "scenes/main.ogt" },
|
|
143
|
+
// The art direction as data (og-taste §12): applied after the scene
|
|
144
|
+
// spawns and before start, which may still change any of it.
|
|
145
|
+
look: "looks/origin-game.ogt",
|
|
146
|
+
resources: [Run],
|
|
147
|
+
systems: [Move, Menu, StartSpin, Drop, Chime, Rotate],
|
|
148
|
+
// MSAA keeps world-space sprites and text sharp; TAA would blur them across
|
|
149
|
+
// frames. The UI draws over the finished frame either way.
|
|
150
|
+
render: { antialias: "msaa4" },
|
|
151
|
+
start(world) {
|
|
152
|
+
// The camera looks down -Z at the scene from in front.
|
|
153
|
+
const camera = must(world.resource(og.Camera));
|
|
154
|
+
camera.position = { x: 0.4, y: 1.8, z: 8 };
|
|
155
|
+
camera.quaternion = { x: 0, y: 0, z: 0, w: 1 };
|
|
156
|
+
must(world.resource(og.RenderSettings)).sky = true;
|
|
157
|
+
|
|
158
|
+
// The ground: a 30 m slab whose top is y = 0, drawn and collided with.
|
|
159
|
+
const ground = world.find("ground");
|
|
160
|
+
if (ground !== null) {
|
|
161
|
+
const slab = must(og.render.boxGeometry(world, { width: 30, height: 0.2, depth: 30 }));
|
|
162
|
+
const stone = must(og.render.standardMaterial(world, { color: { r: 0.18, g: 0.2, b: 0.24 }, roughness: 0.95 }));
|
|
163
|
+
world.set(ground, og.Transform, { position: { x: 0, y: -0.1, z: 0 } });
|
|
164
|
+
world.insert(ground, og.Mesh, { geometry: slab, material: stone, receiveShadow: true });
|
|
165
|
+
world.insert(ground, og.Collider, { shape: SHAPE_BOX, size: { x: 30, y: 0.2, z: 30 } });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// The crate: a dynamic body held in the air (gravityScale 0) until Start.
|
|
169
|
+
const cube = must(og.render.boxGeometry(world, {}));
|
|
170
|
+
const amber = must(og.render.standardMaterial(world, { color: { r: 0.9, g: 0.55, b: 0.08 }, roughness: 0.6 }));
|
|
171
|
+
const crate = must(world.spawn({ name: "crate", position: { x: -2.4, y: 4, z: 0.5 } }));
|
|
172
|
+
world.insert(crate, og.Mesh, { geometry: cube, material: amber, castShadow: true, receiveShadow: true });
|
|
173
|
+
world.insert(crate, og.RigidBody, { gravityScale: 0 });
|
|
174
|
+
world.insert(crate, og.Collider, { shape: SHAPE_BOX });
|
|
175
|
+
const blip = og.load.sound(world, "audio/blip.wav");
|
|
176
|
+
if (blip.ok) world.insert(crate, og.AudioSource, { sound: blip.value, playing: false, spatial: true });
|
|
177
|
+
|
|
178
|
+
const trickster = world.find("trickster");
|
|
179
|
+
if (trickster !== null) {
|
|
180
|
+
world.insert(trickster, Spin);
|
|
181
|
+
world.insert(trickster, Health);
|
|
182
|
+
// What the guard looks for: team 1, looked at 1 m above its feet.
|
|
183
|
+
world.insert(trickster, og.Perceivable, { team: 1, eyeHeight: 1 });
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// The wall the navmesh was baked around (assets/nav/yard.ogt): drawn, and solid to the guard's sight.
|
|
187
|
+
const wall = must(world.spawn({ name: "wall", position: { x: -3, y: 1, z: -2 } }));
|
|
188
|
+
const slabGeo = must(og.render.boxGeometry(world, { width: 0.6, height: 2, depth: 6 }));
|
|
189
|
+
const plaster = must(og.render.standardMaterial(world, { color: { r: 0.55, g: 0.52, b: 0.48 }, roughness: 0.9 }));
|
|
190
|
+
world.insert(wall, og.Mesh, { geometry: slabGeo, material: plaster, castShadow: true, receiveShadow: true });
|
|
191
|
+
world.insert(wall, og.Collider, { shape: SHAPE_BOX, size: { x: 0.6, y: 2, z: 6 } });
|
|
192
|
+
|
|
193
|
+
// The guard: the walker model, moved by og.nav on the baked navmesh and run by og.ai's machine.
|
|
194
|
+
const yard = must(og.nav.load(world, "nav/yard.ogt"));
|
|
195
|
+
const mind = must(og.ai.load(world, "ai/guard.ogt"));
|
|
196
|
+
const walker = must(og.load.gltf(world, "models/walker.glb"));
|
|
197
|
+
const guard = must(world.instantiate(walker, { name: "guard", position: { x: -6, y: 0, z: -3 } }));
|
|
198
|
+
// Facing east (+X), towards the wall: its view cone is 120° around the way it faces until it moves.
|
|
199
|
+
world.set(guard, og.Transform, { quaternion: { x: 0, y: Math.SQRT1_2, z: 0, w: Math.SQRT1_2 } });
|
|
200
|
+
world.insert(guard, og.NavAgent, { nav: yard.mesh, speed: 1.5, acceleration: 12, radius: 0.4, faceMovement: true, turnSpeed: 8 });
|
|
201
|
+
world.insert(guard, og.AiAgent, { behaviour: mind.behaviour });
|
|
202
|
+
world.insert(guard, og.Perception, { sight: 9, fov: 120, eyeHeight: 1.6, team: 2 });
|
|
203
|
+
world.insert(guard, Alarm);
|
|
204
|
+
// Every string the menu shows (og-i18n §1): load each locale's table here.
|
|
205
|
+
must(og.i18n.load(world, "strings/en.ogt"));
|
|
206
|
+
const font = og.load.font(world, "fonts/NotoSansSC-Regular-subset.ttf");
|
|
207
|
+
// A press answers with a sound as well as its look (og-taste §6): the `click` preset, synthesised by og cook.
|
|
208
|
+
const click = og.load.sound(world, "audio/click.ogt");
|
|
209
|
+
og.ui.configure(world, { ...(font.ok ? { font: font.value } : {}), ...(click.ok ? { sounds: { press: click.value } } : {}) });
|
|
210
|
+
},
|
|
211
|
+
commands: {
|
|
212
|
+
spawn_wave: (world, args) => spawnWave(world, Number(args[0] ?? 3)),
|
|
213
|
+
// The guard's machine raises it on entering `alert`; og.ai passes the guard's handle first.
|
|
214
|
+
alarm: (world, args) => {
|
|
215
|
+
const guard = Number(args[0]) as never;
|
|
216
|
+
const a = must(world.get(guard, Alarm));
|
|
217
|
+
must(world.set(guard, Alarm, { raised: a.raised + 1 }) as never);
|
|
218
|
+
},
|
|
219
|
+
/** `lure:<x>:<z>`: moves the trickster on the ground. */
|
|
220
|
+
lure: (world, args) => {
|
|
221
|
+
const t = world.find("trickster");
|
|
222
|
+
if (t === null) throw new Error("no trickster");
|
|
223
|
+
must(world.set(t, og.Transform, { position: { x: Number(args[0]), y: 0, z: Number(args[1]) } }) as never);
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
commandHelp: {
|
|
227
|
+
spawn_wave: { usage: "[count]", doc: "Drop that many dropships (3 by default)." },
|
|
228
|
+
alarm: { usage: "<guard>", doc: "The guard's state machine raises it on entering alert; og.ai passes the guard's handle." },
|
|
229
|
+
lure: { usage: "<x>:<z>", doc: "Move the trickster on the ground." },
|
|
230
|
+
},
|
|
231
|
+
facts: (world) => {
|
|
232
|
+
const run = world.resource(Run);
|
|
233
|
+
const trickster = world.find("trickster");
|
|
234
|
+
const spin = trickster === null ? null : world.get(trickster, Spin);
|
|
235
|
+
const crate = world.find("crate");
|
|
236
|
+
const at = crate === null ? null : world.get(crate, og.Transform);
|
|
237
|
+
const guard = world.find("guard");
|
|
238
|
+
const mind = guard === null ? null : (og.ai.describe(world, guard) as { state: string } | null);
|
|
239
|
+
return {
|
|
240
|
+
started: run.ok && run.value.started,
|
|
241
|
+
guard: mind?.state ?? null,
|
|
242
|
+
spin: spin?.ok ? spin.value.speed : null,
|
|
243
|
+
crateY: at?.ok ? at.value.position.y : null,
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// The guard (assets/ai/guard.ogt, a state machine on og.ai; the navmesh
|
|
2
|
+
// cooked from assets/nav/yard.ogt, walked by og.nav). Facing east at its
|
|
3
|
+
// first post, it does not see the trickster behind the wall (in range, in
|
|
4
|
+
// its cone) nor behind it (in range, in the open); in front of it, it does,
|
|
5
|
+
// raises the alarm once and chases; when the trickster slips behind the wall
|
|
6
|
+
// it searches where it last saw it and returns to its patrol 3 s later.
|
|
7
|
+
import { playtest } from "@origingame/engine/playtest";
|
|
8
|
+
|
|
9
|
+
interface AiDump {
|
|
10
|
+
behaviour: string;
|
|
11
|
+
kind: string;
|
|
12
|
+
state: string;
|
|
13
|
+
sees: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface EntityDump {
|
|
16
|
+
components: Record<string, Record<string, unknown>>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const at = (run: { json<T>(f: string): T }, f: string) => run.json<EntityDump>(f).components["og.Transform"]!["position"] as number[];
|
|
20
|
+
|
|
21
|
+
export default playtest({
|
|
22
|
+
name: "the guard patrols, sees inside its cone and not through the wall, chases, searches and returns",
|
|
23
|
+
commands: [
|
|
24
|
+
"0.3:lure:0:-3",
|
|
25
|
+
"0.4:dump_ai:guard:walled.json",
|
|
26
|
+
"0.4:dump_entity:guard:g0.json",
|
|
27
|
+
"0.5:lure:-6:-7",
|
|
28
|
+
"0.7:dump_ai:guard:behind.json",
|
|
29
|
+
"1.0:lure:-4:-1",
|
|
30
|
+
"1.1:dump_ai:guard:front.json",
|
|
31
|
+
"2.2:dump_entity:guard:chasing.json",
|
|
32
|
+
"2.2:dump_ai:guard:chase.json",
|
|
33
|
+
"2.3:lure:-1:-4",
|
|
34
|
+
"2.6:dump_ai:guard:lost.json",
|
|
35
|
+
"6.0:dump_ai:guard:back.json",
|
|
36
|
+
"6.0:dump_entity:guard:end.json",
|
|
37
|
+
"6.1:quit",
|
|
38
|
+
].join(";"),
|
|
39
|
+
check(run, t) {
|
|
40
|
+
t.equal(run.warnings.join("; "), "", "the script ran without warnings");
|
|
41
|
+
const walled = run.json<AiDump>("walled.json");
|
|
42
|
+
t.equal(walled.behaviour, "guard", "the guard runs assets/ai/guard.ogt");
|
|
43
|
+
t.equal(walled.kind, "machine", "a state machine");
|
|
44
|
+
t.equal(walled.state, "patrol", "it patrols");
|
|
45
|
+
t.equal(walled.sees, false, "the wall hides the trickster 6 m ahead, inside its cone and its 9 m sight");
|
|
46
|
+
const g0 = at(run, "g0.json");
|
|
47
|
+
t.ok(Math.abs(g0[1]!) < 0.2, `it stands on the navmesh's surface (y ${g0[1]!.toFixed(3)})`);
|
|
48
|
+
const behind = run.json<AiDump>("behind.json");
|
|
49
|
+
t.equal(behind.sees, false, "4 m behind it, in the open, the trickster is outside its 120° cone");
|
|
50
|
+
t.equal(behind.state, "patrol", "so it keeps patrolling");
|
|
51
|
+
|
|
52
|
+
const front = run.json<AiDump>("front.json");
|
|
53
|
+
t.equal(front.sees, true, "in front of it the trickster is seen");
|
|
54
|
+
t.equal(front.state, "alert", "and the guard is alert");
|
|
55
|
+
const chase = run.json<AiDump>("chase.json");
|
|
56
|
+
t.equal(chase.state, "alert", "still chasing a second later");
|
|
57
|
+
const c = at(run, "chasing.json");
|
|
58
|
+
const d = Math.hypot(c[0]! + 4, c[2]! + 1);
|
|
59
|
+
t.ok(d < 2.0, `it closed in on the trickster (${d.toFixed(2)} m)`);
|
|
60
|
+
|
|
61
|
+
const lost = run.json<AiDump>("lost.json");
|
|
62
|
+
t.equal(lost.sees, false, "behind the wall the trickster is hidden");
|
|
63
|
+
t.equal(lost.state, "search", "so the guard searches");
|
|
64
|
+
t.equal(run.json<AiDump>("back.json").state, "patrol", "three seconds later it is back on patrol");
|
|
65
|
+
t.equal(run.json<EntityDump>("end.json").components["Alarm"]!["raised"], 1, "the alarm was raised once, on entering alert");
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// The template's playtest, run by `og test` through `og run --headless
|
|
2
|
+
// --commands`: a tap on the menu's Start button (found by its UI id, no key
|
|
3
|
+
// fallback) starts the trickster spinning and drops the crate onto the
|
|
4
|
+
// ground; the frame, the dumps and the UI tree are written.
|
|
5
|
+
import { playtest } from "@origingame/engine/playtest";
|
|
6
|
+
|
|
7
|
+
interface EntityDump {
|
|
8
|
+
components: Record<string, Record<string, number | boolean | string | number[]>>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface UiDump {
|
|
12
|
+
elements: Array<{ id: string; parent: string; text: string; x: number; y: number; width: number; height: number }>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default playtest({
|
|
16
|
+
name: "A tap on Start spins the trickster and drops the crate; the run writes its frame, dumps and UI tree",
|
|
17
|
+
commands:
|
|
18
|
+
"0.5:touch_move_to:Start;0.6:touch_start;0.7:touch_end;" +
|
|
19
|
+
"2.0:screenshot:smoke.png;2.1:dump_entity:trickster:trickster.json;2.15:dump_entity:crate:crate.json;" +
|
|
20
|
+
"2.2:dump_world:world.json;2.3:dump_ui:ui.json;2.5:quit",
|
|
21
|
+
check(run, t) {
|
|
22
|
+
t.ok(run.quit, "the script reached quit");
|
|
23
|
+
// Frames are read inside t.frame: without a renderer (og test in a sandbox
|
|
24
|
+
// with no GPU) the frame is reported unchecked and every other check runs.
|
|
25
|
+
t.frame("smoke.png", () => {
|
|
26
|
+
const frame = run.png("smoke.png");
|
|
27
|
+
t.ok(frame.width > 0 && frame.height > 0, `a ${frame.width}x${frame.height} frame was captured`);
|
|
28
|
+
});
|
|
29
|
+
const world = run.json<{ entities: number; systems: Array<{ name: string; matched: number | null }> }>("world.json");
|
|
30
|
+
t.ok(world.entities >= 5, `the scene spawned with the crate (${world.entities} entities)`);
|
|
31
|
+
t.ok(world.systems.some((s) => s.name === "Rotate" && s.matched === 1), "Rotate matches the trickster");
|
|
32
|
+
const ui = run.json<UiDump>("ui.json");
|
|
33
|
+
const start = ui.elements.find((e) => e.id === "Start");
|
|
34
|
+
t.ok(start !== undefined && start.width > 0 && start.height > 0, "the UI tree has the Start button with bounds");
|
|
35
|
+
t.ok(start?.text === "Started", `the button reads "${start?.text}" after the tap`);
|
|
36
|
+
const trickster = run.json<EntityDump>("trickster.json");
|
|
37
|
+
const spin = trickster.components["Spin"]!;
|
|
38
|
+
t.ok(Number(spin["speed"]) > 0, `the trickster spins (${spin["speed"]} rad/s)`);
|
|
39
|
+
const crate = run.json<EntityDump>("crate.json");
|
|
40
|
+
const y = (crate.components["og.Transform"]!["position"] as number[])[1]!;
|
|
41
|
+
t.ok(y > 0.4 && y < 0.6, `the crate fell from 4 m and rests on the ground (y ${y.toFixed(3)})`);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"noEmit": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
|
17
|
+
}
|