1681-engine 0.0.0-stage → 0.5.9

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 (831) hide show
  1. package/CHANGELOG.md +357 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -2
  4. package/dist/1681-engine.js +471 -0
  5. package/dist/ambient/ColorGrade.js +40 -0
  6. package/dist/ambient/DayClock.js +56 -0
  7. package/dist/ambient/WeatherLayer.js +90 -0
  8. package/dist/ambient/grade.js +12 -0
  9. package/dist/ambient/weather.js +51 -0
  10. package/dist/anim/AnimStateMachine.js +163 -0
  11. package/dist/anim/Animator.js +66 -0
  12. package/dist/anim/animStateCompile.js +112 -0
  13. package/dist/anim/animStateSystem.js +16 -0
  14. package/dist/anim/animationSystem.js +14 -0
  15. package/dist/anim/asepriteSlices.js +21 -0
  16. package/dist/anim/asepriteTags.js +34 -0
  17. package/dist/anim/parseAseprite.js +82 -0
  18. package/dist/assets/AssetLoader.js +202 -0
  19. package/dist/assets/loadAseprite.js +49 -0
  20. package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +30 -0
  21. package/dist/assets/textureAtlas.js +58 -0
  22. package/dist/audio/Footsteps.js +25 -0
  23. package/dist/audio/MusicPlayer.js +77 -0
  24. package/dist/audio/SoundEngine.js +125 -0
  25. package/dist/audio/cleanTake.js +29 -0
  26. package/dist/audio/music/ElementVoice.js +34 -0
  27. package/dist/audio/music/GraphVoice.js +38 -0
  28. package/dist/audio/music/MusicChannel.js +57 -0
  29. package/dist/audio/music/musicVoice.js +12 -0
  30. package/dist/audio/sampleBank.js +81 -0
  31. package/dist/audio/soundTable.js +8 -0
  32. package/dist/audio/synth.js +35 -0
  33. package/dist/core/BitmapLabel.js +48 -0
  34. package/dist/core/Camera.js +149 -0
  35. package/dist/core/Clock.js +40 -0
  36. package/dist/core/Graphics.js +68 -0
  37. package/dist/core/Group.js +28 -0
  38. package/dist/core/Image.js +50 -0
  39. package/dist/core/ObjectFactory.js +54 -0
  40. package/dist/core/Pointer.js +80 -0
  41. package/dist/core/Rectangle.js +50 -0
  42. package/dist/core/Stage.js +85 -0
  43. package/dist/core/Text.js +21 -0
  44. package/dist/core/TextureRegistry.js +141 -0
  45. package/dist/core/Timeline.js +210 -0
  46. package/dist/core/TimelineBuilder.js +72 -0
  47. package/dist/core/TimelineChild.js +83 -0
  48. package/dist/core/Tweener.js +135 -0
  49. package/dist/core/atlas.js +37 -0
  50. package/dist/core/atlasPlan.js +21 -0
  51. package/dist/core/blendLayer.js +11 -0
  52. package/dist/core/eases.js +20 -0
  53. package/dist/core/gameObject.js +117 -0
  54. package/dist/core/pixelZoom.js +43 -0
  55. package/dist/core/pixiPatches.js +17 -0
  56. package/dist/core/runDue.js +28 -0
  57. package/dist/core/silhouette.js +49 -0
  58. package/dist/core/timelinePlace.js +23 -0
  59. package/dist/core/tweenProps.js +11 -0
  60. package/dist/debug/DebugOverlay.js +93 -0
  61. package/dist/debug/DrawCallCounter.js +44 -0
  62. package/dist/debug/ErrorLog.js +21 -0
  63. package/dist/debug/FrameStats.js +41 -0
  64. package/dist/debug/inspectWorld.js +28 -0
  65. package/dist/diagnostics/ErrorDeduper.js +26 -0
  66. package/dist/diagnostics/FrameSampler.js +41 -0
  67. package/dist/diagnostics/bootWatch.js +20 -0
  68. package/dist/diagnostics/captureErrors.js +26 -0
  69. package/dist/diagnostics/contextLoss.js +24 -0
  70. package/dist/diagnostics/frameStats.js +30 -0
  71. package/dist/diagnostics/gpuInfo.js +21 -0
  72. package/dist/diagnostics/renderGuard.js +23 -0
  73. package/dist/ecs/SparseSet.js +54 -0
  74. package/dist/ecs/World.js +306 -0
  75. package/dist/ecs/fields.js +25 -0
  76. package/dist/engine/Engine.js +106 -0
  77. package/dist/engine/FixedLoop.js +36 -0
  78. package/dist/engine/HiddenPause.js +27 -0
  79. package/dist/engine/Scene.js +78 -0
  80. package/dist/engine/SceneManager.js +72 -0
  81. package/dist/events/EventBus.js +41 -0
  82. package/dist/fx/Afterimages.js +82 -0
  83. package/dist/fx/FloatingText.js +71 -0
  84. package/dist/fx/hitStop.js +27 -0
  85. package/dist/fx/viewCull.js +9 -0
  86. package/dist/i18n/Translator.js +71 -0
  87. package/dist/i18n/extractStrings.js +57 -0
  88. package/dist/i18n/formatMessage.js +18 -0
  89. package/dist/input/Actions.js +139 -0
  90. package/dist/input/AimGesture.js +74 -0
  91. package/dist/input/Keyboard.js +53 -0
  92. package/dist/input/Keymap.js +170 -0
  93. package/dist/input/TargetLock.js +72 -0
  94. package/dist/input/aimAxis.js +7 -0
  95. package/dist/input/keyChord.js +28 -0
  96. package/dist/input/longPress.js +31 -0
  97. package/dist/input/rumble.js +42 -0
  98. package/dist/input/stickAxis.js +22 -0
  99. package/dist/input/touchDetect.js +6 -0
  100. package/dist/light/LightLayer.js +83 -0
  101. package/dist/nav/MinHeap.js +38 -0
  102. package/dist/nav/findPath.js +77 -0
  103. package/dist/nav/navGrid.js +35 -0
  104. package/dist/nav/nearestOpen.js +18 -0
  105. package/dist/nav/straightenPath.js +50 -0
  106. package/dist/net/Connection.js +107 -0
  107. package/dist/net/InterpolationBuffer.js +56 -0
  108. package/dist/net/PredictedMover.js +60 -0
  109. package/dist/net/Room.js +91 -0
  110. package/dist/net/RoomHost.js +100 -0
  111. package/dist/net/cadence.js +21 -0
  112. package/dist/net/constants.js +10 -0
  113. package/dist/net/lobby/LobbyClient.js +123 -0
  114. package/dist/net/lobby/LobbyHost.js +365 -0
  115. package/dist/net/lobby/LobbyRooms.js +65 -0
  116. package/dist/net/lobby/Matchmaker.js +105 -0
  117. package/dist/net/movement.js +84 -0
  118. package/dist/net/protocol.js +10 -0
  119. package/dist/net/reconnect.js +10 -0
  120. package/dist/net/serverClock.js +21 -0
  121. package/dist/net/snapshotCodec.js +91 -0
  122. package/dist/parallax/Parallax.js +31 -0
  123. package/dist/parallax/ParallaxLayer.js +69 -0
  124. package/dist/parallax/parallaxMath.js +26 -0
  125. package/dist/particles/Emitter.js +107 -0
  126. package/dist/particles/ParticleBudget.js +31 -0
  127. package/dist/particles/ParticleSim.js +59 -0
  128. package/dist/particles/particleCurves.js +47 -0
  129. package/dist/particles/particleSampling.js +29 -0
  130. package/dist/physics/Body.js +201 -0
  131. package/dist/physics/BroadPhase.js +55 -0
  132. package/dist/physics/Contact.js +75 -0
  133. package/dist/physics/ContactSolver.js +69 -0
  134. package/dist/physics/PhysicsWorld.js +220 -0
  135. package/dist/physics/SpatialHash.js +38 -0
  136. package/dist/physics/collide.js +75 -0
  137. package/dist/physics/collidePolygon.js +93 -0
  138. package/dist/physics/contactReport.js +13 -0
  139. package/dist/physics/drawColliders.js +30 -0
  140. package/dist/physics/physicsSystem.js +7 -0
  141. package/dist/physics/polygon.js +79 -0
  142. package/dist/physics/raycast.js +61 -0
  143. package/dist/physics/syncToBody.js +18 -0
  144. package/dist/physics/tileBodies.js +58 -0
  145. package/dist/physics/types.js +7 -0
  146. package/dist/pixel/Darkness.js +169 -0
  147. package/dist/pixel/DitherVignette.js +56 -0
  148. package/dist/pixel/Evaporation.js +84 -0
  149. package/dist/pixel/NightShade.js +33 -0
  150. package/dist/pixel/PixelLayer.js +210 -0
  151. package/dist/pixel/PixelMarks.js +99 -0
  152. package/dist/pixel/SwayProp.js +74 -0
  153. package/dist/pixel/aimPixels.js +67 -0
  154. package/dist/pixel/lights.js +43 -0
  155. package/dist/pixel/nineSlice.js +61 -0
  156. package/dist/pixel/paintLayer.js +35 -0
  157. package/dist/pixel/palette.js +56 -0
  158. package/dist/pixel/pixel.js +277 -0
  159. package/dist/pixel/pixelPaint.js +197 -0
  160. package/dist/pixel/pixelParticles.js +35 -0
  161. package/dist/pixel/pixelTone.js +163 -0
  162. package/dist/pixel/propKit.js +40 -0
  163. package/dist/pixel/ramp.js +101 -0
  164. package/dist/pixel/selout.js +34 -0
  165. package/dist/pixel/spritePixels.js +58 -0
  166. package/dist/pixel/swayRig.js +86 -0
  167. package/dist/pixel/vignetteMask.js +23 -0
  168. package/dist/pixel/weatherArt.js +60 -0
  169. package/dist/pixel.js +96 -0
  170. package/dist/platform/appResume.js +18 -0
  171. package/dist/platform/fullscreen.js +52 -0
  172. package/dist/platform/orientation.js +26 -0
  173. package/dist/platform/pointerLock.js +37 -0
  174. package/dist/platform/reducedMotion.js +23 -0
  175. package/dist/platform/timeoutSignal.js +14 -0
  176. package/dist/platform/touch.js +32 -0
  177. package/dist/postfx/BloomFilter.js +64 -0
  178. package/dist/postfx/ChromaticAberrationFilter.js +24 -0
  179. package/dist/postfx/ColorAdjustFilter.js +75 -0
  180. package/dist/postfx/CrtFilter.js +41 -0
  181. package/dist/postfx/PixelateFilter.js +26 -0
  182. package/dist/postfx/PostFx.js +122 -0
  183. package/dist/postfx/ShockwaveFilter.js +48 -0
  184. package/dist/postfx/VignetteFilter.js +36 -0
  185. package/dist/postfx/fxAnimator.js +37 -0
  186. package/dist/postfx/fxShader.js +127 -0
  187. package/dist/postfx.js +25 -0
  188. package/dist/react/ChoiceDialog.js +50 -0
  189. package/dist/react/ConfirmDialog.js +52 -0
  190. package/dist/react/Glyph.js +62 -0
  191. package/dist/react/Modal.js +37 -0
  192. package/dist/react/Panel.js +23 -0
  193. package/dist/react/PixelImage.js +23 -0
  194. package/dist/react/Select.js +98 -0
  195. package/dist/react/Slider.js +61 -0
  196. package/dist/react/SplitPane.js +23 -0
  197. package/dist/react/TabStrip.js +31 -0
  198. package/dist/react/TitleTips.js +41 -0
  199. package/dist/react/Tooltip.js +27 -0
  200. package/dist/react/UiProvider.js +49 -0
  201. package/dist/react/baseCss.js +221 -0
  202. package/dist/react/choiceStore.js +22 -0
  203. package/dist/react/classNames.js +18 -0
  204. package/dist/react/confirmStore.js +29 -0
  205. package/dist/react/labels.js +17 -0
  206. package/dist/react/placement.js +48 -0
  207. package/dist/react/useFillSheet.js +22 -0
  208. package/dist/react/useFitToViewport.js +28 -0
  209. package/dist/react/usePicked.js +12 -0
  210. package/dist/react/useStore.js +8 -0
  211. package/dist/react/useViewport.js +16 -0
  212. package/dist/react.js +77 -0
  213. package/dist/rig/PosePlayer.js +91 -0
  214. package/dist/rig/RigView.js +124 -0
  215. package/dist/rig/Skeleton.js +30 -0
  216. package/dist/rig/humanoid.js +5 -0
  217. package/dist/rig/humanoid.json.js +29 -0
  218. package/dist/rig/humanoidPoses.js +29 -0
  219. package/dist/rig/poseMath.js +53 -0
  220. package/dist/rig/poses.json.js +149 -0
  221. package/dist/save/Autosaver.js +53 -0
  222. package/dist/save/MemoryBackend.js +18 -0
  223. package/dist/save/SaveStore.js +102 -0
  224. package/dist/save/WebStorageBackend.js +26 -0
  225. package/dist/save/checksum.js +9 -0
  226. package/dist/save/migrateSave.js +26 -0
  227. package/dist/settings.js +26 -0
  228. package/dist/tilemap/TilemapView.js +68 -0
  229. package/dist/tilemap/collision.js +24 -0
  230. package/dist/tilemap/tiled.js +137 -0
  231. package/dist/transitions/CrossfadeTransition.js +23 -0
  232. package/dist/transitions/DitherWipeTransition.js +69 -0
  233. package/dist/transitions/FadeTransition.js +33 -0
  234. package/dist/transitions/Letterbox.js +41 -0
  235. package/dist/transitions/ditherMask.js +14 -0
  236. package/dist/transitions/transitionTo.js +27 -0
  237. package/dist/transitions/tweenDone.js +14 -0
  238. package/dist/types/ambient/ColorGrade.d.ts +41 -0
  239. package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
  240. package/dist/types/ambient/DayClock.d.ts +80 -0
  241. package/dist/types/ambient/DayClock.d.ts.map +1 -0
  242. package/dist/types/ambient/WeatherLayer.d.ts +78 -0
  243. package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
  244. package/dist/types/ambient/grade.d.ts +22 -0
  245. package/dist/types/ambient/grade.d.ts.map +1 -0
  246. package/dist/types/ambient/weather.d.ts +49 -0
  247. package/dist/types/ambient/weather.d.ts.map +1 -0
  248. package/dist/types/anim/AnimStateMachine.d.ts +80 -0
  249. package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
  250. package/dist/types/anim/Animator.d.ts +50 -0
  251. package/dist/types/anim/Animator.d.ts.map +1 -0
  252. package/dist/types/anim/animStateCompile.d.ts +52 -0
  253. package/dist/types/anim/animStateCompile.d.ts.map +1 -0
  254. package/dist/types/anim/animStateSystem.d.ts +10 -0
  255. package/dist/types/anim/animStateSystem.d.ts.map +1 -0
  256. package/dist/types/anim/animStateTypes.d.ts +50 -0
  257. package/dist/types/anim/animStateTypes.d.ts.map +1 -0
  258. package/dist/types/anim/animationSystem.d.ts +13 -0
  259. package/dist/types/anim/animationSystem.d.ts.map +1 -0
  260. package/dist/types/anim/asepriteSlices.d.ts +19 -0
  261. package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
  262. package/dist/types/anim/asepriteTags.d.ts +16 -0
  263. package/dist/types/anim/asepriteTags.d.ts.map +1 -0
  264. package/dist/types/anim/asepriteTypes.d.ts +159 -0
  265. package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
  266. package/dist/types/anim/parseAseprite.d.ts +21 -0
  267. package/dist/types/anim/parseAseprite.d.ts.map +1 -0
  268. package/dist/types/assets/AssetLoader.d.ts +140 -0
  269. package/dist/types/assets/AssetLoader.d.ts.map +1 -0
  270. package/dist/types/assets/loadAseprite.d.ts +27 -0
  271. package/dist/types/assets/loadAseprite.d.ts.map +1 -0
  272. package/dist/types/assets/textureAtlas.d.ts +35 -0
  273. package/dist/types/assets/textureAtlas.d.ts.map +1 -0
  274. package/dist/types/audio/Footsteps.d.ts +33 -0
  275. package/dist/types/audio/Footsteps.d.ts.map +1 -0
  276. package/dist/types/audio/MusicPlayer.d.ts +65 -0
  277. package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
  278. package/dist/types/audio/SoundEngine.d.ts +47 -0
  279. package/dist/types/audio/SoundEngine.d.ts.map +1 -0
  280. package/dist/types/audio/cleanTake.d.ts +3 -0
  281. package/dist/types/audio/cleanTake.d.ts.map +1 -0
  282. package/dist/types/audio/music/ElementVoice.d.ts +14 -0
  283. package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
  284. package/dist/types/audio/music/GraphVoice.d.ts +22 -0
  285. package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
  286. package/dist/types/audio/music/MusicChannel.d.ts +35 -0
  287. package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
  288. package/dist/types/audio/music/musicVoice.d.ts +26 -0
  289. package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
  290. package/dist/types/audio/sampleBank.d.ts +27 -0
  291. package/dist/types/audio/sampleBank.d.ts.map +1 -0
  292. package/dist/types/audio/soundTable.d.ts +14 -0
  293. package/dist/types/audio/soundTable.d.ts.map +1 -0
  294. package/dist/types/audio/synth.d.ts +34 -0
  295. package/dist/types/audio/synth.d.ts.map +1 -0
  296. package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
  297. package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
  298. package/dist/types/core/BitmapLabel.d.ts +36 -0
  299. package/dist/types/core/BitmapLabel.d.ts.map +1 -0
  300. package/dist/types/core/Camera.d.ts +115 -0
  301. package/dist/types/core/Camera.d.ts.map +1 -0
  302. package/dist/types/core/Clock.d.ts +23 -0
  303. package/dist/types/core/Clock.d.ts.map +1 -0
  304. package/dist/types/core/Graphics.d.ts +37 -0
  305. package/dist/types/core/Graphics.d.ts.map +1 -0
  306. package/dist/types/core/Group.d.ts +15 -0
  307. package/dist/types/core/Group.d.ts.map +1 -0
  308. package/dist/types/core/Image.d.ts +25 -0
  309. package/dist/types/core/Image.d.ts.map +1 -0
  310. package/dist/types/core/ObjectFactory.d.ts +34 -0
  311. package/dist/types/core/ObjectFactory.d.ts.map +1 -0
  312. package/dist/types/core/Pointer.d.ts +45 -0
  313. package/dist/types/core/Pointer.d.ts.map +1 -0
  314. package/dist/types/core/Rectangle.d.ts +26 -0
  315. package/dist/types/core/Rectangle.d.ts.map +1 -0
  316. package/dist/types/core/Stage.d.ts +58 -0
  317. package/dist/types/core/Stage.d.ts.map +1 -0
  318. package/dist/types/core/Text.d.ts +22 -0
  319. package/dist/types/core/Text.d.ts.map +1 -0
  320. package/dist/types/core/TextureRegistry.d.ts +90 -0
  321. package/dist/types/core/TextureRegistry.d.ts.map +1 -0
  322. package/dist/types/core/Timeline.d.ts +115 -0
  323. package/dist/types/core/Timeline.d.ts.map +1 -0
  324. package/dist/types/core/TimelineBuilder.d.ts +53 -0
  325. package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
  326. package/dist/types/core/TimelineChild.d.ts +51 -0
  327. package/dist/types/core/TimelineChild.d.ts.map +1 -0
  328. package/dist/types/core/Tweener.d.ts +70 -0
  329. package/dist/types/core/Tweener.d.ts.map +1 -0
  330. package/dist/types/core/atlas.d.ts +16 -0
  331. package/dist/types/core/atlas.d.ts.map +1 -0
  332. package/dist/types/core/atlasPlan.d.ts +34 -0
  333. package/dist/types/core/atlasPlan.d.ts.map +1 -0
  334. package/dist/types/core/blendLayer.d.ts +23 -0
  335. package/dist/types/core/blendLayer.d.ts.map +1 -0
  336. package/dist/types/core/eases.d.ts +3 -0
  337. package/dist/types/core/eases.d.ts.map +1 -0
  338. package/dist/types/core/gameObject.d.ts +42 -0
  339. package/dist/types/core/gameObject.d.ts.map +1 -0
  340. package/dist/types/core/pixelZoom.d.ts +45 -0
  341. package/dist/types/core/pixelZoom.d.ts.map +1 -0
  342. package/dist/types/core/pixiPatches.d.ts +9 -0
  343. package/dist/types/core/pixiPatches.d.ts.map +1 -0
  344. package/dist/types/core/runDue.d.ts +15 -0
  345. package/dist/types/core/runDue.d.ts.map +1 -0
  346. package/dist/types/core/silhouette.d.ts +16 -0
  347. package/dist/types/core/silhouette.d.ts.map +1 -0
  348. package/dist/types/core/timelinePlace.d.ts +23 -0
  349. package/dist/types/core/timelinePlace.d.ts.map +1 -0
  350. package/dist/types/core/tweenProps.d.ts +8 -0
  351. package/dist/types/core/tweenProps.d.ts.map +1 -0
  352. package/dist/types/core/types.d.ts +4 -0
  353. package/dist/types/core/types.d.ts.map +1 -0
  354. package/dist/types/debug/DebugOverlay.d.ts +63 -0
  355. package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
  356. package/dist/types/debug/DrawCallCounter.d.ts +20 -0
  357. package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
  358. package/dist/types/debug/ErrorLog.d.ts +20 -0
  359. package/dist/types/debug/ErrorLog.d.ts.map +1 -0
  360. package/dist/types/debug/FrameStats.d.ts +21 -0
  361. package/dist/types/debug/FrameStats.d.ts.map +1 -0
  362. package/dist/types/debug/inspectWorld.d.ts +14 -0
  363. package/dist/types/debug/inspectWorld.d.ts.map +1 -0
  364. package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
  365. package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
  366. package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
  367. package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
  368. package/dist/types/diagnostics/bootWatch.d.ts +25 -0
  369. package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
  370. package/dist/types/diagnostics/captureErrors.d.ts +24 -0
  371. package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
  372. package/dist/types/diagnostics/contextLoss.d.ts +35 -0
  373. package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
  374. package/dist/types/diagnostics/frameStats.d.ts +30 -0
  375. package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
  376. package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
  377. package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
  378. package/dist/types/diagnostics/renderGuard.d.ts +12 -0
  379. package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
  380. package/dist/types/ecs/SparseSet.d.ts +25 -0
  381. package/dist/types/ecs/SparseSet.d.ts.map +1 -0
  382. package/dist/types/ecs/World.d.ts +137 -0
  383. package/dist/types/ecs/World.d.ts.map +1 -0
  384. package/dist/types/ecs/fields.d.ts +34 -0
  385. package/dist/types/ecs/fields.d.ts.map +1 -0
  386. package/dist/types/engine/Engine.d.ts +96 -0
  387. package/dist/types/engine/Engine.d.ts.map +1 -0
  388. package/dist/types/engine/FixedLoop.d.ts +32 -0
  389. package/dist/types/engine/FixedLoop.d.ts.map +1 -0
  390. package/dist/types/engine/HiddenPause.d.ts +22 -0
  391. package/dist/types/engine/HiddenPause.d.ts.map +1 -0
  392. package/dist/types/engine/Scene.d.ts +67 -0
  393. package/dist/types/engine/Scene.d.ts.map +1 -0
  394. package/dist/types/engine/SceneManager.d.ts +36 -0
  395. package/dist/types/engine/SceneManager.d.ts.map +1 -0
  396. package/dist/types/events/EventBus.d.ts +20 -0
  397. package/dist/types/events/EventBus.d.ts.map +1 -0
  398. package/dist/types/fx/Afterimages.d.ts +62 -0
  399. package/dist/types/fx/Afterimages.d.ts.map +1 -0
  400. package/dist/types/fx/FloatingText.d.ts +71 -0
  401. package/dist/types/fx/FloatingText.d.ts.map +1 -0
  402. package/dist/types/fx/hitStop.d.ts +20 -0
  403. package/dist/types/fx/hitStop.d.ts.map +1 -0
  404. package/dist/types/fx/viewCull.d.ts +14 -0
  405. package/dist/types/fx/viewCull.d.ts.map +1 -0
  406. package/dist/types/i18n/Translator.d.ts +52 -0
  407. package/dist/types/i18n/Translator.d.ts.map +1 -0
  408. package/dist/types/i18n/extractStrings.d.ts +25 -0
  409. package/dist/types/i18n/extractStrings.d.ts.map +1 -0
  410. package/dist/types/i18n/formatMessage.d.ts +10 -0
  411. package/dist/types/i18n/formatMessage.d.ts.map +1 -0
  412. package/dist/types/index.d.ts +164 -0
  413. package/dist/types/index.d.ts.map +1 -0
  414. package/dist/types/input/Actions.d.ts +100 -0
  415. package/dist/types/input/Actions.d.ts.map +1 -0
  416. package/dist/types/input/AimGesture.d.ts +106 -0
  417. package/dist/types/input/AimGesture.d.ts.map +1 -0
  418. package/dist/types/input/Keyboard.d.ts +30 -0
  419. package/dist/types/input/Keyboard.d.ts.map +1 -0
  420. package/dist/types/input/Keymap.d.ts +85 -0
  421. package/dist/types/input/Keymap.d.ts.map +1 -0
  422. package/dist/types/input/TargetLock.d.ts +56 -0
  423. package/dist/types/input/TargetLock.d.ts.map +1 -0
  424. package/dist/types/input/aimAxis.d.ts +9 -0
  425. package/dist/types/input/aimAxis.d.ts.map +1 -0
  426. package/dist/types/input/keyChord.d.ts +15 -0
  427. package/dist/types/input/keyChord.d.ts.map +1 -0
  428. package/dist/types/input/longPress.d.ts +21 -0
  429. package/dist/types/input/longPress.d.ts.map +1 -0
  430. package/dist/types/input/rumble.d.ts +41 -0
  431. package/dist/types/input/rumble.d.ts.map +1 -0
  432. package/dist/types/input/stickAxis.d.ts +26 -0
  433. package/dist/types/input/stickAxis.d.ts.map +1 -0
  434. package/dist/types/input/touchDetect.d.ts +18 -0
  435. package/dist/types/input/touchDetect.d.ts.map +1 -0
  436. package/dist/types/light/LightLayer.d.ts +65 -0
  437. package/dist/types/light/LightLayer.d.ts.map +1 -0
  438. package/dist/types/nav/MinHeap.d.ts +15 -0
  439. package/dist/types/nav/MinHeap.d.ts.map +1 -0
  440. package/dist/types/nav/findPath.d.ts +38 -0
  441. package/dist/types/nav/findPath.d.ts.map +1 -0
  442. package/dist/types/nav/navGrid.d.ts +48 -0
  443. package/dist/types/nav/navGrid.d.ts.map +1 -0
  444. package/dist/types/nav/nearestOpen.d.ts +8 -0
  445. package/dist/types/nav/nearestOpen.d.ts.map +1 -0
  446. package/dist/types/nav/straightenPath.d.ts +13 -0
  447. package/dist/types/nav/straightenPath.d.ts.map +1 -0
  448. package/dist/types/net/Connection.d.ts +88 -0
  449. package/dist/types/net/Connection.d.ts.map +1 -0
  450. package/dist/types/net/InterpolationBuffer.d.ts +36 -0
  451. package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
  452. package/dist/types/net/PredictedMover.d.ts +43 -0
  453. package/dist/types/net/PredictedMover.d.ts.map +1 -0
  454. package/dist/types/net/Room.d.ts +69 -0
  455. package/dist/types/net/Room.d.ts.map +1 -0
  456. package/dist/types/net/RoomHost.d.ts +74 -0
  457. package/dist/types/net/RoomHost.d.ts.map +1 -0
  458. package/dist/types/net/cadence.d.ts +22 -0
  459. package/dist/types/net/cadence.d.ts.map +1 -0
  460. package/dist/types/net/constants.d.ts +33 -0
  461. package/dist/types/net/constants.d.ts.map +1 -0
  462. package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
  463. package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
  464. package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
  465. package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
  466. package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
  467. package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
  468. package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
  469. package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
  470. package/dist/types/net/lobby/index.d.ts +6 -0
  471. package/dist/types/net/lobby/index.d.ts.map +1 -0
  472. package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
  473. package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
  474. package/dist/types/net/movement.d.ts +50 -0
  475. package/dist/types/net/movement.d.ts.map +1 -0
  476. package/dist/types/net/protocol.d.ts +59 -0
  477. package/dist/types/net/protocol.d.ts.map +1 -0
  478. package/dist/types/net/reconnect.d.ts +14 -0
  479. package/dist/types/net/reconnect.d.ts.map +1 -0
  480. package/dist/types/net/serverClock.d.ts +14 -0
  481. package/dist/types/net/serverClock.d.ts.map +1 -0
  482. package/dist/types/net/snapshotCodec.d.ts +55 -0
  483. package/dist/types/net/snapshotCodec.d.ts.map +1 -0
  484. package/dist/types/parallax/Parallax.d.ts +37 -0
  485. package/dist/types/parallax/Parallax.d.ts.map +1 -0
  486. package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
  487. package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
  488. package/dist/types/parallax/parallaxMath.d.ts +50 -0
  489. package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
  490. package/dist/types/particles/Emitter.d.ts +97 -0
  491. package/dist/types/particles/Emitter.d.ts.map +1 -0
  492. package/dist/types/particles/ParticleBudget.d.ts +28 -0
  493. package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
  494. package/dist/types/particles/ParticleSim.d.ts +38 -0
  495. package/dist/types/particles/ParticleSim.d.ts.map +1 -0
  496. package/dist/types/particles/particleCurves.d.ts +21 -0
  497. package/dist/types/particles/particleCurves.d.ts.map +1 -0
  498. package/dist/types/particles/particleSampling.d.ts +20 -0
  499. package/dist/types/particles/particleSampling.d.ts.map +1 -0
  500. package/dist/types/physics/Body.d.ts +130 -0
  501. package/dist/types/physics/Body.d.ts.map +1 -0
  502. package/dist/types/physics/BroadPhase.d.ts +26 -0
  503. package/dist/types/physics/BroadPhase.d.ts.map +1 -0
  504. package/dist/types/physics/Contact.d.ts +62 -0
  505. package/dist/types/physics/Contact.d.ts.map +1 -0
  506. package/dist/types/physics/ContactSolver.d.ts +29 -0
  507. package/dist/types/physics/ContactSolver.d.ts.map +1 -0
  508. package/dist/types/physics/PhysicsWorld.d.ts +78 -0
  509. package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
  510. package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
  511. package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
  512. package/dist/types/physics/SpatialHash.d.ts +23 -0
  513. package/dist/types/physics/SpatialHash.d.ts.map +1 -0
  514. package/dist/types/physics/collide.d.ts +27 -0
  515. package/dist/types/physics/collide.d.ts.map +1 -0
  516. package/dist/types/physics/collidePolygon.d.ts +14 -0
  517. package/dist/types/physics/collidePolygon.d.ts.map +1 -0
  518. package/dist/types/physics/contactReport.d.ts +8 -0
  519. package/dist/types/physics/contactReport.d.ts.map +1 -0
  520. package/dist/types/physics/drawColliders.d.ts +43 -0
  521. package/dist/types/physics/drawColliders.d.ts.map +1 -0
  522. package/dist/types/physics/physicsSystem.d.ts +5 -0
  523. package/dist/types/physics/physicsSystem.d.ts.map +1 -0
  524. package/dist/types/physics/polygon.d.ts +28 -0
  525. package/dist/types/physics/polygon.d.ts.map +1 -0
  526. package/dist/types/physics/raycast.d.ts +19 -0
  527. package/dist/types/physics/raycast.d.ts.map +1 -0
  528. package/dist/types/physics/syncToBody.d.ts +16 -0
  529. package/dist/types/physics/syncToBody.d.ts.map +1 -0
  530. package/dist/types/physics/tileBodies.d.ts +36 -0
  531. package/dist/types/physics/tileBodies.d.ts.map +1 -0
  532. package/dist/types/physics/types.d.ts +116 -0
  533. package/dist/types/physics/types.d.ts.map +1 -0
  534. package/dist/types/pixel/Darkness.d.ts +90 -0
  535. package/dist/types/pixel/Darkness.d.ts.map +1 -0
  536. package/dist/types/pixel/DitherVignette.d.ts +35 -0
  537. package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
  538. package/dist/types/pixel/Evaporation.d.ts +30 -0
  539. package/dist/types/pixel/Evaporation.d.ts.map +1 -0
  540. package/dist/types/pixel/NightShade.d.ts +38 -0
  541. package/dist/types/pixel/NightShade.d.ts.map +1 -0
  542. package/dist/types/pixel/PixelLayer.d.ts +85 -0
  543. package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
  544. package/dist/types/pixel/PixelMarks.d.ts +68 -0
  545. package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
  546. package/dist/types/pixel/SwayProp.d.ts +52 -0
  547. package/dist/types/pixel/SwayProp.d.ts.map +1 -0
  548. package/dist/types/pixel/aimPixels.d.ts +23 -0
  549. package/dist/types/pixel/aimPixels.d.ts.map +1 -0
  550. package/dist/types/pixel/index.d.ts +33 -0
  551. package/dist/types/pixel/index.d.ts.map +1 -0
  552. package/dist/types/pixel/lights.d.ts +34 -0
  553. package/dist/types/pixel/lights.d.ts.map +1 -0
  554. package/dist/types/pixel/nineSlice.d.ts +71 -0
  555. package/dist/types/pixel/nineSlice.d.ts.map +1 -0
  556. package/dist/types/pixel/paintLayer.d.ts +35 -0
  557. package/dist/types/pixel/paintLayer.d.ts.map +1 -0
  558. package/dist/types/pixel/palette.d.ts +58 -0
  559. package/dist/types/pixel/palette.d.ts.map +1 -0
  560. package/dist/types/pixel/pixel.d.ts +80 -0
  561. package/dist/types/pixel/pixel.d.ts.map +1 -0
  562. package/dist/types/pixel/pixelPaint.d.ts +44 -0
  563. package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
  564. package/dist/types/pixel/pixelParticles.d.ts +21 -0
  565. package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
  566. package/dist/types/pixel/pixelTone.d.ts +51 -0
  567. package/dist/types/pixel/pixelTone.d.ts.map +1 -0
  568. package/dist/types/pixel/propKit.d.ts +26 -0
  569. package/dist/types/pixel/propKit.d.ts.map +1 -0
  570. package/dist/types/pixel/ramp.d.ts +57 -0
  571. package/dist/types/pixel/ramp.d.ts.map +1 -0
  572. package/dist/types/pixel/selout.d.ts +3 -0
  573. package/dist/types/pixel/selout.d.ts.map +1 -0
  574. package/dist/types/pixel/spritePixels.d.ts +29 -0
  575. package/dist/types/pixel/spritePixels.d.ts.map +1 -0
  576. package/dist/types/pixel/swayRig.d.ts +72 -0
  577. package/dist/types/pixel/swayRig.d.ts.map +1 -0
  578. package/dist/types/pixel/vignetteMask.d.ts +16 -0
  579. package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
  580. package/dist/types/pixel/weatherArt.d.ts +29 -0
  581. package/dist/types/pixel/weatherArt.d.ts.map +1 -0
  582. package/dist/types/platform/appResume.d.ts +25 -0
  583. package/dist/types/platform/appResume.d.ts.map +1 -0
  584. package/dist/types/platform/fullscreen.d.ts +37 -0
  585. package/dist/types/platform/fullscreen.d.ts.map +1 -0
  586. package/dist/types/platform/orientation.d.ts +19 -0
  587. package/dist/types/platform/orientation.d.ts.map +1 -0
  588. package/dist/types/platform/pointerLock.d.ts +26 -0
  589. package/dist/types/platform/pointerLock.d.ts.map +1 -0
  590. package/dist/types/platform/reducedMotion.d.ts +20 -0
  591. package/dist/types/platform/reducedMotion.d.ts.map +1 -0
  592. package/dist/types/platform/timeoutSignal.d.ts +6 -0
  593. package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
  594. package/dist/types/platform/touch.d.ts +10 -0
  595. package/dist/types/platform/touch.d.ts.map +1 -0
  596. package/dist/types/postfx/BloomFilter.d.ts +33 -0
  597. package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
  598. package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
  599. package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
  600. package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
  601. package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
  602. package/dist/types/postfx/CrtFilter.d.ts +16 -0
  603. package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
  604. package/dist/types/postfx/PixelateFilter.d.ts +8 -0
  605. package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
  606. package/dist/types/postfx/PostFx.d.ts +92 -0
  607. package/dist/types/postfx/PostFx.d.ts.map +1 -0
  608. package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
  609. package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
  610. package/dist/types/postfx/VignetteFilter.d.ts +19 -0
  611. package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
  612. package/dist/types/postfx/fxAnimator.d.ts +32 -0
  613. package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
  614. package/dist/types/postfx/fxShader.d.ts +49 -0
  615. package/dist/types/postfx/fxShader.d.ts.map +1 -0
  616. package/dist/types/postfx/index.d.ts +11 -0
  617. package/dist/types/postfx/index.d.ts.map +1 -0
  618. package/dist/types/react/ChoiceDialog.d.ts +8 -0
  619. package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
  620. package/dist/types/react/ConfirmDialog.d.ts +9 -0
  621. package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
  622. package/dist/types/react/Glyph.d.ts +54 -0
  623. package/dist/types/react/Glyph.d.ts.map +1 -0
  624. package/dist/types/react/Modal.d.ts +22 -0
  625. package/dist/types/react/Modal.d.ts.map +1 -0
  626. package/dist/types/react/Panel.d.ts +29 -0
  627. package/dist/types/react/Panel.d.ts.map +1 -0
  628. package/dist/types/react/PixelImage.d.ts +19 -0
  629. package/dist/types/react/PixelImage.d.ts.map +1 -0
  630. package/dist/types/react/Select.d.ts +27 -0
  631. package/dist/types/react/Select.d.ts.map +1 -0
  632. package/dist/types/react/Slider.d.ts +24 -0
  633. package/dist/types/react/Slider.d.ts.map +1 -0
  634. package/dist/types/react/SplitPane.d.ts +26 -0
  635. package/dist/types/react/SplitPane.d.ts.map +1 -0
  636. package/dist/types/react/TabStrip.d.ts +31 -0
  637. package/dist/types/react/TabStrip.d.ts.map +1 -0
  638. package/dist/types/react/TitleTips.d.ts +15 -0
  639. package/dist/types/react/TitleTips.d.ts.map +1 -0
  640. package/dist/types/react/Tooltip.d.ts +22 -0
  641. package/dist/types/react/Tooltip.d.ts.map +1 -0
  642. package/dist/types/react/UiProvider.d.ts +52 -0
  643. package/dist/types/react/UiProvider.d.ts.map +1 -0
  644. package/dist/types/react/baseCss.d.ts +27 -0
  645. package/dist/types/react/baseCss.d.ts.map +1 -0
  646. package/dist/types/react/choiceStore.d.ts +34 -0
  647. package/dist/types/react/choiceStore.d.ts.map +1 -0
  648. package/dist/types/react/classNames.d.ts +12 -0
  649. package/dist/types/react/classNames.d.ts.map +1 -0
  650. package/dist/types/react/confirmStore.d.ts +30 -0
  651. package/dist/types/react/confirmStore.d.ts.map +1 -0
  652. package/dist/types/react/index.d.ts +33 -0
  653. package/dist/types/react/index.d.ts.map +1 -0
  654. package/dist/types/react/labels.d.ts +24 -0
  655. package/dist/types/react/labels.d.ts.map +1 -0
  656. package/dist/types/react/placement.d.ts +59 -0
  657. package/dist/types/react/placement.d.ts.map +1 -0
  658. package/dist/types/react/useFillSheet.d.ts +9 -0
  659. package/dist/types/react/useFillSheet.d.ts.map +1 -0
  660. package/dist/types/react/useFitToViewport.d.ts +20 -0
  661. package/dist/types/react/useFitToViewport.d.ts.map +1 -0
  662. package/dist/types/react/usePicked.d.ts +9 -0
  663. package/dist/types/react/usePicked.d.ts.map +1 -0
  664. package/dist/types/react/useStore.d.ts +8 -0
  665. package/dist/types/react/useStore.d.ts.map +1 -0
  666. package/dist/types/react/useViewport.d.ts +4 -0
  667. package/dist/types/react/useViewport.d.ts.map +1 -0
  668. package/dist/types/rig/PosePlayer.d.ts +64 -0
  669. package/dist/types/rig/PosePlayer.d.ts.map +1 -0
  670. package/dist/types/rig/RigView.d.ts +68 -0
  671. package/dist/types/rig/RigView.d.ts.map +1 -0
  672. package/dist/types/rig/Skeleton.d.ts +14 -0
  673. package/dist/types/rig/Skeleton.d.ts.map +1 -0
  674. package/dist/types/rig/humanoid.d.ts +4 -0
  675. package/dist/types/rig/humanoid.d.ts.map +1 -0
  676. package/dist/types/rig/humanoidPoses.d.ts +117 -0
  677. package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
  678. package/dist/types/rig/poseMath.d.ts +14 -0
  679. package/dist/types/rig/poseMath.d.ts.map +1 -0
  680. package/dist/types/rig/rigTypes.d.ts +82 -0
  681. package/dist/types/rig/rigTypes.d.ts.map +1 -0
  682. package/dist/types/save/Autosaver.d.ts +43 -0
  683. package/dist/types/save/Autosaver.d.ts.map +1 -0
  684. package/dist/types/save/MemoryBackend.d.ts +10 -0
  685. package/dist/types/save/MemoryBackend.d.ts.map +1 -0
  686. package/dist/types/save/SaveBackend.d.ts +14 -0
  687. package/dist/types/save/SaveBackend.d.ts.map +1 -0
  688. package/dist/types/save/SaveStore.d.ts +73 -0
  689. package/dist/types/save/SaveStore.d.ts.map +1 -0
  690. package/dist/types/save/WebStorageBackend.d.ts +14 -0
  691. package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
  692. package/dist/types/save/checksum.d.ts +7 -0
  693. package/dist/types/save/checksum.d.ts.map +1 -0
  694. package/dist/types/save/migrateSave.d.ts +17 -0
  695. package/dist/types/save/migrateSave.d.ts.map +1 -0
  696. package/dist/types/settings.d.ts +25 -0
  697. package/dist/types/settings.d.ts.map +1 -0
  698. package/dist/types/tilemap/TilemapView.d.ts +42 -0
  699. package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
  700. package/dist/types/tilemap/collision.d.ts +16 -0
  701. package/dist/types/tilemap/collision.d.ts.map +1 -0
  702. package/dist/types/tilemap/tiled.d.ts +104 -0
  703. package/dist/types/tilemap/tiled.d.ts.map +1 -0
  704. package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
  705. package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
  706. package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
  707. package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
  708. package/dist/types/transitions/FadeTransition.d.ts +20 -0
  709. package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
  710. package/dist/types/transitions/Letterbox.d.ts +33 -0
  711. package/dist/types/transitions/Letterbox.d.ts.map +1 -0
  712. package/dist/types/transitions/Transition.d.ts +22 -0
  713. package/dist/types/transitions/Transition.d.ts.map +1 -0
  714. package/dist/types/transitions/ditherMask.d.ts +13 -0
  715. package/dist/types/transitions/ditherMask.d.ts.map +1 -0
  716. package/dist/types/transitions/transitionTo.d.ts +16 -0
  717. package/dist/types/transitions/transitionTo.d.ts.map +1 -0
  718. package/dist/types/transitions/tweenDone.d.ts +5 -0
  719. package/dist/types/transitions/tweenDone.d.ts.map +1 -0
  720. package/dist/types/ui/Bar.d.ts +41 -0
  721. package/dist/types/ui/Bar.d.ts.map +1 -0
  722. package/dist/types/ui/Button.d.ts +47 -0
  723. package/dist/types/ui/Button.d.ts.map +1 -0
  724. package/dist/types/ui/Dialog.d.ts +47 -0
  725. package/dist/types/ui/Dialog.d.ts.map +1 -0
  726. package/dist/types/ui/FocusManager.d.ts +53 -0
  727. package/dist/types/ui/FocusManager.d.ts.map +1 -0
  728. package/dist/types/ui/Label.d.ts +24 -0
  729. package/dist/types/ui/Label.d.ts.map +1 -0
  730. package/dist/types/ui/List.d.ts +23 -0
  731. package/dist/types/ui/List.d.ts.map +1 -0
  732. package/dist/types/ui/Panel.d.ts +38 -0
  733. package/dist/types/ui/Panel.d.ts.map +1 -0
  734. package/dist/types/ui/ScrollView.d.ts +56 -0
  735. package/dist/types/ui/ScrollView.d.ts.map +1 -0
  736. package/dist/types/ui/Slider.d.ts +47 -0
  737. package/dist/types/ui/Slider.d.ts.map +1 -0
  738. package/dist/types/ui/Stack.d.ts +16 -0
  739. package/dist/types/ui/Stack.d.ts.map +1 -0
  740. package/dist/types/ui/Toggle.d.ts +31 -0
  741. package/dist/types/ui/Toggle.d.ts.map +1 -0
  742. package/dist/types/ui/UiHost.d.ts +18 -0
  743. package/dist/types/ui/UiHost.d.ts.map +1 -0
  744. package/dist/types/ui/UiPointerGate.d.ts +17 -0
  745. package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
  746. package/dist/types/ui/UiRoot.d.ts +73 -0
  747. package/dist/types/ui/UiRoot.d.ts.map +1 -0
  748. package/dist/types/ui/Widget.d.ts +56 -0
  749. package/dist/types/ui/Widget.d.ts.map +1 -0
  750. package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
  751. package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
  752. package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
  753. package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
  754. package/dist/types/ui/dom/InputShield.d.ts +20 -0
  755. package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
  756. package/dist/types/ui/dom/createStore.d.ts +22 -0
  757. package/dist/types/ui/dom/createStore.d.ts.map +1 -0
  758. package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
  759. package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
  760. package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
  761. package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
  762. package/dist/types/ui/index.d.ts +42 -0
  763. package/dist/types/ui/index.d.ts.map +1 -0
  764. package/dist/types/ui/layout/anchor.d.ts +9 -0
  765. package/dist/types/ui/layout/anchor.d.ts.map +1 -0
  766. package/dist/types/ui/layout/barDrain.d.ts +25 -0
  767. package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
  768. package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
  769. package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
  770. package/dist/types/ui/layout/focusNav.d.ts +13 -0
  771. package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
  772. package/dist/types/ui/layout/geometry.d.ts +35 -0
  773. package/dist/types/ui/layout/geometry.d.ts.map +1 -0
  774. package/dist/types/ui/layout/listWidth.d.ts +13 -0
  775. package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
  776. package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
  777. package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
  778. package/dist/types/ui/layout/scroll.d.ts +17 -0
  779. package/dist/types/ui/layout/scroll.d.ts.map +1 -0
  780. package/dist/types/ui/layout/slider.d.ts +7 -0
  781. package/dist/types/ui/layout/slider.d.ts.map +1 -0
  782. package/dist/types/ui/layout/stack.d.ts +26 -0
  783. package/dist/types/ui/layout/stack.d.ts.map +1 -0
  784. package/dist/types/ui/layout/wrapRow.d.ts +6 -0
  785. package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
  786. package/dist/types/ui/rich/RichText.d.ts +48 -0
  787. package/dist/types/ui/rich/RichText.d.ts.map +1 -0
  788. package/dist/types/ui/rich/richFonts.d.ts +70 -0
  789. package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
  790. package/dist/types/ui/rich/richLayout.d.ts +76 -0
  791. package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
  792. package/dist/types/ui/rich/richMarkup.d.ts +48 -0
  793. package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
  794. package/dist/ui/Bar.js +53 -0
  795. package/dist/ui/Button.js +57 -0
  796. package/dist/ui/Dialog.js +55 -0
  797. package/dist/ui/FocusManager.js +96 -0
  798. package/dist/ui/Label.js +35 -0
  799. package/dist/ui/List.js +44 -0
  800. package/dist/ui/Panel.js +37 -0
  801. package/dist/ui/ScrollView.js +95 -0
  802. package/dist/ui/Slider.js +54 -0
  803. package/dist/ui/Stack.js +27 -0
  804. package/dist/ui/Toggle.js +36 -0
  805. package/dist/ui/UiHost.js +8 -0
  806. package/dist/ui/UiPointerGate.js +24 -0
  807. package/dist/ui/UiRoot.js +92 -0
  808. package/dist/ui/Widget.js +89 -0
  809. package/dist/ui/dom/DomOverlay.js +58 -0
  810. package/dist/ui/dom/DomWorldAnchors.js +58 -0
  811. package/dist/ui/dom/InputShield.js +26 -0
  812. package/dist/ui/dom/createStore.js +41 -0
  813. package/dist/ui/dom/shieldDecision.js +35 -0
  814. package/dist/ui/dom/worldToScreen.js +10 -0
  815. package/dist/ui/layout/anchor.js +19 -0
  816. package/dist/ui/layout/barDrain.js +24 -0
  817. package/dist/ui/layout/fitToViewport.js +16 -0
  818. package/dist/ui/layout/focusNav.js +41 -0
  819. package/dist/ui/layout/geometry.js +20 -0
  820. package/dist/ui/layout/listWidth.js +9 -0
  821. package/dist/ui/layout/placeTooltip.js +27 -0
  822. package/dist/ui/layout/scroll.js +23 -0
  823. package/dist/ui/layout/slider.js +19 -0
  824. package/dist/ui/layout/stack.js +26 -0
  825. package/dist/ui/layout/wrapRow.js +12 -0
  826. package/dist/ui/rich/RichText.js +87 -0
  827. package/dist/ui/rich/richFonts.js +105 -0
  828. package/dist/ui/rich/richLayout.js +132 -0
  829. package/dist/ui/rich/richMarkup.js +67 -0
  830. package/dist/ui.js +95 -0
  831. package/package.json +112 -4
