@benev/tact 0.1.0-3 → 0.1.0-5
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 +113 -104
- package/package.json +7 -7
- package/s/core/bindings/action.ts +14 -4
- package/s/core/bindings/parts/defaults.ts +4 -1
- package/s/core/bindings/parts/lens-algo.ts +21 -13
- package/s/core/bindings/parts/lookup-proxies.ts +17 -0
- package/s/core/bindings/resolver.ts +12 -12
- package/s/core/bindings/sample-map.ts +25 -0
- package/s/core/bindings/types.ts +4 -1
- package/s/core/core.test.ts +46 -34
- package/s/core/devices/auto-gamepads.ts +8 -0
- package/s/core/devices/device.ts +12 -0
- package/s/core/devices/infra/group.ts +24 -0
- package/s/core/devices/infra/sampler.ts +22 -0
- package/s/core/devices/standard/gamepad.ts +83 -0
- package/s/core/{controllers → devices}/standard/index.ts +2 -1
- package/s/core/devices/standard/keyboard.ts +31 -0
- package/s/core/{controllers → devices}/standard/pointer.ts +19 -11
- package/s/core/devices/standard/primary.ts +20 -0
- package/s/core/devices/standard/stick.ts +27 -0
- package/s/core/{controllers/standard/virtual-gamepad.ts → devices/standard/vpad.ts} +9 -9
- package/s/core/{controllers → devices}/types.ts +0 -1
- package/s/core/hub/hub.ts +78 -62
- package/s/core/hub/meta-bindings.ts +23 -0
- package/s/core/hub/parts/connected.ts +15 -0
- package/s/core/hub/port.ts +26 -0
- package/s/core/hub/types.ts +5 -6
- package/s/core/index.ts +12 -14
- package/s/core/testing/testing.ts +19 -14
- package/s/deck/components/components.ts +22 -0
- package/s/deck/components/deck-bindings/component.ts +99 -0
- package/s/deck/components/deck-bindings/style.css.ts +6 -0
- package/s/deck/components/deck-overlay/component.ts +51 -0
- package/s/deck/components/deck-overlay/style.css.ts +110 -0
- package/s/deck/components/framework.ts +17 -0
- package/s/deck/deck.ts +82 -0
- package/s/deck/index.ts +14 -0
- package/s/deck/parts/catalog.ts +58 -0
- package/s/deck/parts/db.ts +66 -0
- package/s/deck/parts/device-skins/device-icons.ts +38 -0
- package/s/deck/parts/device-skins/device-skin.ts +29 -0
- package/s/deck/parts/local-storage-kv.ts +8 -0
- package/s/deck/parts/merge-bindings.ts +21 -0
- package/s/deck/parts/overlay-visibility.ts +49 -0
- package/s/demo/game/game.ts +85 -0
- package/s/demo/game/parts/agent.ts +10 -0
- package/s/demo/game/parts/game-bindings.ts +20 -0
- package/s/demo/game/parts/logic.ts +24 -0
- package/s/demo/game/parts/player.ts +32 -0
- package/s/demo/game/parts/renderer.ts +113 -0
- package/s/demo/game/parts/state.ts +24 -0
- package/s/demo/game/parts/virtual-device.ts +13 -0
- package/s/demo/main.bundle.ts +9 -10
- package/s/demo/main.css +30 -2
- package/s/demo/ui/theater/styles.css.ts +58 -0
- package/s/demo/ui/theater/view.ts +60 -0
- package/s/demo/ui/theater/virtual/style.css.ts +43 -0
- package/s/demo/ui/theater/virtual/view.ts +31 -0
- package/s/demo/ui/utils/loader.ts +5 -0
- package/s/index.html.ts +17 -7
- package/s/index.ts +3 -1
- package/s/nubs/components.ts +14 -0
- package/s/nubs/index.ts +6 -0
- package/s/nubs/lookpad/component.ts +45 -0
- package/s/nubs/stick/component.ts +115 -0
- package/s/nubs/stick/style.css.ts +70 -0
- package/s/nubs/{virtual-gamepad/view.ts → vpad/component.ts} +21 -11
- package/s/nubs/{virtual-gamepad → vpad}/styles.css.ts +5 -4
- package/s/utils/circular-clamp.ts +15 -0
- package/s/utils/dispensers.ts +20 -0
- package/s/utils/split-axis.ts +10 -2
- package/s/utils/types.ts +19 -0
- package/x/core/bindings/action.d.ts +3 -1
- package/x/core/bindings/action.js +12 -4
- package/x/core/bindings/action.js.map +1 -1
- package/x/core/bindings/parts/defaults.js +4 -1
- package/x/core/bindings/parts/defaults.js.map +1 -1
- package/x/core/bindings/parts/lens-algo.js +18 -7
- package/x/core/bindings/parts/lens-algo.js.map +1 -1
- package/x/core/bindings/parts/lookup-proxies.d.ts +1 -0
- package/x/core/bindings/parts/lookup-proxies.js +19 -0
- package/x/core/bindings/parts/lookup-proxies.js.map +1 -0
- package/x/core/bindings/resolver.d.ts +5 -4
- package/x/core/bindings/resolver.js +12 -10
- package/x/core/bindings/resolver.js.map +1 -1
- package/x/core/bindings/sample-map.d.ts +7 -0
- package/x/core/bindings/sample-map.js +22 -0
- package/x/core/bindings/sample-map.js.map +1 -0
- package/x/core/bindings/types.d.ts +4 -1
- package/x/core/core.test.d.ts +5 -4
- package/x/core/core.test.js +45 -34
- package/x/core/core.test.js.map +1 -1
- package/x/core/devices/auto-gamepads.d.ts +2 -0
- package/x/core/devices/auto-gamepads.js +6 -0
- package/x/core/devices/auto-gamepads.js.map +1 -0
- package/x/core/devices/device.d.ts +5 -0
- package/x/core/devices/device.js +7 -0
- package/x/core/devices/device.js.map +1 -0
- package/x/core/devices/infra/group.d.ts +8 -0
- package/x/core/devices/infra/group.js +21 -0
- package/x/core/devices/infra/group.js.map +1 -0
- package/x/core/devices/infra/sampler.d.ts +9 -0
- package/x/core/devices/infra/sampler.js +18 -0
- package/x/core/devices/infra/sampler.js.map +1 -0
- package/x/core/devices/standard/gamepad.d.ts +11 -0
- package/x/core/devices/standard/gamepad.js +65 -0
- package/x/core/devices/standard/gamepad.js.map +1 -0
- package/x/core/{controllers → devices}/standard/index.d.ts +2 -1
- package/x/core/{controllers → devices}/standard/index.js +2 -1
- package/x/core/devices/standard/index.js.map +1 -0
- package/x/core/devices/standard/keyboard.d.ts +9 -0
- package/x/core/devices/standard/keyboard.js +28 -0
- package/x/core/devices/standard/keyboard.js.map +1 -0
- package/x/core/devices/standard/pointer.d.ts +15 -0
- package/x/core/{controllers → devices}/standard/pointer.js +18 -11
- package/x/core/devices/standard/pointer.js.map +1 -0
- package/x/core/devices/standard/primary.d.ts +10 -0
- package/x/core/devices/standard/primary.js +17 -0
- package/x/core/devices/standard/primary.js.map +1 -0
- package/x/core/devices/standard/stick.d.ts +15 -0
- package/x/core/devices/standard/stick.js +24 -0
- package/x/core/devices/standard/stick.js.map +1 -0
- package/x/core/devices/standard/vpad.d.ts +7 -0
- package/x/core/{controllers/standard/virtual-gamepad.js → devices/standard/vpad.js} +10 -10
- package/x/core/devices/standard/vpad.js.map +1 -0
- package/x/core/{controllers → devices}/types.d.ts +0 -1
- package/x/core/{controllers → devices}/types.js.map +1 -1
- package/x/core/hub/hub.d.ts +27 -23
- package/x/core/hub/hub.js +71 -61
- package/x/core/hub/hub.js.map +1 -1
- package/x/core/hub/meta-bindings.d.ts +2 -0
- package/x/core/hub/meta-bindings.js +21 -0
- package/x/core/hub/meta-bindings.js.map +1 -0
- package/x/core/hub/parts/connected.d.ts +14 -0
- package/x/core/hub/parts/connected.js +12 -0
- package/x/core/hub/parts/connected.js.map +1 -0
- package/x/core/hub/port.d.ts +10 -0
- package/x/core/hub/port.js +19 -0
- package/x/core/hub/port.js.map +1 -0
- package/x/core/hub/types.d.ts +5 -5
- package/x/core/hub/types.js +1 -1
- package/x/core/hub/types.js.map +1 -1
- package/x/core/index.d.ts +12 -12
- package/x/core/index.js +12 -12
- package/x/core/index.js.map +1 -1
- package/x/core/testing/testing.d.ts +13 -11
- package/x/core/testing/testing.js +14 -13
- package/x/core/testing/testing.js.map +1 -1
- package/x/deck/components/components.d.ts +14 -0
- package/x/deck/components/components.js +9 -0
- package/x/deck/components/components.js.map +1 -0
- package/x/deck/components/deck-bindings/component.d.ts +6 -0
- package/x/deck/components/deck-bindings/component.js +83 -0
- package/x/deck/components/deck-bindings/component.js.map +1 -0
- package/x/deck/components/deck-bindings/style.css.js +5 -0
- package/x/deck/components/deck-bindings/style.css.js.map +1 -0
- package/x/deck/components/deck-overlay/component.d.ts +6 -0
- package/x/deck/components/deck-overlay/component.js +44 -0
- package/x/deck/components/deck-overlay/component.js.map +1 -0
- package/x/deck/components/deck-overlay/style.css.d.ts +2 -0
- package/x/deck/components/deck-overlay/style.css.js +109 -0
- package/x/deck/components/deck-overlay/style.css.js.map +1 -0
- package/x/deck/components/framework.d.ts +7 -0
- package/x/deck/components/framework.js +13 -0
- package/x/deck/components/framework.js.map +1 -0
- package/x/deck/deck.d.ts +37 -0
- package/x/deck/deck.js +55 -0
- package/x/deck/deck.js.map +1 -0
- package/x/deck/index.d.ts +10 -0
- package/x/deck/index.js +11 -0
- package/x/deck/index.js.map +1 -0
- package/x/deck/parts/catalog.d.ts +23 -0
- package/x/deck/parts/catalog.js +35 -0
- package/x/deck/parts/catalog.js.map +1 -0
- package/x/deck/parts/db.d.ts +20 -0
- package/x/deck/parts/db.js +52 -0
- package/x/deck/parts/db.js.map +1 -0
- package/x/deck/parts/device-skins/device-icons.d.ts +12 -0
- package/x/deck/parts/device-skins/device-icons.js +27 -0
- package/x/deck/parts/device-skins/device-icons.js.map +1 -0
- package/x/deck/parts/device-skins/device-skin.d.ts +14 -0
- package/x/deck/parts/device-skins/device-skin.js +22 -0
- package/x/deck/parts/device-skins/device-skin.js.map +1 -0
- package/x/deck/parts/local-storage-kv.js +6 -0
- package/x/deck/parts/local-storage-kv.js.map +1 -0
- package/x/deck/parts/merge-bindings.d.ts +2 -0
- package/x/deck/parts/merge-bindings.js +15 -0
- package/x/deck/parts/merge-bindings.js.map +1 -0
- package/x/deck/parts/overlay-visibility.d.ts +21 -0
- package/x/deck/parts/overlay-visibility.js +35 -0
- package/x/deck/parts/overlay-visibility.js.map +1 -0
- package/x/demo/game/game.d.ts +20 -0
- package/x/demo/game/game.js +63 -0
- package/x/demo/game/game.js.map +1 -0
- package/x/demo/game/parts/agent.d.ts +7 -0
- package/x/demo/game/parts/agent.js +8 -0
- package/x/demo/game/parts/agent.js.map +1 -0
- package/x/demo/game/parts/game-bindings.d.ts +15 -0
- package/x/demo/game/parts/game-bindings.js +10 -0
- package/x/demo/game/parts/game-bindings.js.map +1 -0
- package/x/demo/game/parts/logic.d.ts +8 -0
- package/x/demo/game/parts/logic.js +21 -0
- package/x/demo/game/parts/logic.js.map +1 -0
- package/x/demo/game/parts/player.d.ts +14 -0
- package/x/demo/game/parts/player.js +26 -0
- package/x/demo/game/parts/player.js.map +1 -0
- package/x/demo/game/parts/renderer.d.ts +13 -0
- package/x/demo/game/parts/renderer.js +91 -0
- package/x/demo/game/parts/renderer.js.map +1 -0
- package/x/demo/game/parts/state.d.ts +8 -0
- package/x/demo/game/parts/state.js +20 -0
- package/x/demo/game/parts/state.js.map +1 -0
- package/x/demo/game/parts/virtual-device.d.ts +8 -0
- package/x/demo/game/parts/virtual-device.js +11 -0
- package/x/demo/game/parts/virtual-device.js.map +1 -0
- package/x/demo/main.bundle.js +9 -9
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +361 -55
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +30 -2
- package/x/demo/ui/theater/styles.css.js +57 -0
- package/x/demo/ui/theater/styles.css.js.map +1 -0
- package/x/demo/ui/theater/view.d.ts +368 -0
- package/x/demo/ui/theater/view.js +50 -0
- package/x/demo/ui/theater/view.js.map +1 -0
- package/x/demo/ui/theater/virtual/style.css.d.ts +2 -0
- package/x/demo/ui/theater/virtual/style.css.js +42 -0
- package/x/demo/ui/theater/virtual/style.css.js.map +1 -0
- package/x/demo/ui/theater/virtual/view.d.ts +4 -0
- package/x/demo/ui/theater/virtual/view.js +19 -0
- package/x/demo/ui/theater/virtual/view.js.map +1 -0
- package/x/demo/ui/utils/loader.d.ts +2 -0
- package/x/demo/ui/utils/loader.js +3 -0
- package/x/demo/ui/utils/loader.js.map +1 -0
- package/x/index.d.ts +3 -1
- package/x/index.html +48 -9
- package/x/index.html.js +17 -7
- package/x/index.html.js.map +1 -1
- package/x/index.js +3 -1
- package/x/index.js.map +1 -1
- package/x/nubs/components.d.ts +9 -0
- package/x/nubs/components.js +11 -0
- package/x/nubs/components.js.map +1 -0
- package/x/nubs/index.d.ts +4 -0
- package/x/nubs/index.js +5 -0
- package/x/nubs/index.js.map +1 -0
- package/x/nubs/lookpad/component.d.ts +4 -0
- package/x/nubs/lookpad/component.js +36 -0
- package/x/nubs/lookpad/component.js.map +1 -0
- package/x/nubs/stick/component.d.ts +368 -0
- package/x/nubs/stick/component.js +101 -0
- package/x/nubs/stick/component.js.map +1 -0
- package/x/nubs/stick/style.css.d.ts +2 -0
- package/x/nubs/stick/style.css.js +69 -0
- package/x/nubs/stick/style.css.js.map +1 -0
- package/x/nubs/vpad/component.d.ts +368 -0
- package/x/nubs/{virtual-gamepad/view.js → vpad/component.js} +20 -11
- package/x/nubs/vpad/component.js.map +1 -0
- package/x/nubs/vpad/styles.css.d.ts +2 -0
- package/x/nubs/{virtual-gamepad → vpad}/styles.css.js +4 -4
- package/x/nubs/vpad/styles.css.js.map +1 -0
- package/x/nubs/vpad/utils/gamepad-inputs.js.map +1 -0
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +1 -0
- package/x/nubs/vpad/utils/touch-tracking.js.map +1 -0
- package/x/utils/circular-clamp.d.ts +2 -0
- package/x/utils/circular-clamp.js +8 -0
- package/x/utils/circular-clamp.js.map +1 -0
- package/x/utils/dispensers.d.ts +7 -0
- package/x/utils/dispensers.js +16 -0
- package/x/utils/dispensers.js.map +1 -0
- package/x/utils/split-axis.d.ts +7 -0
- package/x/utils/split-axis.js +7 -2
- package/x/utils/split-axis.js.map +1 -1
- package/x/utils/types.d.ts +3 -0
- package/x/utils/types.js +3 -0
- package/x/utils/types.js.map +1 -0
- package/s/core/controllers/controller.ts +0 -7
- package/s/core/controllers/infra/group.ts +0 -17
- package/s/core/controllers/infra/sampler.ts +0 -22
- package/s/core/controllers/standard/gamepad.ts +0 -77
- package/s/core/controllers/standard/keyboard.ts +0 -50
- package/s/core/controllers/standard/stick.ts +0 -30
- package/s/core/deck/deck.ts +0 -40
- package/s/core/deck/parts/bindings-depot.ts +0 -24
- package/s/core/deck/parts/local-storage-kv.ts +0 -7
- package/s/core/hub/auto-gamepads.ts +0 -8
- package/s/core/hub/bindings.ts +0 -18
- package/s/core/port/port.ts +0 -34
- package/s/core/port/utils/aggregate_samples_into_map.ts +0 -20
- package/s/core/port/utils/wipe_samples_map.ts +0 -8
- package/s/nubs/lookpad/utils/listeners.ts +0 -53
- package/s/nubs/lookpad/view.ts +0 -32
- package/s/nubs/stick/styles.ts +0 -22
- package/s/nubs/stick/utils/calculate_new_vector_from_pointer_position.ts +0 -27
- package/s/nubs/stick/utils/find_closest_point_on_circle.ts +0 -15
- package/s/nubs/stick/utils/make_pointer_listeners.ts +0 -50
- package/s/nubs/stick/utils/within_radius.ts +0 -6
- package/s/nubs/stick/view.ts +0 -50
- package/s/nubs/stick-graphic/styles.ts +0 -38
- package/s/nubs/stick-graphic/types/basis.ts +0 -5
- package/s/nubs/stick-graphic/utils/calculate_basis.ts +0 -19
- package/s/nubs/stick-graphic/utils/stick_vector_to_pixels.ts +0 -13
- package/s/nubs/stick-graphic/utils/transform.ts +0 -10
- package/s/nubs/stick-graphic/view.ts +0 -43
- package/x/core/controllers/controller.d.ts +0 -4
- package/x/core/controllers/controller.js +0 -3
- package/x/core/controllers/controller.js.map +0 -1
- package/x/core/controllers/infra/group.d.ts +0 -7
- package/x/core/controllers/infra/group.js +0 -13
- package/x/core/controllers/infra/group.js.map +0 -1
- package/x/core/controllers/infra/sampler.d.ts +0 -8
- package/x/core/controllers/infra/sampler.js +0 -17
- package/x/core/controllers/infra/sampler.js.map +0 -1
- package/x/core/controllers/standard/gamepad.d.ts +0 -9
- package/x/core/controllers/standard/gamepad.js +0 -66
- package/x/core/controllers/standard/gamepad.js.map +0 -1
- package/x/core/controllers/standard/index.js.map +0 -1
- package/x/core/controllers/standard/keyboard.d.ts +0 -9
- package/x/core/controllers/standard/keyboard.js +0 -39
- package/x/core/controllers/standard/keyboard.js.map +0 -1
- package/x/core/controllers/standard/pointer.d.ts +0 -11
- package/x/core/controllers/standard/pointer.js.map +0 -1
- package/x/core/controllers/standard/stick.d.ts +0 -15
- package/x/core/controllers/standard/stick.js +0 -27
- package/x/core/controllers/standard/stick.js.map +0 -1
- package/x/core/controllers/standard/virtual-gamepad.d.ts +0 -7
- package/x/core/controllers/standard/virtual-gamepad.js.map +0 -1
- package/x/core/deck/deck.d.ts +0 -16
- package/x/core/deck/deck.js +0 -31
- package/x/core/deck/deck.js.map +0 -1
- package/x/core/deck/parts/bindings-depot.d.ts +0 -9
- package/x/core/deck/parts/bindings-depot.js +0 -19
- package/x/core/deck/parts/bindings-depot.js.map +0 -1
- package/x/core/deck/parts/local-storage-kv.js +0 -5
- package/x/core/deck/parts/local-storage-kv.js.map +0 -1
- package/x/core/hub/auto-gamepads.d.ts +0 -2
- package/x/core/hub/auto-gamepads.js +0 -6
- package/x/core/hub/auto-gamepads.js.map +0 -1
- package/x/core/hub/bindings.d.ts +0 -2
- package/x/core/hub/bindings.js +0 -16
- package/x/core/hub/bindings.js.map +0 -1
- package/x/core/port/port.d.ts +0 -12
- package/x/core/port/port.js +0 -25
- package/x/core/port/port.js.map +0 -1
- package/x/core/port/utils/aggregate_samples_into_map.d.ts +0 -3
- package/x/core/port/utils/aggregate_samples_into_map.js +0 -11
- package/x/core/port/utils/aggregate_samples_into_map.js.map +0 -1
- package/x/core/port/utils/wipe_samples_map.d.ts +0 -2
- package/x/core/port/utils/wipe_samples_map.js +0 -5
- package/x/core/port/utils/wipe_samples_map.js.map +0 -1
- package/x/nubs/lookpad/utils/listeners.d.ts +0 -19
- package/x/nubs/lookpad/utils/listeners.js +0 -37
- package/x/nubs/lookpad/utils/listeners.js.map +0 -1
- package/x/nubs/lookpad/view.d.ts +0 -1
- package/x/nubs/lookpad/view.js +0 -24
- package/x/nubs/lookpad/view.js.map +0 -1
- package/x/nubs/stick/styles.d.ts +0 -1
- package/x/nubs/stick/styles.js +0 -22
- package/x/nubs/stick/styles.js.map +0 -1
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.d.ts +0 -3
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js +0 -16
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js.map +0 -1
- package/x/nubs/stick/utils/find_closest_point_on_circle.d.ts +0 -2
- package/x/nubs/stick/utils/find_closest_point_on_circle.js +0 -6
- package/x/nubs/stick/utils/find_closest_point_on_circle.js.map +0 -1
- package/x/nubs/stick/utils/make_pointer_listeners.d.ts +0 -16
- package/x/nubs/stick/utils/make_pointer_listeners.js +0 -34
- package/x/nubs/stick/utils/make_pointer_listeners.js.map +0 -1
- package/x/nubs/stick/utils/within_radius.d.ts +0 -2
- package/x/nubs/stick/utils/within_radius.js +0 -4
- package/x/nubs/stick/utils/within_radius.js.map +0 -1
- package/x/nubs/stick/view.d.ts +0 -2
- package/x/nubs/stick/view.js +0 -38
- package/x/nubs/stick/view.js.map +0 -1
- package/x/nubs/stick-graphic/styles.js +0 -38
- package/x/nubs/stick-graphic/styles.js.map +0 -1
- package/x/nubs/stick-graphic/types/basis.d.ts +0 -4
- package/x/nubs/stick-graphic/types/basis.js +0 -2
- package/x/nubs/stick-graphic/types/basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/calculate_basis.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/calculate_basis.js +0 -10
- package/x/nubs/stick-graphic/utils/calculate_basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js +0 -7
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js.map +0 -1
- package/x/nubs/stick-graphic/utils/transform.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/transform.js +0 -7
- package/x/nubs/stick-graphic/utils/transform.js.map +0 -1
- package/x/nubs/stick-graphic/view.d.ts +0 -3
- package/x/nubs/stick-graphic/view.js +0 -30
- package/x/nubs/stick-graphic/view.js.map +0 -1
- package/x/nubs/virtual-gamepad/styles.css.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/gamepad-inputs.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/prevent-default-touch-shenanigans.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/touch-tracking.js.map +0 -1
- package/x/nubs/virtual-gamepad/view.d.ts +0 -2
- package/x/nubs/virtual-gamepad/view.js.map +0 -1
- /package/s/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.ts +0 -0
- /package/x/core/{controllers → devices}/types.js +0 -0
- /package/x/{nubs/virtual-gamepad/styles.css.d.ts → deck/components/deck-bindings/style.css.d.ts} +0 -0
- /package/x/{core/deck → deck}/parts/local-storage-kv.d.ts +0 -0
- /package/x/{nubs/stick-graphic/styles.d.ts → demo/ui/theater/styles.css.d.ts} +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export class Renderer {
|
|
2
|
+
state;
|
|
3
|
+
canvas = (() => {
|
|
4
|
+
const canvas = document.createElement("canvas");
|
|
5
|
+
canvas.width = 200;
|
|
6
|
+
canvas.height = 100;
|
|
7
|
+
return canvas;
|
|
8
|
+
})();
|
|
9
|
+
ctx = this.canvas.getContext("2d");
|
|
10
|
+
constructor(state) {
|
|
11
|
+
this.state = state;
|
|
12
|
+
}
|
|
13
|
+
percent(n) {
|
|
14
|
+
const shorty = Math.min(this.canvas.width, this.canvas.height);
|
|
15
|
+
return Math.ceil(shorty * (n / 100));
|
|
16
|
+
}
|
|
17
|
+
/** take a game-state position and resolve it into canvas coordinates */
|
|
18
|
+
resolve(position) {
|
|
19
|
+
return position.clone()
|
|
20
|
+
// 0-1 relative to arena scale
|
|
21
|
+
.divide(this.state.arenaSize)
|
|
22
|
+
// flip y axis
|
|
23
|
+
.morph(v => { v.y = 1 - v.y; })
|
|
24
|
+
// stretch to the size of the canvas
|
|
25
|
+
.multiply_(this.canvas.width, this.canvas.height);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const { state } = this;
|
|
29
|
+
this.#renderBackground();
|
|
30
|
+
const agents = [...state.agents].reverse();
|
|
31
|
+
const dead = agents.filter(a => !a.alive);
|
|
32
|
+
const alive = agents.filter(a => a.alive);
|
|
33
|
+
for (const agent of dead)
|
|
34
|
+
this.#renderDeadAgent(agent);
|
|
35
|
+
for (const agent of alive)
|
|
36
|
+
this.#renderAliveAgent(agent);
|
|
37
|
+
}
|
|
38
|
+
#getCleanCtx() {
|
|
39
|
+
const { ctx } = this;
|
|
40
|
+
ctx.imageSmoothingEnabled = false;
|
|
41
|
+
ctx.fillStyle = "#000";
|
|
42
|
+
ctx.strokeStyle = "#000";
|
|
43
|
+
ctx.lineWidth = 1;
|
|
44
|
+
ctx.font = `10px sans-serif`;
|
|
45
|
+
ctx.textAlign = "center";
|
|
46
|
+
ctx.textBaseline = "middle";
|
|
47
|
+
return ctx;
|
|
48
|
+
}
|
|
49
|
+
#renderBackground() {
|
|
50
|
+
const { canvas } = this;
|
|
51
|
+
const ctx = this.#getCleanCtx();
|
|
52
|
+
ctx.fillStyle = "#000";
|
|
53
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
54
|
+
}
|
|
55
|
+
#renderDeadAgent(agent) {
|
|
56
|
+
const ctx = this.#getCleanCtx();
|
|
57
|
+
const radius = this.percent(10);
|
|
58
|
+
const { position } = agent;
|
|
59
|
+
const [x, y] = this.resolve(position);
|
|
60
|
+
// draw label
|
|
61
|
+
ctx.font = `${radius * 1.3}px sans-serif`;
|
|
62
|
+
ctx.textAlign = "center";
|
|
63
|
+
ctx.textBaseline = "middle";
|
|
64
|
+
ctx.fillStyle = "#fff4";
|
|
65
|
+
ctx.fillText(agent.label, x, y);
|
|
66
|
+
}
|
|
67
|
+
#renderAliveAgent(agent) {
|
|
68
|
+
const ctx = this.#getCleanCtx();
|
|
69
|
+
const radius = this.percent(10);
|
|
70
|
+
const { color, position } = agent;
|
|
71
|
+
const [x, y] = this.resolve(position);
|
|
72
|
+
// circle
|
|
73
|
+
ctx.beginPath();
|
|
74
|
+
ctx.arc(x, y, radius, 0, Math.PI * 2);
|
|
75
|
+
ctx.fillStyle = color;
|
|
76
|
+
ctx.fill();
|
|
77
|
+
// outline
|
|
78
|
+
ctx.lineWidth = this.percent(2);
|
|
79
|
+
ctx.strokeStyle = "#fff";
|
|
80
|
+
ctx.stroke();
|
|
81
|
+
// draw label
|
|
82
|
+
ctx.font = `${radius * 1.3}px sans-serif`;
|
|
83
|
+
ctx.textAlign = "center";
|
|
84
|
+
ctx.textBaseline = "middle";
|
|
85
|
+
ctx.strokeStyle = "#0004";
|
|
86
|
+
ctx.strokeText(agent.label, x, y);
|
|
87
|
+
ctx.fillStyle = "#fff";
|
|
88
|
+
ctx.fillText(agent.label, x, y);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/renderer.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,QAAQ;IAUD;IATnB,MAAM,GAAG,CAAC,GAAG,EAAE;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC/C,MAAM,CAAC,KAAK,GAAG,GAAG,CAAA;QAClB,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;QACnB,OAAO,MAAM,CAAA;IACd,CAAC,CAAC,EAAE,CAAA;IAEJ,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAE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C,CAAC,CAAA;IAChC,CAAC;CACD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vec2 } from "@benev/math";
|
|
2
|
+
import { Agent } from "./agent.js";
|
|
3
|
+
export class State {
|
|
4
|
+
arenaSize = new Vec2(200, 100);
|
|
5
|
+
agents = new Set();
|
|
6
|
+
makeAgent(label) {
|
|
7
|
+
const agent = new Agent();
|
|
8
|
+
agent.label = label;
|
|
9
|
+
agent.position
|
|
10
|
+
.set_(0.5, 0.5)
|
|
11
|
+
.multiply(this.arenaSize);
|
|
12
|
+
this.agents.add(agent);
|
|
13
|
+
return agent;
|
|
14
|
+
}
|
|
15
|
+
deleteAgent(agent) {
|
|
16
|
+
this.agents.delete(agent);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/state.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,MAAM,OAAO,KAAK;IACjB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,MAAM,GAAG,IAAI,GAAG,EAAS,CAAA;IAEzB,SAAS,CAAC,KAAa;QACtB,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;QACnB,KAAK,CAAC,QAAQ;aACZ,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;aACd,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACtB,OAAO,KAAK,CAAA;IACb,CAAC;IAED,WAAW,CAAC,KAAY;QACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACzB,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Hub } from "../../../core/hub/hub.js";
|
|
2
|
+
import { StickDevice } from "../../../core/devices/standard/stick.js";
|
|
3
|
+
export declare class VirtualDevice extends StickDevice {
|
|
4
|
+
private hub;
|
|
5
|
+
constructor(hub: Hub<any>);
|
|
6
|
+
shimmyNext: () => import("../../../index.js").Port<any>;
|
|
7
|
+
shimmyPrevious: () => import("../../../index.js").Port<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StickDevice } from "../../../core/devices/standard/stick.js";
|
|
2
|
+
export class VirtualDevice extends StickDevice {
|
|
3
|
+
hub;
|
|
4
|
+
constructor(hub) {
|
|
5
|
+
super();
|
|
6
|
+
this.hub = hub;
|
|
7
|
+
}
|
|
8
|
+
shimmyNext = () => this.hub.shimmy(this, 1);
|
|
9
|
+
shimmyPrevious = () => this.hub.shimmy(this, -1);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=virtual-device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-device.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/virtual-device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,yCAAyC,CAAA;AAEnE,MAAM,OAAO,aAAc,SAAQ,WAAW;IACzB;IAApB,YAAoB,GAAa;QAChC,KAAK,EAAE,CAAA;QADY,QAAG,GAAH,GAAG,CAAU;IAEjC,CAAC;IAED,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC3C,cAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;CAChD"}
|
package/x/demo/main.bundle.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import { dom } from "@e280/sly";
|
|
2
|
+
import { Game } from "./game/game.js";
|
|
3
|
+
import { DemoTheater } from "./ui/theater/view.js";
|
|
4
|
+
const game = await Game.load();
|
|
5
|
+
dom.register({
|
|
6
|
+
DemoTheater: class extends DemoTheater {
|
|
7
|
+
game = game;
|
|
8
|
+
},
|
|
9
9
|
});
|
|
10
|
-
console.log("tact");
|
|
10
|
+
console.log("🎮 tact");
|
|
11
11
|
//# sourceMappingURL=main.bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.bundle.js","sourceRoot":"","sources":["../../s/demo/main.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"main.bundle.js","sourceRoot":"","sources":["../../s/demo/main.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAA;AAEhD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;AAE9B,GAAG,CAAC,QAAQ,CAAC;IACZ,WAAW,EAAE,KAAM,SAAQ,WAAW;QAAG,IAAI,GAAG,IAAI,CAAA;KAAE;CACtD,CAAC,CAAA;AAEF,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA"}
|