@origingame/create-game 0.0.0-stage → 0.1.1
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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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/gitignore +8 -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 +503 -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/gitignore +8 -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,340 @@
|
|
|
1
|
+
// Spark Orb's systems, in tick order after the screens (src/ui.ts): Orb
|
|
2
|
+
// (taps: the pointer on the orb, Space, Enter, the pad's A, the HUD), the
|
|
3
|
+
// Economy (what the generators make, purchases, milestones, the
|
|
4
|
+
// supernova), Motes (one mote circling the orb per generator owned),
|
|
5
|
+
// Bursts (the particle bursts the others ask for) and Voices.
|
|
6
|
+
//
|
|
7
|
+
// A system declares the components its rows carry; what another system's
|
|
8
|
+
// rows must show (a burst, a mote) is asked for through the Game resource
|
|
9
|
+
// and done by the system that owns those rows, the same tick.
|
|
10
|
+
|
|
11
|
+
import { og, defineSystem } from "@origingame/engine";
|
|
12
|
+
import type { Value, World } from "@origingame/engine";
|
|
13
|
+
import { Burst, Game, GENERATORS, Mote, MOTES, Orb, Phase, Prefs, Sfx, Sound, Tuning } from "./components.ts";
|
|
14
|
+
import { big, generatorRate, novaGain, owned, price, setOwned, tapValue, totalRate } from "./numbers.ts";
|
|
15
|
+
import { say } from "./ui.ts";
|
|
16
|
+
|
|
17
|
+
type GameV = Value<typeof Game>;
|
|
18
|
+
type TuneV = Value<typeof Tuning>;
|
|
19
|
+
|
|
20
|
+
const GOLD = { r: 1, g: 0.78, b: 0.3 };
|
|
21
|
+
const WHITE = { r: 1, g: 0.97, b: 0.9 };
|
|
22
|
+
/** Each generator's colour: the motes, the floating words. */
|
|
23
|
+
export const TIER_COLOURS = [
|
|
24
|
+
{ r: 1, g: 0.55, b: 0.2 },
|
|
25
|
+
{ r: 0.45, g: 0.8, b: 1 },
|
|
26
|
+
{ r: 0.8, g: 0.55, b: 1 },
|
|
27
|
+
{ r: 1, g: 0.95, b: 0.75 },
|
|
28
|
+
] as const;
|
|
29
|
+
/** The orb's radius in world units at scale 1. */
|
|
30
|
+
export const ORB_RADIUS = 1.35;
|
|
31
|
+
/** Burst kinds (Burst.kind, Game.burstKind). */
|
|
32
|
+
export const BURST = { Tap: 0, Milestone: 1, Nova: 2 } as const;
|
|
33
|
+
|
|
34
|
+
/** The camera feel's scale: 0.3 under reduced motion (og-feel), 1 otherwise. */
|
|
35
|
+
export function feel(world: World): number {
|
|
36
|
+
const p = world.resource(Prefs);
|
|
37
|
+
return p.ok && p.value.reducedMotion ? 0.3 : 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function must(r: { ok: true } | { ok: false; reason: string }): void {
|
|
41
|
+
if (!r.ok) throw new Error(r.reason);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function must2<T>(r: { ok: true; value: T } | { ok: false; reason: string }): T {
|
|
45
|
+
if (!r.ok) throw new Error(r.reason);
|
|
46
|
+
return r.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Tuning, read on its first use in this call (a resource read encodes every field). */
|
|
50
|
+
export function lazyTuning(world: World): TuneV {
|
|
51
|
+
let v: TuneV | null = null;
|
|
52
|
+
return new Proxy({} as TuneV, { get: (_, k) => ((v ??= must2(world.resource(Tuning))) as unknown as Record<string | symbol, unknown>)[k] });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function counts(g: GameV): number[] {
|
|
56
|
+
return [g.owned0, g.owned1, g.owned2, g.owned3];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function float(world: World, text: string, x: number, y: number, color: { r: number; g: number; b: number }, crit = false, size = 0.42): void {
|
|
60
|
+
must(og.render.floatingText(world, { text, position: { x, y, z: 0 }, size, color, crit, rise: 1.1, lifetime: 0.8 }));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Asks the Bursts system for a burst at a world point this tick. */
|
|
64
|
+
function burst(world: World, g: GameV, kind: number, x: number, y: number): void {
|
|
65
|
+
g.burstKind = kind;
|
|
66
|
+
g.burstX = x;
|
|
67
|
+
g.burstY = y;
|
|
68
|
+
g.burstTick = world.tick;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The world point under a CSS pixel, through the orthographic camera. */
|
|
72
|
+
export function screenToWorld(world: World, px: number, py: number): { x: number; y: number } | null {
|
|
73
|
+
const cam = world.resource(og.Camera);
|
|
74
|
+
const vp = og.ui.viewport(world);
|
|
75
|
+
if (!cam.ok || vp.height <= 0) return null;
|
|
76
|
+
const scale = vp.height / cam.value.height;
|
|
77
|
+
const at = cam.value.position;
|
|
78
|
+
return { x: at.x + (px - vp.width / 2) / scale, y: at.y - (py - vp.height / 2) / scale };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Taps: a press on the orb, Space or Enter, the pad's A or the HUD's ask
|
|
83
|
+
* each make the tap's sparks, with a squash, a flash, the number rising
|
|
84
|
+
* from where the tap landed, a burst of sparks and a chime whose pitch
|
|
85
|
+
* climbs with a quick run of taps. The orb breathes between taps.
|
|
86
|
+
*/
|
|
87
|
+
export const OrbTap = defineSystem(
|
|
88
|
+
"Orb",
|
|
89
|
+
{ reads: [og.Input, og.Gamepad, og.Camera, Tuning], writes: [Game, Orb, og.Transform, og.Sprite], after: ["Ui"] },
|
|
90
|
+
(q, time, world) => {
|
|
91
|
+
const game = world.resource(Game);
|
|
92
|
+
const input = world.resource(og.Input);
|
|
93
|
+
const gamepad = world.resource(og.Gamepad);
|
|
94
|
+
if (!game.ok || !input.ok || !gamepad.ok) return;
|
|
95
|
+
const g = game.value;
|
|
96
|
+
const inp = input.value;
|
|
97
|
+
const gp = gamepad.value;
|
|
98
|
+
const playing = g.phase === Phase.Play && !g.held && world.tick > g.playTick;
|
|
99
|
+
for (const a of q.archetypes()) {
|
|
100
|
+
const orb = a.column(Orb);
|
|
101
|
+
const p = a.column(og.Transform).position;
|
|
102
|
+
const s = a.column(og.Transform).scale;
|
|
103
|
+
for (let i = 0; i < a.count; i++) {
|
|
104
|
+
const me = a.entity(i);
|
|
105
|
+
p[i * 3] = g.orbX;
|
|
106
|
+
p[i * 3 + 1] = g.orbY;
|
|
107
|
+
// Breathing, by the simulation clock (paused with it).
|
|
108
|
+
const breath = 1 + 0.025 * Math.sin(time.elapsed * 1.6);
|
|
109
|
+
s[i * 3] = breath;
|
|
110
|
+
s[i * 3 + 1] = breath;
|
|
111
|
+
if (!playing) continue;
|
|
112
|
+
let tap = g.pendingTap || inp.pressed("Space") || inp.pressed("Enter") || gp.pressed("a");
|
|
113
|
+
let at = { x: g.orbX + 0.35, y: g.orbY + 0.9 };
|
|
114
|
+
if (g.pendingTap) g.pendingTap = false;
|
|
115
|
+
if (inp.buttonPressed("left")) {
|
|
116
|
+
const w = screenToWorld(world, inp.pointer.x, inp.pointer.y);
|
|
117
|
+
if (w !== null && Math.hypot(w.x - g.orbX, w.y - g.orbY) <= ORB_RADIUS) {
|
|
118
|
+
tap = true;
|
|
119
|
+
at = { x: w.x, y: w.y + 0.3 };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (!tap) continue;
|
|
123
|
+
const t = lazyTuning(world);
|
|
124
|
+
const value = tapValue(t, g.rate, g.dust);
|
|
125
|
+
g.sparks += value;
|
|
126
|
+
g.runEarned += value;
|
|
127
|
+
g.lifetime += value;
|
|
128
|
+
g.taps += 1;
|
|
129
|
+
orb.taps[i] = orb.taps[i]! + 1;
|
|
130
|
+
g.sfx |= Sound.Tap;
|
|
131
|
+
// A quick run of taps climbs in pitch (the Voices system reads the streak).
|
|
132
|
+
g.streak = world.tick - g.lastTapTick <= 20 ? Math.min(g.streak + 1, 12) : 0;
|
|
133
|
+
g.lastTapTick = world.tick;
|
|
134
|
+
float(world, `+${big(world, value)}`, at.x, at.y, g.streak >= 8 ? GOLD : WHITE, g.streak >= 8);
|
|
135
|
+
must(og.tween.squash(world, { entity: me, impact: { x: 1.12, y: 0.9 }, duration: 0.16 }));
|
|
136
|
+
must(og.tween.flash(world, { entity: me, color: { r: 1, g: 0.95, b: 0.8 }, duration: 0.08 }));
|
|
137
|
+
burst(world, g, BURST.Tap, at.x, at.y - 0.3);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The economy: the generators' sparks each tick (time stops with the
|
|
145
|
+
* pause), purchases (1–4, the pad's X on the selected generator, the HUD),
|
|
146
|
+
* refusals (the card shakes with the error sound), milestones (every
|
|
147
|
+
* Tuning.milestone of a generator doubles it: a burst and a fanfare) and
|
|
148
|
+
* the supernova (sparks and generators back to nothing, stardust for the
|
|
149
|
+
* run).
|
|
150
|
+
*/
|
|
151
|
+
export const Economy = defineSystem(
|
|
152
|
+
"Economy",
|
|
153
|
+
{ reads: [og.Input, og.Gamepad, Tuning, Prefs], writes: [Game], after: ["Orb"] },
|
|
154
|
+
(_q, _time, world) => {
|
|
155
|
+
const game = world.resource(Game);
|
|
156
|
+
const input = world.resource(og.Input);
|
|
157
|
+
const gamepad = world.resource(og.Gamepad);
|
|
158
|
+
if (!game.ok || !input.ok || !gamepad.ok) return;
|
|
159
|
+
const g = game.value;
|
|
160
|
+
const inp = input.value;
|
|
161
|
+
const gp = gamepad.value;
|
|
162
|
+
const t = lazyTuning(world);
|
|
163
|
+
if (g.phase !== Phase.Play) return;
|
|
164
|
+
const rate = totalRate(t, counts(g), g.dust);
|
|
165
|
+
if (rate !== g.rate) g.rate = rate;
|
|
166
|
+
const tv = tapValue(t, rate, g.dust);
|
|
167
|
+
if (tv !== g.tapValue) g.tapValue = tv;
|
|
168
|
+
if (g.held) return;
|
|
169
|
+
g.runTicks += 1;
|
|
170
|
+
if (rate > 0) {
|
|
171
|
+
const made = rate / 60;
|
|
172
|
+
g.sparks += made;
|
|
173
|
+
g.runEarned += made;
|
|
174
|
+
g.lifetime += made;
|
|
175
|
+
}
|
|
176
|
+
// Choosing and buying (not with the key that began play).
|
|
177
|
+
if (world.tick <= g.playTick) return;
|
|
178
|
+
let buy = g.pendingBuy;
|
|
179
|
+
if (g.pendingBuy >= 0) g.pendingBuy = -1;
|
|
180
|
+
GENERATORS.forEach((_, i) => {
|
|
181
|
+
if (inp.pressed(`Digit${i + 1}`)) buy = i;
|
|
182
|
+
});
|
|
183
|
+
const step = (inp.pressed("ArrowRight") || gp.pressed("right") ? 1 : 0) - (inp.pressed("ArrowLeft") || gp.pressed("left") ? 1 : 0);
|
|
184
|
+
if (step !== 0) {
|
|
185
|
+
g.selected = (g.selected + step + GENERATORS.length) % GENERATORS.length;
|
|
186
|
+
g.sfx |= Sound.Move;
|
|
187
|
+
}
|
|
188
|
+
if (gp.pressed("x") || inp.pressed("KeyB")) buy = g.selected;
|
|
189
|
+
if (buy >= 0) purchase(world, g, t, buy);
|
|
190
|
+
if (g.pendingNova) {
|
|
191
|
+
g.pendingNova = false;
|
|
192
|
+
nova(world, g, t);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
function purchase(world: World, g: GameV, t: TuneV, i: number): void {
|
|
198
|
+
const n = owned(g, i);
|
|
199
|
+
const cost = price(t, i, n);
|
|
200
|
+
g.selected = i;
|
|
201
|
+
if (g.sparks < cost) {
|
|
202
|
+
g.refused += 1;
|
|
203
|
+
g.refusedSlot = i;
|
|
204
|
+
g.refusedTick = world.tick;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
g.sparks -= cost;
|
|
208
|
+
setOwned(g, i, n + 1);
|
|
209
|
+
g.buys += 1;
|
|
210
|
+
g.sfx |= Sound.Buy;
|
|
211
|
+
g.boughtSlot = i;
|
|
212
|
+
g.boughtTick = world.tick;
|
|
213
|
+
const ring = 1.75 + 0.55 * i;
|
|
214
|
+
const colour = TIER_COLOURS[i]!;
|
|
215
|
+
if ((n + 1) % t.milestone === 0) {
|
|
216
|
+
// A milestone: this generator now makes twice as much.
|
|
217
|
+
g.milestoneSlot = i;
|
|
218
|
+
g.milestoneTick = world.tick;
|
|
219
|
+
g.sfx |= Sound.Milestone;
|
|
220
|
+
float(world, say(world, "float.milestone", { name: say(world, `gen.${GENERATORS[i]}`) }), g.orbX, g.orbY + ring + 0.3, colour, true, 0.5);
|
|
221
|
+
burst(world, g, BURST.Milestone, g.orbX, g.orbY);
|
|
222
|
+
must(og.camera.punch(world, 0.06 * feel(world)));
|
|
223
|
+
} else {
|
|
224
|
+
float(world, `+${big(world, generatorRate(t, i, n + 1, g.dust) - generatorRate(t, i, n, g.dust))}/s`, g.orbX + ring * 0.7, g.orbY + ring * 0.7, colour, false, 0.34);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** The supernova: the run's stardust, then everything but the stardust and the record back to nothing. */
|
|
229
|
+
export function nova(world: World, g: GameV, t: TuneV): void {
|
|
230
|
+
const gain = novaGain(t, g.runEarned);
|
|
231
|
+
if (gain < 1) return;
|
|
232
|
+
g.lastGain = gain;
|
|
233
|
+
g.lastRun = g.runEarned;
|
|
234
|
+
g.lastRunTicks = g.runTicks;
|
|
235
|
+
g.dust += gain;
|
|
236
|
+
g.novas += 1;
|
|
237
|
+
g.sparks = 0;
|
|
238
|
+
g.runEarned = 0;
|
|
239
|
+
g.runTicks = 0;
|
|
240
|
+
g.owned0 = 0;
|
|
241
|
+
g.owned1 = 0;
|
|
242
|
+
g.owned2 = 0;
|
|
243
|
+
g.owned3 = 0;
|
|
244
|
+
g.rate = 0;
|
|
245
|
+
g.phase = Phase.Nova;
|
|
246
|
+
g.sfx |= Sound.Nova;
|
|
247
|
+
g.saveNow = true;
|
|
248
|
+
burst(world, g, BURST.Nova, g.orbX, g.orbY);
|
|
249
|
+
must(og.time.hitStop(world, 10));
|
|
250
|
+
const k = feel(world);
|
|
251
|
+
must(og.camera.shake(world, 0.6 * k));
|
|
252
|
+
must(og.camera.punch(world, 0.2 * k));
|
|
253
|
+
must(og.platform.telemetry(world, "orb.nova", { gain, dust: g.dust, novas: g.novas }));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** The motes: generator i's first MOTES owned circle the orb on ring i, each ring at its own speed. */
|
|
257
|
+
export const Motes = defineSystem("Motes", { reads: [Game], writes: [Mote, og.Transform, og.Sprite], after: ["Economy"] }, (q, time, world) => {
|
|
258
|
+
const game = world.resource(Game);
|
|
259
|
+
if (!game.ok) return;
|
|
260
|
+
const g = game.value;
|
|
261
|
+
const n = counts(g);
|
|
262
|
+
const show = g.phase !== Phase.Title;
|
|
263
|
+
for (const a of q.archetypes()) {
|
|
264
|
+
const m = a.column(Mote);
|
|
265
|
+
const p = a.column(og.Transform).position;
|
|
266
|
+
const sprite = a.column(og.Sprite);
|
|
267
|
+
for (let i = 0; i < a.count; i++) {
|
|
268
|
+
const tier = m.tier[i]!;
|
|
269
|
+
const k = m.index[i]!;
|
|
270
|
+
const visible = show && k < Math.min(MOTES, n[tier]!) ? 1 : 0;
|
|
271
|
+
if (sprite.visible[i] !== visible) sprite.visible[i] = visible;
|
|
272
|
+
if (!visible) continue;
|
|
273
|
+
const ring = 1.75 + 0.55 * tier;
|
|
274
|
+
const speed = (tier % 2 === 0 ? 1 : -1) * (0.5 - tier * 0.08);
|
|
275
|
+
const angle = time.elapsed * speed + (k / MOTES) * Math.PI * 2 + tier * 0.7;
|
|
276
|
+
p[i * 3] = g.orbX + Math.cos(angle) * ring;
|
|
277
|
+
p[i * 3 + 1] = g.orbY + Math.sin(angle) * ring * 0.92;
|
|
278
|
+
sprite.opacity[i] = 0.75 + 0.25 * Math.sin(time.elapsed * 3 + k);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
/** Fires the burst the others asked for this tick from the pool of its kind (the oldest one). */
|
|
284
|
+
export const Bursts = defineSystem("Bursts", { reads: [Game], writes: [Burst, og.Transform, og.ParticleSystem], after: ["Motes"] }, (q, _time, world) => {
|
|
285
|
+
const game = world.resource(Game);
|
|
286
|
+
if (!game.ok) return;
|
|
287
|
+
const g = game.value;
|
|
288
|
+
if (g.burstTick !== world.tick) return;
|
|
289
|
+
let best = -1;
|
|
290
|
+
let bestA: ReturnType<typeof q.archetypes>[number] | null = null;
|
|
291
|
+
let oldest = Number.POSITIVE_INFINITY;
|
|
292
|
+
for (const a of q.archetypes()) {
|
|
293
|
+
const b = a.column(Burst);
|
|
294
|
+
const fx = a.column(og.ParticleSystem);
|
|
295
|
+
for (let i = 0; i < a.count; i++) {
|
|
296
|
+
if (b.kind[i] !== g.burstKind) continue;
|
|
297
|
+
const started = fx.visible[i] ? fx.startTick[i]! : -1;
|
|
298
|
+
if (started < oldest) {
|
|
299
|
+
oldest = started;
|
|
300
|
+
best = i;
|
|
301
|
+
bestA = a;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (bestA === null || best < 0) return;
|
|
306
|
+
const p = bestA.column(og.Transform).position;
|
|
307
|
+
const fx = bestA.column(og.ParticleSystem);
|
|
308
|
+
p[best * 3] = g.burstX;
|
|
309
|
+
p[best * 3 + 1] = g.burstY;
|
|
310
|
+
fx.visible[best] = 1;
|
|
311
|
+
fx.startTick[best] = world.tick;
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
/** Plays each requested sound once: a voice already playing is stopped this tick and restarted the next; the tap's pitch climbs with the streak. */
|
|
315
|
+
export const Voices = defineSystem("Voices", { writes: [Game, Sfx, og.AudioSource, og.Rng], after: ["Bursts"] }, (q, _time, world) => {
|
|
316
|
+
const game = world.resource(Game);
|
|
317
|
+
if (!game.ok) return;
|
|
318
|
+
const g = game.value;
|
|
319
|
+
if (g.sfx === 0) return;
|
|
320
|
+
const rng = world.resource(og.Rng);
|
|
321
|
+
let left = g.sfx;
|
|
322
|
+
for (const a of q.archetypes()) {
|
|
323
|
+
const sfx = a.column(Sfx);
|
|
324
|
+
const src = a.column(og.AudioSource);
|
|
325
|
+
for (let i = 0; i < a.count; i++) {
|
|
326
|
+
const b = sfx.bit[i]!;
|
|
327
|
+
if ((g.sfx & b) === 0) continue;
|
|
328
|
+
if (src.playing[i]) {
|
|
329
|
+
src.playing[i] = 0;
|
|
330
|
+
} else {
|
|
331
|
+
src.playing[i] = 1;
|
|
332
|
+
sfx.plays[i] = sfx.plays[i]! + 1;
|
|
333
|
+
if (b === Sound.Tap) src.pitch[i] = Math.pow(2, g.streak / 24) * (rng.ok ? rng.value.range(0.98, 1.02) : 1);
|
|
334
|
+
if (b === Sound.Buy && rng.ok) src.pitch[i] = rng.value.range(0.95, 1.06);
|
|
335
|
+
left &= ~b;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
g.sfx = left;
|
|
340
|
+
});
|