@zylem/behaviors 0.2.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.
Files changed (175) hide show
  1. package/README.md +26 -0
  2. package/dist/behavior-system-DYbx-x_-.d.ts +307 -0
  3. package/dist/chunk-2C3Z5GE7.js +176 -0
  4. package/dist/chunk-2C3Z5GE7.js.map +1 -0
  5. package/dist/chunk-2CLT36VB.js +241 -0
  6. package/dist/chunk-2CLT36VB.js.map +1 -0
  7. package/dist/chunk-3PYGRHAL.js +35 -0
  8. package/dist/chunk-3PYGRHAL.js.map +1 -0
  9. package/dist/chunk-4I6E6DGV.js +212 -0
  10. package/dist/chunk-4I6E6DGV.js.map +1 -0
  11. package/dist/chunk-4URF65BR.js +44 -0
  12. package/dist/chunk-4URF65BR.js.map +1 -0
  13. package/dist/chunk-6C6NXNEW.js +38 -0
  14. package/dist/chunk-6C6NXNEW.js.map +1 -0
  15. package/dist/chunk-ARJWUNRE.js +431 -0
  16. package/dist/chunk-ARJWUNRE.js.map +1 -0
  17. package/dist/chunk-BXP4K7RF.js +1205 -0
  18. package/dist/chunk-BXP4K7RF.js.map +1 -0
  19. package/dist/chunk-DYLH6K7B.js +44 -0
  20. package/dist/chunk-DYLH6K7B.js.map +1 -0
  21. package/dist/chunk-EIWQM6U3.js +27 -0
  22. package/dist/chunk-EIWQM6U3.js.map +1 -0
  23. package/dist/chunk-EZNCCO4L.js +14 -0
  24. package/dist/chunk-EZNCCO4L.js.map +1 -0
  25. package/dist/chunk-F3KRX2V4.js +457 -0
  26. package/dist/chunk-F3KRX2V4.js.map +1 -0
  27. package/dist/chunk-FPTWVCPN.js +53 -0
  28. package/dist/chunk-FPTWVCPN.js.map +1 -0
  29. package/dist/chunk-GCNRXAKH.js +37 -0
  30. package/dist/chunk-GCNRXAKH.js.map +1 -0
  31. package/dist/chunk-GYURWCIQ.js +1985 -0
  32. package/dist/chunk-GYURWCIQ.js.map +1 -0
  33. package/dist/chunk-HZMY3TT4.js +244 -0
  34. package/dist/chunk-HZMY3TT4.js.map +1 -0
  35. package/dist/chunk-ID5QJYF5.js +50 -0
  36. package/dist/chunk-ID5QJYF5.js.map +1 -0
  37. package/dist/chunk-JAN34G6S.js +552 -0
  38. package/dist/chunk-JAN34G6S.js.map +1 -0
  39. package/dist/chunk-K3UNLQ7W.js +118 -0
  40. package/dist/chunk-K3UNLQ7W.js.map +1 -0
  41. package/dist/chunk-KDY5N6J4.js +82 -0
  42. package/dist/chunk-KDY5N6J4.js.map +1 -0
  43. package/dist/chunk-KOZUNIIE.js +413 -0
  44. package/dist/chunk-KOZUNIIE.js.map +1 -0
  45. package/dist/chunk-KS72RZHX.js +30 -0
  46. package/dist/chunk-KS72RZHX.js.map +1 -0
  47. package/dist/chunk-LD5SMIB3.js +32 -0
  48. package/dist/chunk-LD5SMIB3.js.map +1 -0
  49. package/dist/chunk-OHCPV2NT.js +86 -0
  50. package/dist/chunk-OHCPV2NT.js.map +1 -0
  51. package/dist/chunk-OYWFPIHF.js +115 -0
  52. package/dist/chunk-OYWFPIHF.js.map +1 -0
  53. package/dist/chunk-POZER3MQ.js +407 -0
  54. package/dist/chunk-POZER3MQ.js.map +1 -0
  55. package/dist/chunk-RTRVBEIB.js +56 -0
  56. package/dist/chunk-RTRVBEIB.js.map +1 -0
  57. package/dist/chunk-RTVRUNYR.js +29 -0
  58. package/dist/chunk-RTVRUNYR.js.map +1 -0
  59. package/dist/chunk-SS7ELMJ7.js +406 -0
  60. package/dist/chunk-SS7ELMJ7.js.map +1 -0
  61. package/dist/chunk-STCCNLPC.js +160 -0
  62. package/dist/chunk-STCCNLPC.js.map +1 -0
  63. package/dist/chunk-SVLNF434.js +261 -0
  64. package/dist/chunk-SVLNF434.js.map +1 -0
  65. package/dist/chunk-UYFOLI2X.js +24 -0
  66. package/dist/chunk-UYFOLI2X.js.map +1 -0
  67. package/dist/chunk-VAN4WW3F.js +67 -0
  68. package/dist/chunk-VAN4WW3F.js.map +1 -0
  69. package/dist/chunk-WOMHL23C.js +369 -0
  70. package/dist/chunk-WOMHL23C.js.map +1 -0
  71. package/dist/chunk-WWVD5DR5.js +120 -0
  72. package/dist/chunk-WWVD5DR5.js.map +1 -0
  73. package/dist/chunk-XG2YMCJW.js +201 -0
  74. package/dist/chunk-XG2YMCJW.js.map +1 -0
  75. package/dist/chunk-XIJNE67Y.js +210 -0
  76. package/dist/chunk-XIJNE67Y.js.map +1 -0
  77. package/dist/chunk-Y6UJOUE5.js +44 -0
  78. package/dist/chunk-Y6UJOUE5.js.map +1 -0
  79. package/dist/chunk-YUO6SKJD.js +348 -0
  80. package/dist/chunk-YUO6SKJD.js.map +1 -0
  81. package/dist/components--hjBMTnz.d.ts +120 -0
  82. package/dist/components-B29WHGQN.d.ts +39 -0
  83. package/dist/components-BWG1GkZA.d.ts +20 -0
  84. package/dist/components-XCpL6IYt.d.ts +18 -0
  85. package/dist/components-qWwOsvwh.d.ts +43 -0
  86. package/dist/cooldown.d.ts +116 -0
  87. package/dist/cooldown.js +20 -0
  88. package/dist/cooldown.js.map +1 -0
  89. package/dist/coordinators/boundary-ricochet-3d.d.ts +19 -0
  90. package/dist/coordinators/boundary-ricochet-3d.js +8 -0
  91. package/dist/coordinators/boundary-ricochet-3d.js.map +1 -0
  92. package/dist/coordinators/boundary-ricochet.d.ts +34 -0
  93. package/dist/coordinators/boundary-ricochet.js +8 -0
  94. package/dist/coordinators/boundary-ricochet.js.map +1 -0
  95. package/dist/coordinators/first-person-shooter.d.ts +35 -0
  96. package/dist/coordinators/first-person-shooter.js +9 -0
  97. package/dist/coordinators/first-person-shooter.js.map +1 -0
  98. package/dist/coordinators/multidirectional-space-shooter.d.ts +27 -0
  99. package/dist/coordinators/multidirectional-space-shooter.js +10 -0
  100. package/dist/coordinators/multidirectional-space-shooter.js.map +1 -0
  101. package/dist/coordinators/top-down-shooter.d.ts +27 -0
  102. package/dist/coordinators/top-down-shooter.js +10 -0
  103. package/dist/coordinators/top-down-shooter.js.map +1 -0
  104. package/dist/core.d.ts +25 -0
  105. package/dist/core.js +327 -0
  106. package/dist/core.js.map +1 -0
  107. package/dist/destructible-3d.d.ts +42 -0
  108. package/dist/destructible-3d.js +13 -0
  109. package/dist/destructible-3d.js.map +1 -0
  110. package/dist/destructible-prebake.d.ts +28 -0
  111. package/dist/destructible-prebake.js +23 -0
  112. package/dist/destructible-prebake.js.map +1 -0
  113. package/dist/entity-types-CmtQ-IBp.d.ts +15 -0
  114. package/dist/first-person-perspective-C9Mptl0-.d.ts +23 -0
  115. package/dist/first-person.d.ts +204 -0
  116. package/dist/first-person.js +27 -0
  117. package/dist/first-person.js.map +1 -0
  118. package/dist/index.d.ts +40 -0
  119. package/dist/index.js +263 -0
  120. package/dist/index.js.map +1 -0
  121. package/dist/jumper-2d.d.ts +113 -0
  122. package/dist/jumper-2d.js +27 -0
  123. package/dist/jumper-2d.js.map +1 -0
  124. package/dist/jumper-3d.d.ts +164 -0
  125. package/dist/jumper-3d.js +29 -0
  126. package/dist/jumper-3d.js.map +1 -0
  127. package/dist/moveable-BCRpjAQb.d.ts +176 -0
  128. package/dist/particle-emitter/presets.d.ts +46 -0
  129. package/dist/particle-emitter/presets.js +15 -0
  130. package/dist/particle-emitter/presets.js.map +1 -0
  131. package/dist/particle-emitter.d.ts +78 -0
  132. package/dist/particle-emitter.js +15 -0
  133. package/dist/particle-emitter.js.map +1 -0
  134. package/dist/payload-BQzu-oY_.d.ts +89 -0
  135. package/dist/platformer-3d.d.ts +347 -0
  136. package/dist/platformer-3d.js +23 -0
  137. package/dist/platformer-3d.js.map +1 -0
  138. package/dist/ricochet-2d.d.ts +274 -0
  139. package/dist/ricochet-2d.js +16 -0
  140. package/dist/ricochet-2d.js.map +1 -0
  141. package/dist/ricochet-3d.d.ts +116 -0
  142. package/dist/ricochet-3d.js +16 -0
  143. package/dist/ricochet-3d.js.map +1 -0
  144. package/dist/runtime-2d.d.ts +2 -0
  145. package/dist/runtime-2d.js +32 -0
  146. package/dist/runtime-2d.js.map +1 -0
  147. package/dist/runtime-pong.d.ts +92 -0
  148. package/dist/runtime-pong.js +38 -0
  149. package/dist/runtime-pong.js.map +1 -0
  150. package/dist/screen-visibility.d.ts +74 -0
  151. package/dist/screen-visibility.js +10 -0
  152. package/dist/screen-visibility.js.map +1 -0
  153. package/dist/screen-wrap.d.ts +86 -0
  154. package/dist/screen-wrap.js +16 -0
  155. package/dist/screen-wrap.js.map +1 -0
  156. package/dist/shooter-2d.d.ts +77 -0
  157. package/dist/shooter-2d.js +12 -0
  158. package/dist/shooter-2d.js.map +1 -0
  159. package/dist/spark-DDlIg1nM.d.ts +148 -0
  160. package/dist/sync-state-machine-CZyspBpj.d.ts +16 -0
  161. package/dist/thruster.d.ts +132 -0
  162. package/dist/thruster.js +26 -0
  163. package/dist/thruster.js.map +1 -0
  164. package/dist/top-down-movement.d.ts +40 -0
  165. package/dist/top-down-movement.js +20 -0
  166. package/dist/top-down-movement.js.map +1 -0
  167. package/dist/use-behavior-D_82jAL3.d.ts +13 -0
  168. package/dist/vector-Bm65-FOG.d.ts +45 -0
  169. package/dist/world-boundary-2d.d.ts +141 -0
  170. package/dist/world-boundary-2d.js +21 -0
  171. package/dist/world-boundary-2d.js.map +1 -0
  172. package/dist/world-boundary-3d.d.ts +75 -0
  173. package/dist/world-boundary-3d.js +21 -0
  174. package/dist/world-boundary-3d.js.map +1 -0
  175. package/package.json +161 -0
