1681-engine 0.5.9 → 0.6.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 (210) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/README.md +15 -6
  3. package/dist/1681-engine.js +588 -465
  4. package/dist/ai/behaviorTree.js +198 -0
  5. package/dist/ai/buildTree.js +54 -0
  6. package/dist/ambient/life/Birds.js +73 -0
  7. package/dist/ambient/life/Butterflies.js +43 -0
  8. package/dist/ambient/life/ChimneySmoke.js +50 -0
  9. package/dist/ambient/life/Drift.js +75 -0
  10. package/dist/ambient/life/Fireflies.js +52 -0
  11. package/dist/ambient/life/lifeMotion.js +49 -0
  12. package/dist/assets/AssetLoader.js +115 -70
  13. package/dist/assets/Prepainter.js +61 -0
  14. package/dist/assets/workerPainter.js +39 -0
  15. package/dist/audio/spatial.js +118 -0
  16. package/dist/cjs/electron/electronLike.d.ts +55 -0
  17. package/dist/cjs/electron/electronLike.js +7 -0
  18. package/dist/cjs/electron/index.d.ts +14 -0
  19. package/dist/cjs/electron/index.js +20 -0
  20. package/dist/cjs/electron/lockdown.d.ts +33 -0
  21. package/dist/cjs/electron/lockdown.js +69 -0
  22. package/dist/cjs/electron/lockdownRules.d.ts +28 -0
  23. package/dist/cjs/electron/lockdownRules.js +61 -0
  24. package/dist/cjs/electron/sessionStore.d.ts +40 -0
  25. package/dist/cjs/electron/sessionStore.js +77 -0
  26. package/dist/cjs/electron/shellId.d.ts +22 -0
  27. package/dist/cjs/electron/shellId.js +31 -0
  28. package/dist/cjs/electron/webFiles.d.ts +13 -0
  29. package/dist/cjs/electron/webFiles.js +52 -0
  30. package/dist/cjs/electron/webPatcher.d.ts +83 -0
  31. package/dist/cjs/electron/webPatcher.js +223 -0
  32. package/dist/cjs/electron/webPointers.d.ts +19 -0
  33. package/dist/cjs/electron/webPointers.js +35 -0
  34. package/dist/cjs/package.json +1 -0
  35. package/dist/cjs/updates/index.d.ts +8 -0
  36. package/dist/cjs/updates/index.js +21 -0
  37. package/dist/cjs/updates/manifest.d.ts +73 -0
  38. package/dist/cjs/updates/manifest.js +67 -0
  39. package/dist/cjs/updates/pickUpdate.d.ts +42 -0
  40. package/dist/cjs/updates/pickUpdate.js +52 -0
  41. package/dist/cjs/updates/webPlan.d.ts +20 -0
  42. package/dist/cjs/updates/webPlan.js +34 -0
  43. package/dist/dialogue/DialogueRunner.js +173 -0
  44. package/dist/dialogue/expr.js +137 -0
  45. package/dist/dialogue/validateDialogue.js +52 -0
  46. package/dist/ecs/prefab.js +94 -0
  47. package/dist/electron/lockdown.js +31 -0
  48. package/dist/electron/lockdownRules.js +42 -0
  49. package/dist/electron/sessionStore.js +48 -0
  50. package/dist/electron/shellId.js +18 -0
  51. package/dist/electron/webFiles.js +36 -0
  52. package/dist/electron/webPatcher.js +153 -0
  53. package/dist/electron/webPointers.js +25 -0
  54. package/dist/electron.js +19 -0
  55. package/dist/input/Actions.js +58 -27
  56. package/dist/input/InputCapture.js +98 -0
  57. package/dist/input/Keymap.js +32 -26
  58. package/dist/input/haptics.js +50 -0
  59. package/dist/input/inputTape.js +68 -0
  60. package/dist/mobile/backButton.js +40 -0
  61. package/dist/mobile/capacitor.js +48 -0
  62. package/dist/mobile/screen.js +31 -0
  63. package/dist/mobile.js +12 -0
  64. package/dist/nav/flowField.js +58 -0
  65. package/dist/nav/steering.js +77 -0
  66. package/dist/net/ApiClient.js +96 -0
  67. package/dist/net/InterpolationBuffer.js +30 -23
  68. package/dist/net/LagCompensator.js +100 -0
  69. package/dist/net/Room.js +122 -43
  70. package/dist/net/RoomHost.js +13 -4
  71. package/dist/net/SpatialHash.js +66 -0
  72. package/dist/pixel/lifeArt.js +83 -0
  73. package/dist/pixel.js +63 -58
  74. package/dist/react/ConfirmButton.js +24 -0
  75. package/dist/react/baseCss.js +1 -0
  76. package/dist/react/labels.js +7 -6
  77. package/dist/react/useJsonSelector.js +13 -0
  78. package/dist/react.js +73 -68
  79. package/dist/tilemap/TilemapView.js +57 -32
  80. package/dist/tilemap/autotile.js +103 -0
  81. package/dist/tilemap/collision.js +29 -18
  82. package/dist/tilemap/ldtk.js +21 -0
  83. package/dist/tilemap/ldtkParse.js +191 -0
  84. package/dist/types/ai/behaviorTree.d.ts +133 -0
  85. package/dist/types/ai/behaviorTree.d.ts.map +1 -0
  86. package/dist/types/ai/buildTree.d.ts +55 -0
  87. package/dist/types/ai/buildTree.d.ts.map +1 -0
  88. package/dist/types/ambient/life/Birds.d.ts +50 -0
  89. package/dist/types/ambient/life/Birds.d.ts.map +1 -0
  90. package/dist/types/ambient/life/Butterflies.d.ts +32 -0
  91. package/dist/types/ambient/life/Butterflies.d.ts.map +1 -0
  92. package/dist/types/ambient/life/ChimneySmoke.d.ts +37 -0
  93. package/dist/types/ambient/life/ChimneySmoke.d.ts.map +1 -0
  94. package/dist/types/ambient/life/Drift.d.ts +58 -0
  95. package/dist/types/ambient/life/Drift.d.ts.map +1 -0
  96. package/dist/types/ambient/life/Fireflies.d.ts +43 -0
  97. package/dist/types/ambient/life/Fireflies.d.ts.map +1 -0
  98. package/dist/types/ambient/life/lifeMotion.d.ts +63 -0
  99. package/dist/types/ambient/life/lifeMotion.d.ts.map +1 -0
  100. package/dist/types/assets/AssetLoader.d.ts +20 -0
  101. package/dist/types/assets/AssetLoader.d.ts.map +1 -1
  102. package/dist/types/assets/Prepainter.d.ts +64 -0
  103. package/dist/types/assets/Prepainter.d.ts.map +1 -0
  104. package/dist/types/assets/workerPainter.d.ts +21 -0
  105. package/dist/types/assets/workerPainter.d.ts.map +1 -0
  106. package/dist/types/audio/spatial.d.ts +107 -0
  107. package/dist/types/audio/spatial.d.ts.map +1 -0
  108. package/dist/types/dialogue/DialogueRunner.d.ts +78 -0
  109. package/dist/types/dialogue/DialogueRunner.d.ts.map +1 -0
  110. package/dist/types/dialogue/expr.d.ts +12 -0
  111. package/dist/types/dialogue/expr.d.ts.map +1 -0
  112. package/dist/types/dialogue/script.d.ts +78 -0
  113. package/dist/types/dialogue/script.d.ts.map +1 -0
  114. package/dist/types/dialogue/validateDialogue.d.ts +21 -0
  115. package/dist/types/dialogue/validateDialogue.d.ts.map +1 -0
  116. package/dist/types/ecs/prefab.d.ts +84 -0
  117. package/dist/types/ecs/prefab.d.ts.map +1 -0
  118. package/dist/types/electron/electronLike.d.ts +56 -0
  119. package/dist/types/electron/electronLike.d.ts.map +1 -0
  120. package/dist/types/electron/index.d.ts +15 -0
  121. package/dist/types/electron/index.d.ts.map +1 -0
  122. package/dist/types/electron/lockdown.d.ts +34 -0
  123. package/dist/types/electron/lockdown.d.ts.map +1 -0
  124. package/dist/types/electron/lockdownRules.d.ts +29 -0
  125. package/dist/types/electron/lockdownRules.d.ts.map +1 -0
  126. package/dist/types/electron/sessionStore.d.ts +41 -0
  127. package/dist/types/electron/sessionStore.d.ts.map +1 -0
  128. package/dist/types/electron/shellId.d.ts +23 -0
  129. package/dist/types/electron/shellId.d.ts.map +1 -0
  130. package/dist/types/electron/webFiles.d.ts +14 -0
  131. package/dist/types/electron/webFiles.d.ts.map +1 -0
  132. package/dist/types/electron/webPatcher.d.ts +84 -0
  133. package/dist/types/electron/webPatcher.d.ts.map +1 -0
  134. package/dist/types/electron/webPointers.d.ts +20 -0
  135. package/dist/types/electron/webPointers.d.ts.map +1 -0
  136. package/dist/types/index.d.ts +30 -3
  137. package/dist/types/index.d.ts.map +1 -1
  138. package/dist/types/input/Actions.d.ts +14 -0
  139. package/dist/types/input/Actions.d.ts.map +1 -1
  140. package/dist/types/input/InputCapture.d.ts +53 -0
  141. package/dist/types/input/InputCapture.d.ts.map +1 -0
  142. package/dist/types/input/Keymap.d.ts +12 -6
  143. package/dist/types/input/Keymap.d.ts.map +1 -1
  144. package/dist/types/input/haptics.d.ts +42 -0
  145. package/dist/types/input/haptics.d.ts.map +1 -0
  146. package/dist/types/input/inputTape.d.ts +66 -0
  147. package/dist/types/input/inputTape.d.ts.map +1 -0
  148. package/dist/types/mobile/backButton.d.ts +30 -0
  149. package/dist/types/mobile/backButton.d.ts.map +1 -0
  150. package/dist/types/mobile/capacitor.d.ts +62 -0
  151. package/dist/types/mobile/capacitor.d.ts.map +1 -0
  152. package/dist/types/mobile/index.d.ts +4 -0
  153. package/dist/types/mobile/index.d.ts.map +1 -0
  154. package/dist/types/mobile/screen.d.ts +27 -0
  155. package/dist/types/mobile/screen.d.ts.map +1 -0
  156. package/dist/types/nav/flowField.d.ts +31 -0
  157. package/dist/types/nav/flowField.d.ts.map +1 -0
  158. package/dist/types/nav/steering.d.ts +47 -0
  159. package/dist/types/nav/steering.d.ts.map +1 -0
  160. package/dist/types/net/ApiClient.d.ts +74 -0
  161. package/dist/types/net/ApiClient.d.ts.map +1 -0
  162. package/dist/types/net/InterpolationBuffer.d.ts +5 -0
  163. package/dist/types/net/InterpolationBuffer.d.ts.map +1 -1
  164. package/dist/types/net/LagCompensator.d.ts +70 -0
  165. package/dist/types/net/LagCompensator.d.ts.map +1 -0
  166. package/dist/types/net/Room.d.ts +72 -3
  167. package/dist/types/net/Room.d.ts.map +1 -1
  168. package/dist/types/net/RoomHost.d.ts +8 -3
  169. package/dist/types/net/RoomHost.d.ts.map +1 -1
  170. package/dist/types/net/SpatialHash.d.ts +25 -0
  171. package/dist/types/net/SpatialHash.d.ts.map +1 -0
  172. package/dist/types/pixel/index.d.ts +1 -0
  173. package/dist/types/pixel/index.d.ts.map +1 -1
  174. package/dist/types/pixel/lifeArt.d.ts +63 -0
  175. package/dist/types/pixel/lifeArt.d.ts.map +1 -0
  176. package/dist/types/react/ConfirmButton.d.ts +26 -0
  177. package/dist/types/react/ConfirmButton.d.ts.map +1 -0
  178. package/dist/types/react/baseCss.d.ts +1 -1
  179. package/dist/types/react/baseCss.d.ts.map +1 -1
  180. package/dist/types/react/index.d.ts +2 -0
  181. package/dist/types/react/index.d.ts.map +1 -1
  182. package/dist/types/react/labels.d.ts +2 -0
  183. package/dist/types/react/labels.d.ts.map +1 -1
  184. package/dist/types/react/useJsonSelector.d.ts +13 -0
  185. package/dist/types/react/useJsonSelector.d.ts.map +1 -0
  186. package/dist/types/tilemap/TilemapView.d.ts +17 -0
  187. package/dist/types/tilemap/TilemapView.d.ts.map +1 -1
  188. package/dist/types/tilemap/autotile.d.ts +95 -0
  189. package/dist/types/tilemap/autotile.d.ts.map +1 -0
  190. package/dist/types/tilemap/collision.d.ts +8 -0
  191. package/dist/types/tilemap/collision.d.ts.map +1 -1
  192. package/dist/types/tilemap/ldtk.d.ts +97 -0
  193. package/dist/types/tilemap/ldtk.d.ts.map +1 -0
  194. package/dist/types/tilemap/ldtkParse.d.ts +26 -0
  195. package/dist/types/tilemap/ldtkParse.d.ts.map +1 -0
  196. package/dist/types/ui/ScrollView.d.ts.map +1 -1
  197. package/dist/types/updates/index.d.ts +9 -0
  198. package/dist/types/updates/index.d.ts.map +1 -0
  199. package/dist/types/updates/manifest.d.ts +74 -0
  200. package/dist/types/updates/manifest.d.ts.map +1 -0
  201. package/dist/types/updates/pickUpdate.d.ts +43 -0
  202. package/dist/types/updates/pickUpdate.d.ts.map +1 -0
  203. package/dist/types/updates/webPlan.d.ts +21 -0
  204. package/dist/types/updates/webPlan.d.ts.map +1 -0
  205. package/dist/ui/ScrollView.js +10 -8
  206. package/dist/updates/manifest.js +35 -0
  207. package/dist/updates/pickUpdate.js +27 -0
  208. package/dist/updates/webPlan.js +14 -0
  209. package/dist/updates.js +15 -0
  210. package/package.json +35 -3