@@ -0,0 +1,55 @@
1
+ import type { EntityUpdate } from './constants.js';
2
+ /** Any snapshot whose `up` block travels as binary records; the rest is JSON. */
3
+ export interface SnapshotLike {
4
+ up?: EntityUpdate[];
5
+ }
6
+ /**
7
+ * Binary wire form of a snapshot's `up` block. A server in another language must write the same bytes.
8
+ *
9
+ * A snapshot that carries no updates is still one text frame of JSON. A snapshot that does is one **binary** WebSocket
10
+ * frame, big-endian throughout:
11
+ *
12
+ * ```
13
+ * u8 SNAP_FRAME_TAG
14
+ * u32 L, the byte length of the JSON that follows
15
+ * L UTF-8 JSON of the snapshot with `up` left out
16
+ * n × UPDATE_RECORD_BYTES, one record per EntityUpdate, n = (frame length - 5 - L) / 16
17
+ * ```
18
+ *
19
+ * One record (16 bytes), the `[id, x, y, aim, anim, hp, flags]` tuple:
20
+ *
21
+ * | off | type | field |
22
+ * |-----|-------|------------------------------------------------------------------------------------|
23
+ * | 0 | i32 | id |
24
+ * | 4 | i16 | x in 1/UPDATE_POS_SCALE px, clamped to [-32768, 32767] (−4096 … 4095.875 px) |
25
+ * | 6 | i16 | y, the same |
26
+ * | 8 | u8 | aim in 1/UPDATE_AIM_STEPS of a turn, wrapped; read back in [-π, π) |
27
+ * | 9 | u8 | anim (ANIM), clamped to 0..255 |
28
+ * | 10 | i32 | hp (big bodies go past 65535) |
29
+ * | 14 | u16 | flags (ENTITY_FLAG, nine bits used today), clamped to 0..65535 |
30
+ *
31
+ * Quantisation error: position ≤ 1/16 px, aim ≤ π/256 rad. The position range holds maps up to 4096 px a side.
32
+ * Each record is written once per actor state version on the server and shared by every viewer.
33
+ */
34
+ export declare const SNAP_FRAME_TAG = 1;
35
+ /** Tag byte + the u32 JSON length. */
36
+ export declare const SNAP_FRAME_HEADER_BYTES = 5;
37
+ export declare const UPDATE_RECORD_BYTES = 16;
38
+ export declare const UPDATE_POS_SCALE = 8;
39
+ export declare const UPDATE_AIM_STEPS = 256;
40
+ /** World px → the i16 on the wire. */
41
+ export declare function quantizePos(v: number): number;
42
+ /** Radians → the u8 on the wire (wrapped, so any angle is accepted). */
43
+ export declare function quantizeAim(a: number): number;
44
+ export declare function dequantizeAim(b: number): number;
45
+ export declare function writeUpdate(view: DataView, off: number, u: EntityUpdate): void;
46
+ export declare function readUpdate(view: DataView, off: number): EntityUpdate;
47
+ export declare function encodeUpdates(ups: readonly EntityUpdate[]): Uint8Array;
48
+ export declare function decodeUpdates(bytes: Uint8Array): EntityUpdate[];
49
+ /** The updates exactly as a client reads them off the wire: what a local simulation sends, so it quantises like the server. */
50
+ export declare function quantizeUpdates(ups: readonly EntityUpdate[]): EntityUpdate[];
51
+ /** A snapshot as the server frames it: binary when it carries updates (see the layout above). */
52
+ export declare function encodeSnapshotFrame<S extends SnapshotLike>(snap: S): Uint8Array;
53
+ /** Reads a binary snapshot frame back into the same object a text frame parses to. */
54
+ export declare function decodeSnapshotFrame<S extends SnapshotLike>(frame: ArrayBuffer | Uint8Array): S;
55
+ //# sourceMappingURL=snapshotCodec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshotCodec.d.ts","sourceRoot":"","sources":["../../../src/net/snapshotCodec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAUpC,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI7C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,GAAG,IAAI,CAQ9E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAUpE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,YAAY,EAAE,GAAG,UAAU,CAKtE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,EAAE,CAM/D;AAED,+HAA+H;AAC/H,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CAgB5E;AAWD,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,CAAC,GAAG,UAAU,CAY/E;AAED,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,CAAC,CAY9F"}
@@ -0,0 +1,37 @@
1
+ import { Container } from 'pixi.js';
2
+ import { ParallaxLayer, type ParallaxCamera, type ParallaxLayerOptions } from './ParallaxLayer.js';
3
+ export interface ParallaxOptions {
4
+ /**
5
+ * Where the whole parallax sorts among the world layer's children (its `zIndex`, default -1000): below the level,
6
+ * so every layer stays behind it. A foreground layer (factor above 1) belongs in a second `Parallax` with a depth
7
+ * above the level's.
8
+ */
9
+ depth?: number;
10
+ }
11
+ /**
12
+ * Layers of scenery behind (or before) the world, each scrolling at its own share of the camera's speed. Add `view`
13
+ * to the world layer — a scene's `root` — and call `update(camera, dtMs)` once a frame after the camera moved, so
14
+ * the layers sit where this frame's view is:
15
+ *
16
+ * ```ts
17
+ * const sky = new Parallax();
18
+ * sky.add({ texture: clouds, factorX: 0.1, repeatX: true, speedX: -6 });
19
+ * sky.add({ display: hills, factorX: 0.5, factorY: 1 });
20
+ * this.root.addChild(sky.view);
21
+ * // each frame
22
+ * sky.update(stage.cameras.main, dt * 1000);
23
+ * ```
24
+ */
25
+ export declare class Parallax {
26
+ readonly view: Container<import("pixi.js").ContainerChild>;
27
+ private readonly list;
28
+ constructor(options?: ParallaxOptions);
29
+ get layers(): readonly ParallaxLayer[];
30
+ /** Adds a layer (built here from options, or one made before); later layers draw in front unless a `depth` says. */
31
+ add(layer: ParallaxLayer | ParallaxLayerOptions): ParallaxLayer;
32
+ /** Takes a layer out and destroys it. */
33
+ remove(layer: ParallaxLayer): void;
34
+ update(camera: ParallaxCamera, dtMs: number): void;
35
+ destroy(): void;
36
+ }
37
+ //# sourceMappingURL=Parallax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Parallax.d.ts","sourceRoot":"","sources":["../../../src/parallax/Parallax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEhG,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,IAAI,8CAA6C;IAC1D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;gBAEhC,OAAO,GAAE,eAAoB;IAIzC,IAAI,MAAM,IAAI,SAAS,aAAa,EAAE,CAErC;IAED,oHAAoH;IACpH,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,oBAAoB,GAAG,aAAa;IAQ/D,yCAAyC;IACzC,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAOlC,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIlD,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,80 @@
1
+ import { Container, type Texture } from 'pixi.js';
2
+ /** What a parallax layer reads off the camera each frame; the engine's `Camera` has all of it. */
3
+ export interface ParallaxCamera {
4
+ readonly scrollX: number;
5
+ readonly scrollY: number;
6
+ readonly width: number;
7
+ readonly height: number;
8
+ readonly zoom: number;
9
+ /** Set on a pixel-perfect engine: a layer then lands on whole world pixels unless told otherwise. */
10
+ readonly roundPixels?: boolean;
11
+ }
12
+ export interface ParallaxLayerOptions {
13
+ /**
14
+ * A texture to draw, repeated along the axes `repeatX` / `repeatY` name (one tiling sprite, as wide as the view
15
+ * whatever the level's length). Give either this or `display`.
16
+ */
17
+ texture?: Texture;
18
+ /** Anything already drawn (a sprite, a `Graphics`, a container of them), drawn once and never repeated. */
19
+ display?: Container;
20
+ /** Share of the camera's horizontal travel the layer moves on screen: 0 fixed to the screen, 1 with the world (default 0.5). */
21
+ factorX?: number;
22
+ /** The same vertically (default: `factorX`). */
23
+ factorY?: number;
24
+ /** Repeat the texture left and right forever (a `texture` layer only). */
25
+ repeatX?: boolean;
26
+ /** Repeat the texture up and down forever (a `texture` layer only). */
27
+ repeatY?: boolean;
28
+ /** World px added to the layer's position, e.g. where on the level a row of hills stands. */
29
+ offsetX?: number;
30
+ offsetY?: number;
31
+ /** Drift, world px a second, on top of the parallax (clouds). */
32
+ speedX?: number;
33
+ speedY?: number;
34
+ /** Land on whole world pixels (default: the camera's `roundPixels`, i.e. a pixel-perfect engine). */
35
+ snap?: boolean;
36
+ /** Hide the layer while none of it is in view (default true). Repeated layers always fill the view. */
37
+ cull?: boolean;
38
+ /** Order among the parallax's layers: lower draws further back (default: the order they were added in). */
39
+ depth?: number;
40
+ }
41
+ /**
42
+ * One layer of a `Parallax`: a texture or a display object that scrolls at a share of the camera's speed, optionally
43
+ * repeated and drifting. `view` goes into the world layer (the parallax adds it), so the camera's zoom and pixel
44
+ * rounding apply to it like to any world object; the layer only moves it.
45
+ */
46
+ export declare class ParallaxLayer {
47
+ readonly view: Container<import("pixi.js").ContainerChild>;
48
+ factorX: number;
49
+ factorY: number;
50
+ offsetX: number;
51
+ offsetY: number;
52
+ speedX: number;
53
+ speedY: number;
54
+ snap: boolean | undefined;
55
+ cull: boolean;
56
+ /** The depth it was given, if any (a `Parallax` numbers the others in the order they were added). */
57
+ readonly depth: number | undefined;
58
+ private readonly repeatX;
59
+ private readonly repeatY;
60
+ private readonly tiling;
61
+ private readonly tileW;
62
+ private readonly tileH;
63
+ /** The content's local bounds, measured once: reading bounds every frame walks the whole display tree. */
64
+ private boundsX;
65
+ private boundsY;
66
+ private boundsW;
67
+ private boundsH;
68
+ private driftX;
69
+ private driftY;
70
+ private readonly input;
71
+ private readonly px;
72
+ private readonly py;
73
+ constructor(options: ParallaxLayerOptions);
74
+ /** Measures the content again, after it was redrawn larger or smaller (culling reads the measured size). */
75
+ remeasure(): void;
76
+ /** Places the layer for this frame; `dtMs` advances the drift. */
77
+ update(camera: ParallaxCamera, dtMs: number): void;
78
+ destroy(): void;
79
+ }
80
+ //# sourceMappingURL=ParallaxLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallaxLayer.d.ts","sourceRoot":"","sources":["../../../src/parallax/ParallaxLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAGxE,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gIAAgI;IAChI,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uGAAuG;IACvG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2GAA2G;IAC3G,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,QAAQ,CAAC,IAAI,8CAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,qGAAqG;IACrG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,0GAA0G;IAC1G,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiI;IACvJ,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoE;IACvF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoE;gBAE3E,OAAO,EAAE,oBAAoB;IA0BzC,4GAA4G;IAC5G,SAAS,IAAI,IAAI;IAejB,kEAAkE;IAClE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IA2ClD,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The arithmetic of parallax, apart from anything that draws so it can be tested under node. One axis at a time:
3
+ * the same functions serve x and y.
4
+ */
5
+ /**
6
+ * The world position a layer is drawn at so that, on screen, it moves `factor` times as far as the camera: 0 stays
7
+ * fixed to the screen (a sky at infinity), 1 moves with the world, 0.5 at half speed, above 1 faster (a foreground).
8
+ * The layer lives in the world layer, so the camera's zoom scales it like everything else.
9
+ */
10
+ export declare function parallaxOrigin(scroll: number, factor: number, offset?: number): number;
11
+ /** `value` brought into [0, size): where a repeating pattern stands within one tile. 0 for an empty tile. */
12
+ export declare function wrap(value: number, size: number): number;
13
+ /** Whether a span [start, start + size) overlaps the view [viewStart, viewStart + viewSize), `margin` px wider. */
14
+ export declare function spanVisible(start: number, size: number, viewStart: number, viewSize: number, margin?: number): boolean;
15
+ /** Where one axis of a layer goes this frame; written into a caller's object so a frame allocates nothing. */
16
+ export interface AxisPlacement {
17
+ /** The layer's world position on this axis. */
18
+ position: number;
19
+ /** For a repeated axis, how long the tiled strip is (it covers the view); otherwise the content's own size. */
20
+ size: number;
21
+ /** For a repeated axis, the pattern's offset inside the strip (a tiling sprite's tile position), in [0, tile). */
22
+ phase: number;
23
+ /** For an axis that does not repeat, whether the content reaches into the view at all. */
24
+ visible: boolean;
25
+ }
26
+ export interface AxisInput {
27
+ /** The camera's scroll on this axis (the world coordinate at the screen's edge). */
28
+ scroll: number;
29
+ /** How much of the world the view shows on this axis: the screen's size over the camera's zoom. */
30
+ view: number;
31
+ factor: number;
32
+ /** Fixed offset plus whatever auto-scroll has added. */
33
+ offset: number;
34
+ repeat: boolean;
35
+ /** One tile's size on this axis (repeated axes). */
36
+ tile: number;
37
+ /** Where the content's bounds begin from the layer's position, and how long they are (axes that do not repeat). */
38
+ contentStart: number;
39
+ contentSize: number;
40
+ /** Land on whole world pixels. */
41
+ snap: boolean;
42
+ }
43
+ /**
44
+ * Places one axis. A repeated axis is a strip laid over the view, starting at the view's edge (floored to a whole
45
+ * pixel when snapping), whose pattern is shifted so its tiles stand where the parallax puts them: the strip never
46
+ * grows with the level, however long it is. An axis that does not repeat sits at its parallax origin and is visible
47
+ * only while its content overlaps the view.
48
+ */
49
+ export declare function placeAxis(out: AxisPlacement, a: AxisInput): AxisPlacement;
50
+ //# sourceMappingURL=parallaxMath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallaxMath.d.ts","sourceRoot":"","sources":["../../../src/parallax/parallaxMath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,MAAM,CAEjF;AAED,6GAA6G;AAC7G,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED,mHAAmH;AACnH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAEjH;AAED,8GAA8G;AAC9G,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,+GAA+G;IAC/G,IAAI,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,mGAAmG;IACnG,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,mHAAmH;IACnH,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,GAAG,aAAa,CAiBzE"}
@@ -0,0 +1,97 @@
1
+ import { ParticleContainer, type Texture } from 'pixi.js';
2
+ import { type CameraLike } from '../fx/viewCull.js';
3
+ import { ParticleBudget } from './ParticleBudget.js';
4
+ import { type ColorCurve, type Curve } from './particleCurves.js';
5
+ import { type Range } from './particleSampling.js';
6
+ /** Where a new particle appears round the emitter: a disc, or a box centred on it. */
7
+ export type SpawnArea = {
8
+ readonly radius: number;
9
+ } | {
10
+ readonly width: number;
11
+ readonly height: number;
12
+ };
13
+ export interface EmitterOptions {
14
+ /** Every particle's texture. One emitter draws one texture (a frame of an atlas works: they share a source). */
15
+ texture: Texture;
16
+ /** Particles this emitter may hold at once (default 256). */
17
+ capacity?: number;
18
+ /** Particles a second while emitting (default 0: bursts only). */
19
+ rate?: number;
20
+ /** Seconds a particle lives (default 1). */
21
+ lifetime?: Range;
22
+ /** Starting speed, px/s (default [40, 80]). */
23
+ speed?: Range;
24
+ /** Direction of travel in radians (default -π/2, up the screen) and how far either way it may turn (default π). */
25
+ angle?: number;
26
+ spread?: number;
27
+ /** Px/s² added to velocity (default none). */
28
+ gravityX?: number;
29
+ gravityY?: number;
30
+ /** Share of speed lost per second (default 0). */
31
+ drag?: number;
32
+ /** Scale of the texture over life (default 1), and how much each particle's size may differ (0–1, default 0). */
33
+ size?: Curve;
34
+ sizeVariance?: number;
35
+ /** Opacity over life (default fading from 1 to 0). */
36
+ alpha?: Curve;
37
+ /** Tint over life, `0xrrggbb` (default white). */
38
+ tint?: ColorCurve;
39
+ /** Starting rotation and spin, radians and radians/s (default 0). */
40
+ rotation?: Range;
41
+ spin?: Range;
42
+ /** 'add' for glows, sparks and fire; 'normal' for smoke and debris (default 'normal'). */
43
+ blend?: 'normal' | 'add';
44
+ /** Where particles appear round the emitter (default its exact point). */
45
+ area?: SpawnArea;
46
+ /** World px beyond the screen within which the emitter still spawns and draws (default 64). */
47
+ cullMargin?: number;
48
+ /** Share of particles kept under reduced effects or the battery saver (default 0.35). */
49
+ thinFactor?: number;
50
+ /** The budget shared with other emitters (default the engine-wide `particleBudget`). */
51
+ budget?: ParticleBudget;
52
+ /** Random source (default `Math.random`); a seeded one makes an emitter replayable. */
53
+ random?: () => number;
54
+ }
55
+ /**
56
+ * A source of smooth sprite particles for any art style: sparks, smoke, dust, magic. Particles live in world
57
+ * coordinates, so moving the emitter (`x`, `y`) trails new ones behind it instead of dragging the old ones along.
58
+ *
59
+ * Drawn by one Pixi `ParticleContainer` (`view`): add it to a scene's `root`, and call `update(dt, camera)` once a
60
+ * frame. Particle objects are pooled and their colour is written straight into Pixi's packed field, so a steady
61
+ * emitter allocates nothing per frame. Spawning asks the shared `ParticleBudget` first, and off-screen emitters
62
+ * neither spawn nor draw.
63
+ */
64
+ export declare class Emitter {
65
+ readonly view: ParticleContainer;
66
+ x: number;
67
+ y: number;
68
+ /** Continuous emission on or off (bursts work either way). */
69
+ emitting: boolean;
70
+ private readonly sim;
71
+ private readonly pool;
72
+ private readonly budget;
73
+ private readonly random;
74
+ private readonly opts;
75
+ private carry;
76
+ private destroyed;
77
+ /** Set by the last `update`: whether the emitter's point was near the screen. */
78
+ private near;
79
+ constructor(options: EmitterOptions);
80
+ /** Particles alive now. */
81
+ get live(): number;
82
+ setPosition(x: number, y: number): this;
83
+ start(): this;
84
+ /** Stops emitting; the particles in the air live out their lives. */
85
+ stop(): this;
86
+ /** `count` particles at once, at the emitter or at (x, y). Thinned under reduced effects; skipped off screen. */
87
+ burst(count: number, x?: number, y?: number): void;
88
+ /** Advances by `dt` seconds. Pass the camera to skip spawning and drawing while everything is off screen. */
89
+ update(dt: number, camera?: CameraLike): void;
90
+ /** Every particle gone at once (a scene change, a cancelled effect). */
91
+ clear(): void;
92
+ destroy(): void;
93
+ private thin;
94
+ private emit;
95
+ private draw;
96
+ }
97
+ //# sourceMappingURL=Emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Emitter.d.ts","sourceRoot":"","sources":["../../../src/particles/Emitter.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Particles alive across every emitter that shares this budget. An emitter asks before it spawns and gives back as
3
+ * its particles die, so a crowd of emitters at once costs no more than `limit`: ten explosions in one frame share the
4
+ * budget instead of adding up to a frame the GPU cannot finish. Under reduced effects or the battery saver the limit
5
+ * shrinks by `thinFactor`.
6
+ */
7
+ export declare class ParticleBudget {
8
+ /** Particles alive at once, for every emitter together. */
9
+ limit: number;
10
+ /** The share of `limit` left under reduced effects or the battery saver. */
11
+ thinFactor: number;
12
+ private used;
13
+ constructor(
14
+ /** Particles alive at once, for every emitter together. */
15
+ limit?: number,
16
+ /** The share of `limit` left under reduced effects or the battery saver. */
17
+ thinFactor?: number);
18
+ /** The limit as the settings stand now. */
19
+ get effectiveLimit(): number;
20
+ get live(): number;
21
+ /** Reserves up to `n` particles and returns how many were granted (0 when the budget is spent). */
22
+ take(n: number): number;
23
+ /** Returns `n` particles that died or were cleared. */
24
+ give(n: number): void;
25
+ }
26
+ /** The budget every emitter shares unless it is handed its own. */
27
+ export declare const particleBudget: ParticleBudget;
28
+ //# sourceMappingURL=ParticleBudget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleBudget.d.ts","sourceRoot":"","sources":["../../../src/particles/ParticleBudget.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,qBAAa,cAAc;IAIvB,2DAA2D;IACpD,KAAK;IACZ,4EAA4E;IACrE,UAAU;IANnB,OAAO,CAAC,IAAI,CAAK;;IAGf,2DAA2D;IACpD,KAAK,SAAO;IACnB,4EAA4E;IACrE,UAAU,SAAO;IAG1B,2CAA2C;IAC3C,IAAI,cAAc,IAAI,MAAM,CAG3B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,mGAAmG;IACnG,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAMvB,uDAAuD;IACvD,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;CAGtB;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The particles of one emitter as flat typed arrays (structure of arrays): position, velocity, age and lifetime,
3
+ * rotation and spin, and a per-particle random draw the curves can use. Pure, no Pixi: the emitter draws what this
4
+ * holds, and tests step it under node.
5
+ *
6
+ * Live particles are packed at indices `0 … count - 1`. A particle that dies is replaced by the last live one, so a
7
+ * step never leaves holes and never allocates; the order of particles is therefore not stable, which drawing does
8
+ * not need (every live index is written again each frame).
9
+ */
10
+ export declare class ParticleSim {
11
+ readonly capacity: number;
12
+ readonly x: Float32Array;
13
+ readonly y: Float32Array;
14
+ readonly vx: Float32Array;
15
+ readonly vy: Float32Array;
16
+ readonly age: Float32Array;
17
+ readonly life: Float32Array;
18
+ readonly rot: Float32Array;
19
+ readonly spin: Float32Array;
20
+ /** A random draw per particle (0–1), fixed for its life: size variance, flicker phase. */
21
+ readonly seed: Float32Array;
22
+ count: number;
23
+ constructor(capacity: number);
24
+ /** Adds a particle; returns its index, or -1 when the sim is full. `life` is in seconds. */
25
+ spawn(x: number, y: number, vx: number, vy: number, life: number, rot: number, spin: number, seed: number): number;
26
+ /**
27
+ * Advances every particle by `dt` seconds: gravity (px/s²) added to velocity, then drag, then position. Drag is
28
+ * the share of speed lost per second, applied as `exp(-drag × dt)` so it is the same at any frame rate. Returns how
29
+ * many particles died this step.
30
+ */
31
+ step(dt: number, gravityX: number, gravityY: number, drag: number): number;
32
+ /** The share of its life particle `i` has lived (0–1). */
33
+ progress(i: number): number;
34
+ /** Every particle gone; returns how many there were. */
35
+ clear(): number;
36
+ private removeAt;
37
+ }
38
+ //# sourceMappingURL=ParticleSim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleSim.d.ts","sourceRoot":"","sources":["../../../src/particles/ParticleSim.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,WAAW;IAaV,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAZrC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC;IACzB,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,KAAK,SAAK;gBAEW,QAAQ,EAAE,MAAM;IAYrC,4FAA4F;IAC5F,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAelH;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAwB1E,0DAA0D;IAC1D,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI3B,wDAAwD;IACxD,KAAK,IAAI,MAAM;IAMf,OAAO,CAAC,QAAQ;CAajB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Values that change over a particle's life, sampled at `t` from 0 (born) to 1 (gone). A curve is one of:
3
+ *
4
+ * - a number: the same the whole life;
5
+ * - `{ start, end }`: a straight line between the two;
6
+ * - keyframes `[[t, value], …]` sorted by `t`: straight lines between them, held flat before the first and after
7
+ * the last (a puff that swells fast then fades slowly is three keys, not a custom function).
8
+ *
9
+ * Pure and allocation-free: an emitter samples three curves per particle per frame.
10
+ */
11
+ export type Curve = number | {
12
+ readonly start: number;
13
+ readonly end: number;
14
+ } | readonly (readonly [t: number, value: number])[];
15
+ /** The same three shapes for colours (`0xrrggbb`), blended channel by channel. */
16
+ export type ColorCurve = Curve;
17
+ export declare function sampleCurve(curve: Curve, t: number): number;
18
+ export declare function sampleColor(curve: ColorCurve, t: number): number;
19
+ /** Two `0xrrggbb` colours mixed per channel, each channel rounded to a whole value. */
20
+ export declare function lerpColor(a: number, b: number, t: number): number;
21
+ //# sourceMappingURL=particleCurves.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleCurves.d.ts","sourceRoot":"","sources":["../../../src/particles/particleCurves.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;AAEjI,kFAAkF;AAClF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC;AAE/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB3D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBhE;AAED,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMjE"}
@@ -0,0 +1,20 @@
1
+ /** A number picked at random between two (inclusive of the first), or a fixed one. */
2
+ export type Range = number | readonly [min: number, max: number];
3
+ /** A value of `range` for one random draw `r` in [0, 1). */
4
+ export declare function sampleRange(range: Range, r: number): number;
5
+ /** `base` turned by up to `spread` either way: `r` 0 gives `base - spread`, 0.5 gives `base`. */
6
+ export declare function spreadAngle(base: number, spread: number, r: number): number;
7
+ /**
8
+ * Whole particles due after `dt` seconds at `rate` a second, given the fraction `carry` left over from before. Kept
9
+ * as a fraction rather than rounded each frame, or 30 a second at 144 fps (0.21 a frame) would emit none at all.
10
+ * Returns the count in the integer part and the new carry in the fraction: `n = Math.floor(v)`, `carry = v - n`.
11
+ */
12
+ export declare function dueParticles(rate: number, dt: number, carry: number): number;
13
+ /**
14
+ * `n` scaled by `factor` (reduced effects), rounded at random so a burst of 3 at 0.35 still gives one particle about
15
+ * every time rather than never: the expected count stays `n × factor`.
16
+ */
17
+ export declare function scaleCount(n: number, factor: number, r: number): number;
18
+ /** A small seedable generator (mulberry32) for tests and replays; the emitter takes any `() => number`. */
19
+ export declare function seededRandom(seed: number): () => number;
20
+ //# sourceMappingURL=particleSampling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleSampling.d.ts","sourceRoot":"","sources":["../../../src/particles/particleSampling.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAEjE,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,iGAAiG;AACjG,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,MAAM,CASvD"}
@@ -0,0 +1,130 @@
1
+ import type { BodyOptions, BodyType, Shape } from './types.js';
2
+ /**
3
+ * A rigid body: plain data and a few helpers, no drawing. Positions are the shape's centre in world pixels, y down;
4
+ * velocities are px per second. Create bodies with `PhysicsWorld.add`, which also wakes them and puts them in the
5
+ * broad phase.
6
+ */
7
+ export declare class Body {
8
+ readonly id: number;
9
+ readonly type: BodyType;
10
+ shape: Shape;
11
+ x: number;
12
+ y: number;
13
+ /** Position at the start of the last world step: draw at `prev + (current - prev) × alpha`. */
14
+ prevX: number;
15
+ prevY: number;
16
+ vx: number;
17
+ vy: number;
18
+ /** Radians, clockwise on screen. */
19
+ angle: number;
20
+ /** Angle at the start of the last world step, for drawing between steps like `prevX`. */
21
+ prevAngle: number;
22
+ /** Radians per second. */
23
+ angularVelocity: number;
24
+ /** Contacts and torques turn it (`BodyOptions.rotates`). */
25
+ readonly rotates: boolean;
26
+ /** Turning lost per second, as a share. */
27
+ angularDamping: number;
28
+ /** Torque gathered for the next step, cleared after it. */
29
+ torque: number;
30
+ /** Moment of inertia about the centre (mass × px²); infinite for a body that does not rotate. */
31
+ readonly inertia: number;
32
+ readonly invInertia: number;
33
+ /** Force gathered for the next step (px·mass/s²), cleared after it. */
34
+ fx: number;
35
+ fy: number;
36
+ readonly mass: number;
37
+ readonly invMass: number;
38
+ restitution: number;
39
+ friction: number;
40
+ linearDamping: number;
41
+ gravityScale: number;
42
+ readonly sensor: boolean;
43
+ layer: number;
44
+ mask: number;
45
+ userData: unknown;
46
+ /** Box faces lying against more solid ground (`FACE_*` bits): never a contact normal, so seams do not snag. */
47
+ internalFaces: number;
48
+ /** A sleeping body is not integrated and is treated as immovable until something wakes it. */
49
+ awake: boolean;
50
+ /** Seconds spent below the world's sleep speed. */
51
+ restTime: number;
52
+ /** Standing on something: a solid contact whose normal points up at this body (refreshed every step). */
53
+ grounded: boolean;
54
+ /** What it stands on, while grounded. */
55
+ ground: Body | null;
56
+ groundNx: number;
57
+ groundNy: number;
58
+ minX: number;
59
+ minY: number;
60
+ maxX: number;
61
+ maxY: number;
62
+ /** @internal cosine and sine of `angle`, refreshed by `updateBounds`. */
63
+ cos: number;
64
+ sin: number;
65
+ /** @internal corners and outward face normals in world space (boxes and polygons), refreshed by `updateBounds`. */
66
+ readonly wx: Float64Array<ArrayBuffer>;
67
+ readonly wy: Float64Array<ArrayBuffer>;
68
+ readonly wnx: Float64Array<ArrayBuffer>;
69
+ readonly wny: Float64Array<ArrayBuffer>;
70
+ /** @internal how many of the above are in use (0 for a circle). */
71
+ corners: number;
72
+ /** @internal set by the world that holds it. */
73
+ inWorld: boolean;
74
+ /** @internal last ray that tested this body, so a ray crossing many cells tests it once. */
75
+ rayStamp: number;
76
+ constructor(options: BodyOptions);
77
+ get isDynamic(): boolean;
78
+ get isStatic(): boolean;
79
+ /** Moves by itself this step: an awake dynamic body or any kinematic one. */
80
+ get moving(): boolean;
81
+ /** Inverse mass as the solver sees it: a sleeping body holds still like ground. */
82
+ get solverInvMass(): number;
83
+ /** The smallest half size of the shape: how far it may move in one sub-step without passing through anything. */
84
+ get minHalfExtent(): number;
85
+ /** The furthest the shape reaches from the centre: how far a corner sweeps as the body turns. */
86
+ get maxExtent(): number;
87
+ /** A box at no angle: the cheap axis-aligned tests apply to it. */
88
+ get axisAligned(): boolean;
89
+ updateBounds(): void;
90
+ /** Box corners in local space (top, right, bottom, left faces), or in world space when the box sits at no angle. */
91
+ private setBoxCorners;
92
+ wake(): void;
93
+ setVelocity(vx: number, vy: number): void;
94
+ /**
95
+ * An instant change of momentum (a jump, a hit): velocity changes by `impulse / mass`. Given a world point
96
+ * (`px`, `py`) off the centre, a body that rotates is also set turning.
97
+ */
98
+ applyImpulse(ix: number, iy: number, px?: number, py?: number): void;
99
+ /** A force held for the next step (thrust, wind); it is cleared once the step has used it. At a world point, it also turns the body. */
100
+ applyForce(fx: number, fy: number, px?: number, py?: number): void;
101
+ /** A turning force held for the next step (mass × px² / s², clockwise on screen when positive). */
102
+ applyTorque(torque: number): void;
103
+ /** An instant change of spin: angular velocity changes by `impulse / inertia`. */
104
+ applyAngularImpulse(impulse: number): void;
105
+ /** Sets the spin (a kinematic body turns at it; a dynamic one that rotates starts at it). */
106
+ setAngularVelocity(w: number): void;
107
+ /** Velocity of the body's material at a world point: its own plus what its spin adds there. */
108
+ velocityAt(px: number, py: number): {
109
+ x: number;
110
+ y: number;
111
+ };
112
+ /**
113
+ * Puts the body somewhere without sweeping it there; the drawn position jumps too (no interpolation across it).
114
+ * A static body moved this way must be followed by `PhysicsWorld.staticsChanged()`.
115
+ */
116
+ setPosition(x: number, y: number, angle?: number): void;
117
+ /** Turns the body to `angle` without sweeping it there (like `setPosition`). */
118
+ setAngle(angle: number): void;
119
+ /** A world point in the body's own frame (before its turn). */
120
+ toLocal(px: number, py: number): {
121
+ x: number;
122
+ y: number;
123
+ };
124
+ /** A point of the body's own frame in the world. */
125
+ toWorld(lx: number, ly: number): {
126
+ x: number;
127
+ y: number;
128
+ };
129
+ }
130
+ //# sourceMappingURL=Body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/physics/Body.ts"],"names":[],"mappings":"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"}