@@ -0,0 +1,116 @@
1
+ import { a as BehaviorDescriptor } from './behavior-system-DYbx-x_-.js';
2
+
3
+ /**
4
+ * CooldownBehavior
5
+ *
6
+ * A stage-scoped behavior that manages named cooldowns via the global CooldownStore.
7
+ * Entities use this to register, check, and fire cooldowns.
8
+ * UI components (CooldownIcon) can read from the same store.
9
+ */
10
+ interface CooldownConfig {
11
+ /** Duration in seconds */
12
+ duration: number;
13
+ /** Whether the cooldown starts ready (default: true) */
14
+ immediate?: boolean;
15
+ }
16
+ interface CooldownOptions {
17
+ /**
18
+ * Named cooldowns to register.
19
+ * Keys are the cooldown names, values are their config.
20
+ */
21
+ cooldowns: Record<string, CooldownConfig>;
22
+ }
23
+ /**
24
+ * Handle methods returned by entity.use(CooldownBehavior, ...).
25
+ */
26
+ interface CooldownHandle {
27
+ /** Check if a named cooldown is ready */
28
+ isReady(name: string): boolean;
29
+ /** Fire (trigger) a named cooldown, resetting its timer */
30
+ fire(name: string): void;
31
+ /** Force a cooldown to ready immediately */
32
+ reset(name: string): void;
33
+ /** Get cooldown progress 0..1 (0 = just fired, 1 = ready) */
34
+ getProgress(name: string): number;
35
+ }
36
+ /**
37
+ * CooldownBehavior
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * import { CooldownBehavior } from '@zylem/game-lib/behavior';
42
+ * import { moveBy } from '@zylem/game-lib/actions';
43
+ *
44
+ * const hero = createBox({ ... });
45
+ * const cd = hero.use(CooldownBehavior, {
46
+ * cooldowns: {
47
+ * attack: { duration: 5 },
48
+ * dash: { duration: 2, immediate: false },
49
+ * },
50
+ * });
51
+ *
52
+ * hero.onUpdate(({ me, inputs }) => {
53
+ * if (cd.isReady('attack') && inputs.p1.buttons.A.pressed) {
54
+ * cd.fire('attack');
55
+ * // perform attack
56
+ * }
57
+ * if (cd.isReady('dash') && inputs.p1.buttons.B.pressed) {
58
+ * cd.fire('dash');
59
+ * me.runAction(moveBy({ x: 10, duration: 0.3 }));
60
+ * }
61
+ * });
62
+ * ```
63
+ */
64
+ declare const CooldownBehavior: BehaviorDescriptor<CooldownOptions, CooldownHandle, unknown>;
65
+
66
+ /**
67
+ * A single cooldown entry in the global store.
68
+ */
69
+ interface CooldownEntry {
70
+ /** Identifier for this cooldown */
71
+ name: string;
72
+ /** Total cooldown time in seconds */
73
+ duration: number;
74
+ /** Time accumulated since last fire */
75
+ elapsed: number;
76
+ /** Whether the cooldown is ready (elapsed >= duration) */
77
+ ready: boolean;
78
+ /** Normalized progress 0..1 (0 = just fired, 1 = ready) */
79
+ progress: number;
80
+ /** Whether this cooldown is currently counting down */
81
+ active: boolean;
82
+ }
83
+ /**
84
+ * Register a named cooldown in the global store.
85
+ * If a cooldown with the same name already exists, it is overwritten.
86
+ *
87
+ * @param name Unique cooldown identifier
88
+ * @param duration Cooldown duration in seconds
89
+ * @param immediate If true, the cooldown starts ready (default: true)
90
+ */
91
+ declare function registerCooldown(name: string, duration: number, immediate?: boolean): void;
92
+ /**
93
+ * Get a cooldown entry by name.
94
+ * Returns undefined if the cooldown has not been registered.
95
+ */
96
+ declare function getCooldown(name: string): CooldownEntry | undefined;
97
+ /**
98
+ * Fire (trigger) a cooldown, resetting its timer.
99
+ * Sets the cooldown to not-ready and starts the countdown.
100
+ */
101
+ declare function fireCooldown(name: string): void;
102
+ /**
103
+ * Force a cooldown to ready immediately.
104
+ */
105
+ declare function resetCooldown(name: string): void;
106
+ /**
107
+ * Advance all active cooldowns by delta seconds.
108
+ * Called once per frame by the CooldownBehavior system.
109
+ */
110
+ declare function tickCooldowns(delta: number): void;
111
+ /**
112
+ * Get the raw cooldown store (for advanced/debugging use).
113
+ */
114
+ declare function getCooldownStore(): Record<string, CooldownEntry>;
115
+
116
+ export { CooldownBehavior, type CooldownConfig, type CooldownEntry, type CooldownHandle, type CooldownOptions, fireCooldown, getCooldown, getCooldownStore, registerCooldown, resetCooldown, tickCooldowns };
@@ -0,0 +1,20 @@
1
+ import {
2
+ CooldownBehavior,
3
+ fireCooldown,
4
+ getCooldown,
5
+ getCooldownStore,
6
+ registerCooldown,
7
+ resetCooldown,
8
+ tickCooldowns
9
+ } from "./chunk-K3UNLQ7W.js";
10
+ import "./chunk-EZNCCO4L.js";
11
+ export {
12
+ CooldownBehavior,
13
+ fireCooldown,
14
+ getCooldown,
15
+ getCooldownStore,
16
+ registerCooldown,
17
+ resetCooldown,
18
+ tickCooldowns
19
+ };
20
+ //# sourceMappingURL=cooldown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,19 @@
1
+ import { G as GameEntity } from '../behavior-system-DYbx-x_-.js';
2
+ import { M as MoveableEntity } from '../moveable-BCRpjAQb.js';
3
+ import { Ricochet3DHandle } from '../ricochet-3d.js';
4
+ import { WorldBoundary3DHandle } from '../world-boundary-3d.js';
5
+ import 'three';
6
+ import '@dimforge/rapier3d-compat';
7
+ import '../sync-state-machine-CZyspBpj.js';
8
+ import 'typescript-fsm';
9
+ import '../entity-types-CmtQ-IBp.js';
10
+
11
+ declare class BoundaryRicochet3DCoordinator {
12
+ private entity;
13
+ private boundary;
14
+ private ricochet;
15
+ constructor(entity: GameEntity<any> & MoveableEntity, boundary: WorldBoundary3DHandle, ricochet: Ricochet3DHandle);
16
+ update(): boolean;
17
+ }
18
+
19
+ export { BoundaryRicochet3DCoordinator };
@@ -0,0 +1,8 @@
1
+ import {
2
+ BoundaryRicochet3DCoordinator
3
+ } from "../chunk-3PYGRHAL.js";
4
+ import "../chunk-OHCPV2NT.js";
5
+ export {
6
+ BoundaryRicochet3DCoordinator
7
+ };
8
+ //# sourceMappingURL=boundary-ricochet-3d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,34 @@
1
+ import { G as GameEntity } from '../behavior-system-DYbx-x_-.js';
2
+ import { Ricochet2DHandle } from '../ricochet-2d.js';
3
+ import { WorldBoundary2DHandle } from '../world-boundary-2d.js';
4
+ import { M as MoveableEntity } from '../moveable-BCRpjAQb.js';
5
+ import '../entity-types-CmtQ-IBp.js';
6
+ import 'three';
7
+ import '@dimforge/rapier3d-compat';
8
+ import '../sync-state-machine-CZyspBpj.js';
9
+ import 'typescript-fsm';
10
+
11
+ /**
12
+ * Coordinator that bridges WorldBoundary2DBehavior and Ricochet2DBehavior.
13
+ *
14
+ * Automatically handles:
15
+ * 1. Checking boundary hits
16
+ * 2. Computing collision normals
17
+ * 3. Requesting ricochet result
18
+ * 4. Applying movement
19
+ */
20
+ declare class BoundaryRicochetCoordinator {
21
+ private entity;
22
+ private boundary;
23
+ private ricochet;
24
+ constructor(entity: GameEntity<any> & MoveableEntity, boundary: WorldBoundary2DHandle, ricochet: Ricochet2DHandle);
25
+ /**
26
+ * Update loop - call this every frame.
27
+ * Applies ricochet via transformStore and notifies listeners.
28
+ *
29
+ * @returns true if ricochet was applied, false otherwise
30
+ */
31
+ update(): boolean;
32
+ }
33
+
34
+ export { BoundaryRicochetCoordinator };
@@ -0,0 +1,8 @@
1
+ import {
2
+ BoundaryRicochetCoordinator
3
+ } from "../chunk-GCNRXAKH.js";
4
+ import "../chunk-KDY5N6J4.js";
5
+ export {
6
+ BoundaryRicochetCoordinator
7
+ };
8
+ //# sourceMappingURL=boundary-ricochet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,35 @@
1
+ import { G as GameEntity } from '../behavior-system-DYbx-x_-.js';
2
+ import { F as FirstPersonInputComponent } from '../components-qWwOsvwh.js';
3
+ import { b as JumpInput3D } from '../components--hjBMTnz.js';
4
+
5
+ interface FirstPersonShooterInput {
6
+ moveX: number;
7
+ moveZ: number;
8
+ lookX: number;
9
+ lookY: number;
10
+ sprint: boolean;
11
+ jumpPressed: boolean;
12
+ jumpHeld: boolean;
13
+ jumpReleased: boolean;
14
+ fastFall?: boolean;
15
+ }
16
+ interface FirstPersonShooterControllerHandle {
17
+ getYaw(): number;
18
+ }
19
+ interface FirstPersonShooterJumperHandle {
20
+ getState(): unknown;
21
+ }
22
+ type FirstPersonShooterEntity = GameEntity<any> & {
23
+ $fps?: FirstPersonInputComponent;
24
+ $jumper?: JumpInput3D;
25
+ };
26
+ declare class FirstPersonShooterCoordinator {
27
+ private entity;
28
+ private fpsController;
29
+ private jumper;
30
+ constructor(entity: FirstPersonShooterEntity, fpsController: FirstPersonShooterControllerHandle, jumper: FirstPersonShooterJumperHandle);
31
+ update(input: FirstPersonShooterInput): void;
32
+ private getMoveDirWorld;
33
+ }
34
+
35
+ export { FirstPersonShooterCoordinator, type FirstPersonShooterInput };
@@ -0,0 +1,9 @@
1
+ import {
2
+ FirstPersonShooterCoordinator
3
+ } from "../chunk-VAN4WW3F.js";
4
+ import "../chunk-LD5SMIB3.js";
5
+ import "../chunk-DYLH6K7B.js";
6
+ export {
7
+ FirstPersonShooterCoordinator
8
+ };
9
+ //# sourceMappingURL=first-person-shooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,27 @@
1
+ import { G as GameEntity } from '../behavior-system-DYbx-x_-.js';
2
+ import { T as ThrusterInputComponent } from '../components-B29WHGQN.js';
3
+ import { Shooter2DSourceEntity, Shooter2DHandle, Shooter2DStageLike } from '../shooter-2d.js';
4
+ import '../vector-Bm65-FOG.js';
5
+ import 'three';
6
+ import '@dimforge/rapier3d-compat';
7
+
8
+ interface MultidirectionalSpaceShooterInput {
9
+ moveX: number;
10
+ moveY: number;
11
+ aimX: number;
12
+ aimY: number;
13
+ shootPressed: boolean;
14
+ shootHeld: boolean;
15
+ }
16
+ type MultidirectionalSpaceShooterEntity = GameEntity<any> & Shooter2DSourceEntity & {
17
+ $thruster?: ThrusterInputComponent;
18
+ };
19
+ declare class MultidirectionalSpaceShooterCoordinator {
20
+ private entity;
21
+ private shooter;
22
+ private stage;
23
+ constructor(entity: MultidirectionalSpaceShooterEntity, shooter: Shooter2DHandle, stage: Shooter2DStageLike);
24
+ update(input: MultidirectionalSpaceShooterInput): void;
25
+ }
26
+
27
+ export { MultidirectionalSpaceShooterCoordinator, type MultidirectionalSpaceShooterInput };
@@ -0,0 +1,10 @@
1
+ import {
2
+ MultidirectionalSpaceShooterCoordinator
3
+ } from "../chunk-RTRVBEIB.js";
4
+ import "../chunk-6C6NXNEW.js";
5
+ import "../chunk-KS72RZHX.js";
6
+ import "../chunk-ID5QJYF5.js";
7
+ export {
8
+ MultidirectionalSpaceShooterCoordinator
9
+ };
10
+ //# sourceMappingURL=multidirectional-space-shooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,27 @@
1
+ import { a as TopDownMovementInputComponent } from '../components-XCpL6IYt.js';
2
+ import { Shooter2DSourceEntity, Shooter2DHandle, Shooter2DStageLike } from '../shooter-2d.js';
3
+ import '../behavior-system-DYbx-x_-.js';
4
+ import '../vector-Bm65-FOG.js';
5
+ import 'three';
6
+ import '@dimforge/rapier3d-compat';
7
+
8
+ interface TopDownShooterInput {
9
+ moveX: number;
10
+ moveY: number;
11
+ aimX: number;
12
+ aimY: number;
13
+ shootPressed: boolean;
14
+ shootHeld: boolean;
15
+ }
16
+ type TopDownShooterEntity = Shooter2DSourceEntity & {
17
+ $topDownMovement?: TopDownMovementInputComponent;
18
+ };
19
+ declare class TopDownShooterCoordinator {
20
+ private entity;
21
+ private shooter;
22
+ private stage;
23
+ constructor(entity: TopDownShooterEntity, shooter: Shooter2DHandle, stage: Shooter2DStageLike);
24
+ update(input: TopDownShooterInput): void;
25
+ }
26
+
27
+ export { TopDownShooterCoordinator, type TopDownShooterInput };
@@ -0,0 +1,10 @@
1
+ import {
2
+ TopDownShooterCoordinator
3
+ } from "../chunk-FPTWVCPN.js";
4
+ import "../chunk-6C6NXNEW.js";
5
+ import "../chunk-EIWQM6U3.js";
6
+ import "../chunk-ID5QJYF5.js";
7
+ export {
8
+ TopDownShooterCoordinator
9
+ };
10
+ //# sourceMappingURL=top-down-shooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/core.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ export { B as BaseBehaviorHandle, a as BehaviorDescriptor, b as BehaviorEcsHandle, c as BehaviorEntityLink, d as BehaviorHandle, e as BehaviorRef, f as BehaviorSystem, g as BehaviorSystemContext, h as BehaviorSystemFactory, C as CreateEntityFn, D as DefineBehaviorConfig, G as GameEntity, i as GameEntityOptions, S as StageBodyKind, j as StageBoundaryDim, k as StageEventType, l as StageRicochetDim, m as StageRicochetReflection, n as StageTopDownPlane, W as WasmStageRuntime, o as WasmStageRuntimeOptions, p as defineBehavior } from './behavior-system-DYbx-x_-.js';
2
+ export { u as useBehavior } from './use-behavior-D_82jAL3.js';
3
+ export { P as PhysicsBodyComponent, T as TransformComponent, c as createPhysicsBodyComponent, a as createTransformComponent } from './components-BWG1GkZA.js';
4
+ import { a as VelocityIntentMode, T as TransformState } from './moveable-BCRpjAQb.js';
5
+ export { E as EntityWithBody, M as MoveableEntity, V as VelocityIntent, c as createTransformStore, g as getPosition, b as getVelocity, m as makeMoveable, d as move, e as moveForwardXY, f as moveX, h as moveXY, i as moveXZ, j as moveY, k as moveZ, r as resetTransformStore, l as resetVelocity, s as setPosition, n as setPositionX, o as setPositionY, p as setPositionZ, w as wrapAround3D, q as wrapAroundXY } from './moveable-BCRpjAQb.js';
6
+ export { V as VEC2_ONE, a as VEC2_ZERO, b as VEC3_ONE, c as VEC3_ZERO, d as Vec2, e as Vec2Components, f as Vec2Input, g as Vec3, h as Vec3Components, i as Vec3Input, j as isVec2Input, k as isVec3Input, n as normalizeVec2, l as normalizeVec3, t as toRapierVector3, m as toThreeVector2, o as toThreeVector3 } from './vector-Bm65-FOG.js';
7
+ export { S as SyncStateMachine } from './sync-state-machine-CZyspBpj.js';
8
+ export { F as FirstPersonPerspective } from './first-person-perspective-C9Mptl0-.js';
9
+ export { ILogger, ITransition, SyncCallback, t } from 'typescript-fsm';
10
+ import '@dimforge/rapier3d-compat';
11
+ import 'three';
12
+
13
+ interface VelocityIntentOptions {
14
+ mode?: VelocityIntentMode;
15
+ priority?: number;
16
+ }
17
+ interface VelocityIntentVector {
18
+ x?: number;
19
+ y?: number;
20
+ z?: number;
21
+ }
22
+ declare function setVelocityIntent(store: TransformState, sourceId: string, vector: VelocityIntentVector, options?: VelocityIntentOptions): void;
23
+ declare function clearVelocityIntent(store: TransformState, sourceId: string): void;
24
+
25
+ export { TransformState, VelocityIntentMode, type VelocityIntentOptions, type VelocityIntentVector, clearVelocityIntent, setVelocityIntent };