@@ -0,0 +1,133 @@
1
+ /** What a node answers each tick: done well, done badly, or not done yet. */
2
+ export type BtStatus = 'success' | 'failure' | 'running';
3
+ /**
4
+ * One node of a tree. Nodes hold no state of their own, so one tree drives any number of agents: what a node must
5
+ * remember between ticks (the child a sequence is on, when a wait began) lives in the agent's memory, `run.state`.
6
+ */
7
+ export interface BtNode<C> {
8
+ readonly kind: string;
9
+ /** Shown in a trace; actions and conditions are named after what they do. */
10
+ readonly name?: string;
11
+ readonly children: readonly BtNode<C>[];
12
+ tick(ctx: C, run: BtRun<C>): BtStatus;
13
+ /** A running node left behind (its parent moved on, the tree was reset): undo what it started. */
14
+ halt?(ctx: C, run: BtRun<C>): void;
15
+ }
16
+ /** What a node may use while it ticks: the agent's clock and memory, and its children's ticks. */
17
+ export interface BtRun<C> {
18
+ /** The time this tick was given (ms), for waits, cooldowns and timeouts. */
19
+ readonly now: number;
20
+ /** This node's memory for this agent, made by `init` the first time and after a halt. */
21
+ state<T>(node: BtNode<C>, init: () => T): T;
22
+ /** Memory that outlives the node finishing (a cooldown's ready time); only `reset` clears it. */
23
+ lasting<T>(node: BtNode<C>, init: () => T): T;
24
+ /** Ticks a child; use this, never `child.tick`, so it is traced and halted right. */
25
+ tick(child: BtNode<C>, ctx: C): BtStatus;
26
+ /** Stops a child that was left running, and everything under it. */
27
+ halt(child: BtNode<C>, ctx: C): void;
28
+ }
29
+ /** One line of `BtAgent.trace`: a node, how deep it is, and what it last answered (null: not ticked this time). */
30
+ export interface BtTraceLine {
31
+ depth: number;
32
+ kind: string;
33
+ name: string | undefined;
34
+ status: BtStatus | null;
35
+ }
36
+ /** A tree's root, and the agents it drives. */
37
+ export declare class BehaviorTree<C> {
38
+ readonly root: BtNode<C>;
39
+ constructor(root: BtNode<C>);
40
+ /** A new agent on this tree, with memory of its own. */
41
+ agent(): BtAgent<C>;
42
+ }
43
+ /** One agent running a tree: its memory, and the tick that drives it. */
44
+ export declare class BtAgent<C> implements BtRun<C> {
45
+ readonly root: BtNode<C>;
46
+ now: number;
47
+ private memory;
48
+ private readonly kept;
49
+ /** Nodes that answered 'running' last time they ticked: the ones a halt must reach. */
50
+ private readonly open;
51
+ private last;
52
+ private seen;
53
+ constructor(root: BtNode<C>);
54
+ /** Ticks the tree once at time `now` (ms) and returns the root's answer. */
55
+ update(ctx: C, now: number): BtStatus;
56
+ /** Halts whatever is running and forgets all memory: the agent starts the tree afresh (it died, it was stunned). */
57
+ reset(ctx: C): void;
58
+ /** Whether a node is running for this agent now. */
59
+ isRunning(node: BtNode<C>): boolean;
60
+ state<T>(node: BtNode<C>, init: () => T): T;
61
+ lasting<T>(node: BtNode<C>, init: () => T): T;
62
+ tick(child: BtNode<C>, ctx: C): BtStatus;
63
+ halt(child: BtNode<C>, ctx: C): void;
64
+ /** The tree as it ran on the last tick, depth first: for a debug overlay. */
65
+ trace(): BtTraceLine[];
66
+ }
67
+ /**
68
+ * A trace as text, one node a line, indented by depth, with what each answered (`·` when it was not ticked): for a
69
+ * debug overlay's `Text`, or a log.
70
+ *
71
+ * ```
72
+ * reactive-selector running
73
+ * sequence failure
74
+ * hurt failure
75
+ * flee ·
76
+ * wander running
77
+ * ```
78
+ */
79
+ export declare function formatTrace(trace: readonly BtTraceLine[]): string;
80
+ /**
81
+ * Runs its children in order until one fails: all must succeed. A running child is resumed on the next tick
82
+ * without asking the ones before it again (`reactiveSequence` does ask them).
83
+ */
84
+ export declare function sequence<C>(...children: BtNode<C>[]): BtNode<C>;
85
+ /** Tries its children in order until one does not fail: the first that works. Resumes a running child. */
86
+ export declare function selector<C>(...children: BtNode<C>[]): BtNode<C>;
87
+ /**
88
+ * A sequence that asks every child from the first again on each tick: a guard in front ("still sees the player?")
89
+ * is checked every time, and when it fails the child that was running is halted.
90
+ */
91
+ export declare function reactiveSequence<C>(...children: BtNode<C>[]): BtNode<C>;
92
+ /**
93
+ * A selector that asks from the first child again on each tick: a higher-priority branch ("flee when hurt") takes
94
+ * over the moment it can run, halting the lower one it interrupts.
95
+ */
96
+ export declare function reactiveSelector<C>(...children: BtNode<C>[]): BtNode<C>;
97
+ export interface ParallelPolicy {
98
+ /** Children that must succeed for the whole to (default all). */
99
+ succeed?: number;
100
+ /** Children that must fail for the whole to (default 1). */
101
+ fail?: number;
102
+ }
103
+ /**
104
+ * Ticks every child each tick (walk and look about at once). Succeeds once `succeed` have succeeded, fails once
105
+ * `fail` have failed, halting the rest; a child that finished is not ticked again until the whole finishes.
106
+ */
107
+ export declare function parallel<C>(policy: ParallelPolicy, ...children: BtNode<C>[]): BtNode<C>;
108
+ /** Swaps success and failure. */
109
+ export declare function invert<C>(child: BtNode<C>): BtNode<C>;
110
+ /** Succeeds whatever its child answers, once the child is done: an optional step. */
111
+ export declare function succeed<C>(child: BtNode<C>): BtNode<C>;
112
+ /**
113
+ * Runs its child `times` times in a row (Infinity: for good), stopping at the first failure. One pass per tick at
114
+ * most, so a child that succeeds at once cannot spin a frame.
115
+ */
116
+ export declare function repeat<C>(times: number, child: BtNode<C>): BtNode<C>;
117
+ /** Tries its child up to `times` times until it succeeds, a try a tick. */
118
+ export declare function retry<C>(times: number, child: BtNode<C>): BtNode<C>;
119
+ /** Runs its child at most once every `ms`: after it finishes, it fails at once until the time is up. */
120
+ export declare function cooldown<C>(ms: number, child: BtNode<C>): BtNode<C>;
121
+ /** Fails, halting its child, when the child has run longer than `ms`. */
122
+ export declare function timeout<C>(ms: number, child: BtNode<C>): BtNode<C>;
123
+ /** Runs for `ms`, then succeeds. */
124
+ export declare function wait<C>(ms: number): BtNode<C>;
125
+ /** A test: success when `test` holds, else failure. Never runs. */
126
+ export declare function condition<C>(name: string, test: (ctx: C) => boolean): BtNode<C>;
127
+ export interface ActionOptions<C> {
128
+ /** The action was running and the tree left it (a higher branch took over): stop what it started. */
129
+ onHalt?: (ctx: C) => void;
130
+ }
131
+ /** Something the agent does: `run` answers each tick until the doing is done. */
132
+ export declare function action<C>(name: string, run: (ctx: C, now: number) => BtStatus, options?: ActionOptions<C>): BtNode<C>;
133
+ //# sourceMappingURL=behaviorTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"behaviorTree.d.ts","sourceRoot":"","sources":["../../../src/ai/behaviorTree.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,C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AAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CASpE;AAED,2EAA2E;AAC3E,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CASnE;AAED,wGAAwG;AACxG,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CASnE;AAED,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAUlE;AAED,oCAAoC;AACpC,wBAAgB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAM7C;AAED,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAE/E;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,qGAAqG;IACrG,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC3B;AAED,iFAAiF;AACjF,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,QAAQ,EAAE,OAAO,GAAE,aAAa,CAAC,CAAC,CAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAEzH"}
@@ -0,0 +1,55 @@
1
+ import { type ActionOptions, type BtNode, type BtStatus } from './behaviorTree.js';
2
+ /**
3
+ * A tree written as data (a JSON file a designer edits): composites hold `children`, decorators one `child`, and
4
+ * leaves name an action or a condition the game registered.
5
+ *
6
+ * ```json
7
+ * { "type": "reactiveSelector", "children": [
8
+ * { "type": "sequence", "children": [{ "type": "condition", "name": "hurt" }, { "type": "action", "name": "flee" }] },
9
+ * { "type": "cooldown", "ms": 2000, "child": { "type": "action", "name": "bark" } },
10
+ * { "type": "action", "name": "wander" }
11
+ * ] }
12
+ * ```
13
+ */
14
+ export type BtSpec = {
15
+ type: 'sequence' | 'selector' | 'reactiveSequence' | 'reactiveSelector';
16
+ children: BtSpec[];
17
+ } | {
18
+ type: 'parallel';
19
+ succeed?: number;
20
+ fail?: number;
21
+ children: BtSpec[];
22
+ } | {
23
+ type: 'invert' | 'succeed';
24
+ child: BtSpec;
25
+ } | {
26
+ type: 'repeat' | 'retry';
27
+ times: number;
28
+ child: BtSpec;
29
+ } | {
30
+ type: 'cooldown' | 'timeout';
31
+ ms: number;
32
+ child: BtSpec;
33
+ } | {
34
+ type: 'wait';
35
+ ms: number;
36
+ } | {
37
+ type: 'action' | 'condition';
38
+ name: string;
39
+ }
40
+ /** A named subtree of the registry, so a tree is shared by several (a "flee" every monster uses). */
41
+ | {
42
+ type: 'tree';
43
+ name: string;
44
+ };
45
+ /** What the leaves of a data tree name. */
46
+ export interface BtRegistry<C> {
47
+ actions?: Record<string, ((ctx: C, now: number) => BtStatus) | ({
48
+ run: (ctx: C, now: number) => BtStatus;
49
+ } & ActionOptions<C>)>;
50
+ conditions?: Record<string, (ctx: C) => boolean>;
51
+ trees?: Record<string, BtSpec>;
52
+ }
53
+ /** A tree from its data. Throws, naming the path, on an unknown type, a missing leaf or a subtree that names itself. */
54
+ export declare function buildTree<C>(spec: BtSpec, registry: BtRegistry<C>): BtNode<C>;
55
+ //# sourceMappingURL=buildTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTree.d.ts","sourceRoot":"","sources":["../../../src/ai/buildTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,aAAa,E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a,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC;IAC9H,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,wHAAwH;AACxH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAE7E"}
@@ -0,0 +1,50 @@
1
+ import type { ViewRect } from '../../core/Camera.js';
2
+ import type { Stage } from '../../core/Stage.js';
3
+ import { type LifeAir } from './lifeMotion.js';
4
+ export interface BirdsOptions {
5
+ /** Birds in a flock, [least, most]; never more than `maxFlock`. */
6
+ flock: readonly [number, number];
7
+ /** Seconds between flocks, [least, most]. */
8
+ everyS: readonly [number, number];
9
+ /** The two frames, seen from above: wings raised (a V), then the downstroke. */
10
+ frames: readonly [string, string];
11
+ /** A small shadow on the ground far below each bird: it is what tells the eye how high they are. */
12
+ shadow?: string;
13
+ /** The pool's size (default 6). */
14
+ maxFlock?: number;
15
+ /** Depth of the birds (default 950_000: over every prop and body, under the names). */
16
+ depth?: number;
17
+ /** Depth of their shadows (default -999_980: on the ground, under the bodies). */
18
+ shadowDepth?: number;
19
+ /** Past this `night` no flock sets off (default 0.5). */
20
+ maxNight?: number;
21
+ /** The first flock comes this many ms after the first update, [least, most] (default [3000, 9000]). */
22
+ firstMs?: readonly [number, number];
23
+ snap?: boolean;
24
+ random?: () => number;
25
+ }
26
+ /**
27
+ * A flock crossing the sky now and then: a few painted birds in a loose V flying straight across the camera's view,
28
+ * wings beating on their own clocks, each with its shadow on the ground below. Not at night.
29
+ */
30
+ export declare class Birds {
31
+ private readonly options;
32
+ private readonly birds;
33
+ private readonly snap;
34
+ private readonly random;
35
+ private active;
36
+ private nextAt;
37
+ private x;
38
+ private y;
39
+ private vx;
40
+ private vy;
41
+ private altitude;
42
+ constructor(stage: Stage, options: BirdsOptions);
43
+ /** Whether a flock is crossing now. */
44
+ get flying(): boolean;
45
+ update(now: number, dt: number, view: ViewRect, air: LifeAir, enabled?: boolean): void;
46
+ destroy(): void;
47
+ private launch;
48
+ private land;
49
+ }
50
+ //# sourceMappingURL=Birds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Birds.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/Birds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6CAA6C;IAC7C,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,gFAAgF;IAChF,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,oGAAoG;IACpG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uGAAuG;IACvG,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAUD;;;GAGG;AACH,qBAAa,KAAK;IAcd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAb1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,CAAC,CAAK;IACd,OAAO,CAAC,CAAC,CAAK;IACd,OAAO,CAAC,EAAE,CAAK;IACf,OAAO,CAAC,EAAE,CAAK;IACf,OAAO,CAAC,QAAQ,CAAM;gBAGpB,KAAK,EAAE,KAAK,EACK,OAAO,EAAE,YAAY;IAcxC,uCAAuC;IACvC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,UAAO,GAAG,IAAI;IA4BnF,OAAO,IAAI,IAAI;IASf,OAAO,CAAC,MAAM;IAwBd,OAAO,CAAC,IAAI;CAOb"}
@@ -0,0 +1,32 @@
1
+ import type { ViewRect } from '../../core/Camera.js';
2
+ import type { Stage } from '../../core/Stage.js';
3
+ import type { LifeAir, LifeSource } from './lifeMotion.js';
4
+ export interface ButterfliesOptions {
5
+ count: number;
6
+ /** Each tone's two frames, wings open then shut; butterfly `i` wears `looks[i % looks.length]`. */
7
+ looks: readonly (readonly [open: string, shut: string])[];
8
+ /** A flower patch in view to settle round, or null when none is on screen. */
9
+ home: LifeSource;
10
+ /** Depth in the world layer (default 900_000). */
11
+ depth?: number;
12
+ /** Past this `night` they are gone (default 0.4). */
13
+ maxNight?: number;
14
+ snap?: boolean;
15
+ random?: () => number;
16
+ }
17
+ /**
18
+ * Butterflies by day round the flowers on screen: each settles on a patch in view and wanders round it in short
19
+ * jinks, wings opening and shutting on their own beat, bobbing a pixel over the bloom. They leave when the night
20
+ * comes in, and where `home` finds nothing they are simply not drawn.
21
+ */
22
+ export declare class Butterflies {
23
+ private readonly options;
24
+ private readonly flies;
25
+ private readonly snap;
26
+ private readonly random;
27
+ constructor(stage: Stage, options: ButterfliesOptions);
28
+ update(now: number, dt: number, view: ViewRect, air: LifeAir, enabled?: boolean): void;
29
+ destroy(): void;
30
+ private settle;
31
+ }
32
+ //# sourceMappingURL=Butterflies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Butterflies.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/Butterflies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1D,8EAA8E;IAC9E,IAAI,EAAE,UAAU,CAAC;IACjB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAgBD;;;;GAIG;AACH,qBAAa,WAAW;IAOpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGpC,KAAK,EAAE,KAAK,EACK,OAAO,EAAE,kBAAkB;IAY9C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,UAAO,GAAG,IAAI;IA8BnF,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,MAAM;CAUf"}
@@ -0,0 +1,37 @@
1
+ import type { ViewRect } from '../../core/Camera.js';
2
+ import type { Stage } from '../../core/Stage.js';
3
+ import { type LifeAir, type LifePoint } from './lifeMotion.js';
4
+ export interface ChimneySmokeOptions {
5
+ /** The chimneys' mouths in world pixels. */
6
+ mouths: readonly LifePoint[];
7
+ /** The puff's frames from young to old (it grows through them and dithers away). */
8
+ frames: readonly string[];
9
+ /** Puffs in each chimney's pool (default 7). */
10
+ puffs?: number;
11
+ /** A puff every this many ms, give or take 30% (default 650). */
12
+ puffEveryMs?: number;
13
+ /** A puff's life (ms, default 4600). */
14
+ lifeMs?: number;
15
+ /** World px a second it climbs (default 7). */
16
+ rise?: number;
17
+ /** World px a second the wind leans it (default 9). */
18
+ drift?: number;
19
+ /** Depth in the world layer (default 900_000). */
20
+ depth?: number;
21
+ snap?: boolean;
22
+ random?: () => number;
23
+ }
24
+ /**
25
+ * Smoke rising from chimneys: each mouth lets out a puff every so often that climbs, grows through its frames, leans
26
+ * downwind and is gone. Only mouths on screen puff; a mouth that leaves the view drops its puffs at once.
27
+ */
28
+ export declare class ChimneySmoke {
29
+ private readonly options;
30
+ private readonly chimneys;
31
+ private readonly snap;
32
+ private readonly random;
33
+ constructor(stage: Stage, options: ChimneySmokeOptions);
34
+ update(now: number, view: ViewRect, air: LifeAir, enabled?: boolean): void;
35
+ destroy(): void;
36
+ }
37
+ //# sourceMappingURL=ChimneySmoke.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChimneySmoke.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/ChimneySmoke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B,oFAAoF;IACpF,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAeD;;;GAGG;AACH,qBAAa,YAAY;IAOrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGpC,KAAK,EAAE,KAAK,EACK,OAAO,EAAE,mBAAmB;IAgB/C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,UAAO,GAAG,IAAI;IAwCvE,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,58 @@
1
+ import type { ViewRect } from '../../core/Camera.js';
2
+ import type { Stage } from '../../core/Stage.js';
3
+ import type { LifeAir, LifeSource } from './lifeMotion.js';
4
+ /**
5
+ * How a drift moves:
6
+ * - `leaf`: tumbles down through its frames, lands, lies a moment and is gone;
7
+ * - `seed`: blown across the view on a slow wobble (dandelion seed, spores, ash on the wind);
8
+ * - `ember`: rises, cooling through its frames, and goes out within a tile or three;
9
+ * - `mote`: hangs in the air, barely moving, and winks out now and then (underground dust);
10
+ * - `ash`: blown across like a seed, but from a source it lifts off the ground instead.
11
+ */
12
+ export type DriftKind = 'leaf' | 'seed' | 'ember' | 'mote' | 'ash';
13
+ export interface DriftOptions {
14
+ kind: DriftKind;
15
+ /** Bodies in the pool; a body off screen is hidden and re-used, never freed. */
16
+ count: number;
17
+ /**
18
+ * The looks, each a list of frames; body `i` wears `looks[i % looks.length]`. A leaf tumbles through its frames and
19
+ * lies on the first; an ember cools from its first to its last; the others wear the first.
20
+ */
21
+ looks: readonly (readonly string[])[];
22
+ /**
23
+ * Where a body sets off from, if anywhere in particular: a canopy on screen a leaf falls from (and lands just under),
24
+ * a patch of ground ash or embers lift off. Null when there is none in view now.
25
+ */
26
+ from?: LifeSource;
27
+ /**
28
+ * Only from `from` (a drift over certain ground): a body waits rather than drift in from the view's edge. Default
29
+ * false — a leaf with no canopy in view still blows in from the edge.
30
+ */
31
+ sourceOnly?: boolean;
32
+ /** Depth in the world layer (default 900_000: over the bodies and props, under the weather and the names). */
33
+ depth?: number;
34
+ /** Positions on whole world pixels (default true). */
35
+ snap?: boolean;
36
+ random?: () => number;
37
+ }
38
+ /**
39
+ * One kind of thing on the air: a fixed pool that lives only inside the camera's view, each body on whole world
40
+ * pixels and flipped between painted frames rather than rotated (a rotated pixel leaf reads as a different art style).
41
+ * Feed it the frame's view and the air; `enabled` false hides it (a reduced-effects setting).
42
+ */
43
+ export declare class Drift {
44
+ private readonly options;
45
+ private readonly motes;
46
+ private readonly kind;
47
+ private readonly snap;
48
+ private readonly random;
49
+ constructor(stage: Stage, options: DriftOptions);
50
+ /** `now` and `dt` in ms. */
51
+ update(now: number, dt: number, view: ViewRect, air: LifeAir, enabled?: boolean): void;
52
+ destroy(): void;
53
+ /** `anywhere`: a first fill lands bodies all over the view, not only at its edge, so a scene opens already alive. */
54
+ private spawn;
55
+ private spawnFrom;
56
+ private step;
57
+ }
58
+ //# sourceMappingURL=Drift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drift.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/Drift.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAW,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAuBD;;;;GAIG;AACH,qBAAa,KAAK;IAQd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGpC,KAAK,EAAE,KAAK,EACK,OAAO,EAAE,YAAY;IAaxC,4BAA4B;IAC5B,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,UAAO,GAAG,IAAI;IAuBnF,OAAO,IAAI,IAAI;IAKf,qHAAqH;IACrH,OAAO,CAAC,KAAK;IA2Bb,OAAO,CAAC,SAAS;IAwBjB,OAAO,CAAC,IAAI;CAwCb"}
@@ -0,0 +1,43 @@
1
+ import { Container } from 'pixi.js';
2
+ import type { ViewRect } from '../../core/Camera.js';
3
+ import type { Stage } from '../../core/Stage.js';
4
+ import { type LifeAir, type LifeSource } from './lifeMotion.js';
5
+ export interface FirefliesOptions {
6
+ count: number;
7
+ /** The two frames: a dim pixel, and the glow. */
8
+ frames: readonly [dim: string, lit: string];
9
+ /** Somewhere in view to hover round (the water's edge, the feet of trees), or null when none is on screen. */
10
+ home: LifeSource;
11
+ /**
12
+ * Where the layer goes. Default `'screen'`: on the screen layer, following the camera, so it can be laid **over** a
13
+ * darkness drawn there (`NightShade`, `Darkness`) instead of being darkened with the world under it — add it after
14
+ * the darkness. `'world'`: in the world layer at `depth`, for a game with no darkness over its world.
15
+ */
16
+ layer?: 'screen' | 'world';
17
+ /** World-layer depth when `layer` is `'world'` (default 900_000). */
18
+ depth?: number;
19
+ snap?: boolean;
20
+ random?: () => number;
21
+ }
22
+ /**
23
+ * Fireflies at night: single pixels drifting slowly round homes on screen, each lighting up and going out on its own
24
+ * clock. How many are out grows with the dark (none before night 0.5, all by 0.85). They are a light, so by default
25
+ * their layer sits on the screen and follows the camera (`Camera.follow` copies the world layer's transform, shake
26
+ * included, once the frame's camera is known).
27
+ */
28
+ export declare class Fireflies {
29
+ private readonly stage;
30
+ private readonly options;
31
+ readonly layer: Container<import("pixi.js").ContainerChild>;
32
+ private readonly flies;
33
+ private readonly dim;
34
+ private readonly lit;
35
+ private readonly onScreen;
36
+ private readonly snap;
37
+ private readonly random;
38
+ constructor(stage: Stage, options: FirefliesOptions);
39
+ update(now: number, view: ViewRect, air: LifeAir, enabled?: boolean): void;
40
+ destroy(): void;
41
+ private settle;
42
+ }
43
+ //# sourceMappingURL=Fireflies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fireflies.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/Fireflies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAA4C,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,MAAM,EAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5C,8GAA8G;IAC9G,IAAI,EAAE,UAAU,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAUD;;;;;GAKG;AACH,qBAAa,SAAS;IAUlB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAV1B,QAAQ,CAAC,KAAK,8CAAmB;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB;IAwB5C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,UAAO,GAAG,IAAI;IA8BvE,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,MAAM;CAQf"}
@@ -0,0 +1,63 @@
1
+ import type { ViewRect } from '../../core/Camera.js';
2
+ /** A point in world pixels. */
3
+ export interface LifePoint {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ /** A box in world pixels (a canopy leaves fall from, a tile ash lifts off); a point is a box of no size. */
8
+ export interface LifeBox extends LifePoint {
9
+ w?: number;
10
+ h?: number;
11
+ }
12
+ /** The air the life reads: how dark it is and how hard the wind blows. */
13
+ export interface LifeAir {
14
+ /** 0 by day, 1 at full night (birds and butterflies keep away from the dark, fireflies come out of it). */
15
+ night: number;
16
+ /** 0 still air, 1 a gale: leans the drift, hastens a flock, bends smoke. */
17
+ wind: number;
18
+ }
19
+ /** Hands back somewhere to be: inside the camera's view, or null when there is nowhere there now. */
20
+ export type LifeSource<T extends LifeBox = LifeBox> = (view: ViewRect, random: () => number) => T | null;
21
+ /** Whether the box touches the view grown by `margin` on every side. */
22
+ export declare function boxInView(b: LifeBox, view: ViewRect, margin?: number): boolean;
23
+ /**
24
+ * One of `items` in view, tried `tries` times at random rather than filtered: a forest's thousands of tiles cost the
25
+ * same few reads as a hamlet's dozen, and a miss only means the body waits a frame to try again.
26
+ */
27
+ export declare function pickInView<T extends LifeBox>(items: readonly T[], view: ViewRect, random: () => number, tries?: number): T | null;
28
+ /** A `LifeSource` over a fixed list (flower beds, the water's edge, tiles of burnt ground). */
29
+ export declare function sourceOf<T extends LifeBox>(items: readonly T[], tries?: number): LifeSource<T>;
30
+ /** A bird's frame: a few beats (0, 1, 0, 1, 0), then a glide on raised wings (0) for three, each bird on its clock. */
31
+ export declare function birdFrame(now: number, offset: number, beatMs?: number): 0 | 1;
32
+ /**
33
+ * Where the `i`-th bird of a flock flies behind the leader: a loose V trailing back along `dirX` (its sign), ranks
34
+ * alternating side to side. `jitter` (0..1 each) loosens it so no two flocks are drawn alike.
35
+ */
36
+ export declare function flockSlot(i: number, dirX: number, jitterX: number, jitterY: number): {
37
+ dx: number;
38
+ dy: number;
39
+ };
40
+ /** A firefly's blink at `t` seconds: 0 dark most of the time, 2 a glow for a beat, 1 a dim pixel either side of it. */
41
+ export declare function fireflyGlow(t: number): 0 | 1 | 2;
42
+ /** A firefly's slow wander about its home at `t` seconds: two sines across, one up and down. */
43
+ export declare function fireflyOffset(t: number): {
44
+ dx: number;
45
+ dy: number;
46
+ };
47
+ /** How many of a pool of `count` fireflies are out at `night`: none before 0.5, all by 0.85. */
48
+ export declare function firefliesOut(count: number, night: number): number;
49
+ export interface PuffMotion {
50
+ /** World px a second it climbs. */
51
+ rise: number;
52
+ /** World px a second the wind leans it at full age. */
53
+ drift: number;
54
+ }
55
+ /**
56
+ * Where a puff of smoke is `sec` seconds after it left a chimney's mouth, `age` the share of its life gone: it climbs
57
+ * straight out of the pot, then the wind takes it more the higher it gets. `seed` (0..1) gives each its own wobble.
58
+ */
59
+ export declare function puffOffset(sec: number, age: number, seed: number, wind: number, m: PuffMotion): {
60
+ dx: number;
61
+ dy: number;
62
+ };
63
+ //# sourceMappingURL=lifeMotion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifeMotion.d.ts","sourceRoot":"","sources":["../../../../src/ambient/life/lifeMotion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,4GAA4G;AAC5G,MAAM,WAAW,OAAQ,SAAQ,SAAS;IACxC,CAAC,CAAC,EAAE,MAAM,CAAC;I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AAG,CAAC,CAGhD;AAED,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAEnE;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAK1H"}
@@ -1,4 +1,5 @@
1
1
  import type { CanvasTexture } from '../core/TextureRegistry.js';
2
+ import type { LdtkProject } from '../tilemap/ldtk.js';
2
3
  import { type TileMap, type Tileset } from '../tilemap/tiled.js';
3
4
  import { type AtlasFrame } from './textureAtlas.js';
4
5
  /** Where loaded images go: the stage's `TextureRegistry` satisfies it. */
@@ -50,6 +51,13 @@ export interface TilemapAssetOptions {
50
51
  /** The texture key a tileset's image is loaded under (default: the tileset's name). */
51
52
  textureKey?: (tileset: Tileset) => string;
52
53
  }
54
+ export interface LdtkAssetOptions extends TilemapAssetOptions {
55
+ /**
56
+ * Which external level files to fetch with the project (by level identifier); default every one. A level left out
57
+ * stays `loaded: false`, to be fetched later and read with `loadLdtkLevel`.
58
+ */
59
+ levels?: readonly string[];
60
+ }
53
61
  export interface LoadProgress {
54
62
  done: number;
55
63
  total: number;
@@ -79,6 +87,7 @@ export declare class AssetLoader {
79
87
  private readonly queue;
80
88
  private readonly data;
81
89
  private readonly maps;
90
+ private readonly ldtks;
82
91
  private readonly atlases;
83
92
  /** Decoded audio by key; a key with bytes only waits for a context (`decodeAudio`). */
84
93
  private readonly audioBuffers;
@@ -99,6 +108,14 @@ export declare class AssetLoader {
99
108
  text(key: string, url: string): this;
100
109
  /** A Tiled JSON map, then every tileset image it names (resolved beside the map file). */
101
110
  tilemap(key: string, url: string, options?: TilemapAssetOptions): this;
111
+ /**
112
+ * An LDtk project: the `.ldtk` file, the `.ldtkl` file of each level it saves apart (resolved beside the project),
113
+ * then every tileset image (resolved beside the project, as LDtk writes `relPath`). Counts as one asset, plus one
114
+ * per tileset image. Read it back with `ldtkProject(key)`; each level's `map` goes to `TilemapView` as it is.
115
+ */
116
+ ldtk(key: string, url: string, options?: LdtkAssetOptions): this;
117
+ /** A loaded LDtk project. */
118
+ ldtkProject(key: string): LdtkProject;
102
119
  /**
103
120
  * A TexturePacker (or Pixi) JSON atlas, hash or array format: its page image, and for a multipack atlas every page
104
121
  * named in `meta.related_multi_packs` (each resolved beside the file naming it). The first page is the texture
@@ -132,8 +149,11 @@ export declare class AssetLoader {
132
149
  /** A loaded Tiled map. */
133
150
  map(key: string): TileMap;
134
151
  private add;
152
+ private full;
135
153
  private request;
136
154
  private blob;
155
+ /** An image file decoded into a canvas; a file that is not an image fails naming its URL. */
156
+ private canvas;
137
157
  private bytes;
138
158
  private decode;
139
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AssetLoader.d.ts","sourceRoot":"","sources":["../../../src/assets/AssetLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAkD,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjG,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAA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