@zylem/game-lib 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/README.md +23 -41
  2. package/dist/actions.d.ts +25 -0
  3. package/dist/actions.js +287 -8
  4. package/dist/actions.js.map +1 -0
  5. package/dist/behaviors.d.ts +108 -0
  6. package/dist/behaviors.js +396 -6
  7. package/dist/behaviors.js.map +1 -0
  8. package/dist/{src/lib/camera/zylem-camera.d.ts → camera-Dk-fOVZE.d.ts} +55 -8
  9. package/dist/camera.d.ts +5 -0
  10. package/dist/camera.js +504 -4
  11. package/dist/camera.js.map +1 -0
  12. package/dist/core-C2mjetAd.d.ts +431 -0
  13. package/dist/core.d.ts +9 -0
  14. package/dist/core.js +4780 -9
  15. package/dist/core.js.map +1 -0
  16. package/dist/entities.d.ts +269 -0
  17. package/dist/entities.js +2161 -17
  18. package/dist/entities.js.map +1 -0
  19. package/dist/entity-bQElAdpo.d.ts +347 -0
  20. package/dist/entity-spawner-DNnLYnZq.d.ts +11 -0
  21. package/dist/main.d.ts +135 -0
  22. package/dist/main.js +6599 -56
  23. package/dist/main.js.map +1 -0
  24. package/dist/moveable-B_vyA6cw.d.ts +67 -0
  25. package/dist/stage-CrmY7V0i.d.ts +287 -0
  26. package/dist/stage.d.ts +26 -0
  27. package/dist/stage.js +2229 -4
  28. package/dist/stage.js.map +1 -0
  29. package/dist/transformable-CUhvyuYO.d.ts +67 -0
  30. package/package.json +9 -45
  31. package/LICENSE +0 -21
  32. package/dist/.vite/manifest.json +0 -716
  33. package/dist/assets/zylem-logo.png +0 -0
  34. package/dist/examples/00-readme-example.d.ts +0 -2
  35. package/dist/examples/00-readme-example.d.ts.map +0 -1
  36. package/dist/examples/01-basic.d.ts +0 -2
  37. package/dist/examples/01-basic.d.ts.map +0 -1
  38. package/dist/examples/01.1-basic-ball.d.ts +0 -9
  39. package/dist/examples/01.1-basic-ball.d.ts.map +0 -1
  40. package/dist/examples/01.2-ricochet-test.d.ts +0 -2
  41. package/dist/examples/01.2-ricochet-test.d.ts.map +0 -1
  42. package/dist/examples/01.3-rect.d.ts +0 -2
  43. package/dist/examples/01.3-rect.d.ts.map +0 -1
  44. package/dist/examples/02-input.d.ts +0 -2
  45. package/dist/examples/02-input.d.ts.map +0 -1
  46. package/dist/examples/03-stage-test/03-stage-test.d.ts +0 -2
  47. package/dist/examples/03-stage-test/03-stage-test.d.ts.map +0 -1
  48. package/dist/examples/03-stage-test/stage0.d.ts +0 -2
  49. package/dist/examples/03-stage-test/stage0.d.ts.map +0 -1
  50. package/dist/examples/03-stage-test/stage1.d.ts +0 -2
  51. package/dist/examples/03-stage-test/stage1.d.ts.map +0 -1
  52. package/dist/examples/03-stage-test/stage2.d.ts +0 -2
  53. package/dist/examples/03-stage-test/stage2.d.ts.map +0 -1
  54. package/dist/examples/03-stage-test/stage3.d.ts +0 -2
  55. package/dist/examples/03-stage-test/stage3.d.ts.map +0 -1
  56. package/dist/examples/03.1-stage-variable.d.ts +0 -2
  57. package/dist/examples/03.1-stage-variable.d.ts.map +0 -1
  58. package/dist/examples/04-vessel-test.d.ts +0 -18
  59. package/dist/examples/04-vessel-test.d.ts.map +0 -1
  60. package/dist/examples/05-camera-test.d.ts +0 -2
  61. package/dist/examples/05-camera-test.d.ts.map +0 -1
  62. package/dist/examples/06-entity-test.d.ts +0 -2
  63. package/dist/examples/06-entity-test.d.ts.map +0 -1
  64. package/dist/examples/07-behaviors.d.ts +0 -2
  65. package/dist/examples/07-behaviors.d.ts.map +0 -1
  66. package/dist/examples/07.01-behavior-context.d.ts +0 -2
  67. package/dist/examples/07.01-behavior-context.d.ts.map +0 -1
  68. package/dist/examples/08-pong.d.ts +0 -2
  69. package/dist/examples/08-pong.d.ts.map +0 -1
  70. package/dist/examples/08.01-breakout.d.ts +0 -2
  71. package/dist/examples/08.01-breakout.d.ts.map +0 -1
  72. package/dist/examples/09-space-invaders.d.ts +0 -2
  73. package/dist/examples/09-space-invaders.d.ts.map +0 -1
  74. package/dist/examples/10-asteroids.d.ts +0 -2
  75. package/dist/examples/10-asteroids.d.ts.map +0 -1
  76. package/dist/examples/11-2d-platformer.d.ts +0 -2
  77. package/dist/examples/11-2d-platformer.d.ts.map +0 -1
  78. package/dist/examples/12-3d-platformer.d.ts +0 -2
  79. package/dist/examples/12-3d-platformer.d.ts.map +0 -1
  80. package/dist/examples/13-fps.d.ts +0 -2
  81. package/dist/examples/13-fps.d.ts.map +0 -1
  82. package/dist/examples/14-strategy.d.ts +0 -2
  83. package/dist/examples/14-strategy.d.ts.map +0 -1
  84. package/dist/examples/15-zylem-planet-demo.d.ts +0 -2
  85. package/dist/examples/15-zylem-planet-demo.d.ts.map +0 -1
  86. package/dist/examples/16-timbotron.d.ts +0 -2
  87. package/dist/examples/16-timbotron.d.ts.map +0 -1
  88. package/dist/examples/17-stress-test.d.ts +0 -2
  89. package/dist/examples/17-stress-test.d.ts.map +0 -1
  90. package/dist/examples/architecture-test.d.ts +0 -2
  91. package/dist/examples/architecture-test.d.ts.map +0 -1
  92. package/dist/examples/utils.d.ts +0 -10
  93. package/dist/examples/utils.d.ts.map +0 -1
  94. package/dist/lib/actions/behaviors/actions.js +0 -35
  95. package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
  96. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
  97. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
  98. package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
  99. package/dist/lib/actions/capabilities/moveable.js +0 -108
  100. package/dist/lib/actions/capabilities/rotatable.js +0 -82
  101. package/dist/lib/actions/capabilities/transformable.js +0 -9
  102. package/dist/lib/actions/global-change.js +0 -40
  103. package/dist/lib/camera/camera.js +0 -19
  104. package/dist/lib/camera/fixed-2d.js +0 -30
  105. package/dist/lib/camera/perspective.js +0 -10
  106. package/dist/lib/camera/third-person.js +0 -42
  107. package/dist/lib/camera/zylem-camera.js +0 -208
  108. package/dist/lib/collision/collision-builder.js +0 -46
  109. package/dist/lib/collision/collision-delegate.js +0 -6
  110. package/dist/lib/collision/utils.js +0 -24
  111. package/dist/lib/collision/world.js +0 -77
  112. package/dist/lib/core/base-node.js +0 -61
  113. package/dist/lib/core/entity-asset-loader.js +0 -54
  114. package/dist/lib/core/lifecycle-base.js +0 -20
  115. package/dist/lib/core/preset-shader.js +0 -26
  116. package/dist/lib/core/three-addons/Timer.js +0 -103
  117. package/dist/lib/core/utility/nodes.js +0 -31
  118. package/dist/lib/core/utility/strings.js +0 -14
  119. package/dist/lib/core/utility/vector.js +0 -8
  120. package/dist/lib/core/vessel.js +0 -26
  121. package/dist/lib/debug/console/console-state.js +0 -11
  122. package/dist/lib/debug/debug-state.js +0 -40
  123. package/dist/lib/device/aspect-ratio.js +0 -44
  124. package/dist/lib/entities/actor.js +0 -122
  125. package/dist/lib/entities/box.js +0 -68
  126. package/dist/lib/entities/builder.js +0 -79
  127. package/dist/lib/entities/create.js +0 -31
  128. package/dist/lib/entities/delegates/animation.js +0 -58
  129. package/dist/lib/entities/delegates/debug.js +0 -71
  130. package/dist/lib/entities/delegates/loader.js +0 -19
  131. package/dist/lib/entities/destroy.js +0 -15
  132. package/dist/lib/entities/entity-factory.js +0 -24
  133. package/dist/lib/entities/entity.js +0 -121
  134. package/dist/lib/entities/plane.js +0 -81
  135. package/dist/lib/entities/rect.js +0 -160
  136. package/dist/lib/entities/sphere.js +0 -68
  137. package/dist/lib/entities/sprite.js +0 -125
  138. package/dist/lib/entities/text.js +0 -140
  139. package/dist/lib/entities/zone.js +0 -103
  140. package/dist/lib/game/game-canvas.js +0 -57
  141. package/dist/lib/game/game-config.js +0 -78
  142. package/dist/lib/game/game-default.js +0 -23
  143. package/dist/lib/game/game-retro-resolutions.js +0 -80
  144. package/dist/lib/game/game-state.js +0 -17
  145. package/dist/lib/game/game.js +0 -131
  146. package/dist/lib/game/zylem-game.js +0 -140
  147. package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
  148. package/dist/lib/graphics/material.js +0 -64
  149. package/dist/lib/graphics/mesh.js +0 -14
  150. package/dist/lib/graphics/render-pass.js +0 -56
  151. package/dist/lib/graphics/shaders/fragment/debug.glsl.js +0 -23
  152. package/dist/lib/graphics/shaders/fragment/fire.glsl.js +0 -52
  153. package/dist/lib/graphics/shaders/fragment/standard.glsl.js +0 -11
  154. package/dist/lib/graphics/shaders/fragment/stars.glsl.js +0 -44
  155. package/dist/lib/graphics/shaders/vertex/debug.glsl.js +0 -15
  156. package/dist/lib/graphics/shaders/vertex/object-shader.glsl.js +0 -11
  157. package/dist/lib/graphics/shaders/vertex/standard.glsl.js +0 -9
  158. package/dist/lib/graphics/zylem-scene.js +0 -75
  159. package/dist/lib/input/gamepad-provider.js +0 -58
  160. package/dist/lib/input/input-manager.js +0 -70
  161. package/dist/lib/input/keyboard-provider.js +0 -120
  162. package/dist/lib/stage/debug-entity-cursor.js +0 -53
  163. package/dist/lib/stage/entity-spawner.js +0 -27
  164. package/dist/lib/stage/stage-debug-delegate.js +0 -100
  165. package/dist/lib/stage/stage-default.js +0 -32
  166. package/dist/lib/stage/stage-factory.js +0 -22
  167. package/dist/lib/stage/stage-manager.js +0 -49
  168. package/dist/lib/stage/stage-state.js +0 -36
  169. package/dist/lib/stage/stage.js +0 -67
  170. package/dist/lib/stage/zylem-stage.js +0 -268
  171. package/dist/lib/systems/transformable.system.js +0 -43
  172. package/dist/node_modules/.pnpm/idb-keyval@6.2.2/node_modules/idb-keyval/dist/index.js +0 -34
  173. package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/pack.js +0 -520
  174. package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/unpack.js +0 -672
  175. package/dist/src/api/actions.d.ts +0 -5
  176. package/dist/src/api/actions.d.ts.map +0 -1
  177. package/dist/src/api/behaviors.d.ts +0 -4
  178. package/dist/src/api/behaviors.d.ts.map +0 -1
  179. package/dist/src/api/camera.d.ts +0 -4
  180. package/dist/src/api/camera.d.ts.map +0 -1
  181. package/dist/src/api/core.d.ts +0 -6
  182. package/dist/src/api/core.d.ts.map +0 -1
  183. package/dist/src/api/entities.d.ts +0 -9
  184. package/dist/src/api/entities.d.ts.map +0 -1
  185. package/dist/src/api/main.d.ts +0 -32
  186. package/dist/src/api/main.d.ts.map +0 -1
  187. package/dist/src/api/stage.d.ts +0 -5
  188. package/dist/src/api/stage.d.ts.map +0 -1
  189. package/dist/src/lib/actions/behaviors/actions.d.ts +0 -11
  190. package/dist/src/lib/actions/behaviors/actions.d.ts.map +0 -1
  191. package/dist/src/lib/actions/behaviors/behavior.d.ts +0 -6
  192. package/dist/src/lib/actions/behaviors/behavior.d.ts.map +0 -1
  193. package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
  194. package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
  195. package/dist/src/lib/actions/behaviors/character-controller.d.ts +0 -6
  196. package/dist/src/lib/actions/behaviors/character-controller.d.ts.map +0 -1
  197. package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
  198. package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
  199. package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
  200. package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
  201. package/dist/src/lib/actions/behaviors/debug/debug.d.ts +0 -10
  202. package/dist/src/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
  203. package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
  204. package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
  205. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
  206. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
  207. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
  208. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
  209. package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
  210. package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
  211. package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
  212. package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
  213. package/dist/src/lib/actions/capabilities/moveable.d.ts +0 -125
  214. package/dist/src/lib/actions/capabilities/moveable.d.ts.map +0 -1
  215. package/dist/src/lib/actions/capabilities/rotatable.d.ts +0 -111
  216. package/dist/src/lib/actions/capabilities/rotatable.d.ts.map +0 -1
  217. package/dist/src/lib/actions/capabilities/transformable.d.ts +0 -7
  218. package/dist/src/lib/actions/capabilities/transformable.d.ts.map +0 -1
  219. package/dist/src/lib/actions/global-change.d.ts +0 -23
  220. package/dist/src/lib/actions/global-change.d.ts.map +0 -1
  221. package/dist/src/lib/camera/camera.d.ts +0 -16
  222. package/dist/src/lib/camera/camera.d.ts.map +0 -1
  223. package/dist/src/lib/camera/fixed-2d.d.ts +0 -32
  224. package/dist/src/lib/camera/fixed-2d.d.ts.map +0 -1
  225. package/dist/src/lib/camera/perspective.d.ts +0 -9
  226. package/dist/src/lib/camera/perspective.d.ts.map +0 -1
  227. package/dist/src/lib/camera/third-person.d.ts +0 -32
  228. package/dist/src/lib/camera/third-person.d.ts.map +0 -1
  229. package/dist/src/lib/camera/zylem-camera.d.ts.map +0 -1
  230. package/dist/src/lib/collision/collision-builder.d.ts +0 -17
  231. package/dist/src/lib/collision/collision-builder.d.ts.map +0 -1
  232. package/dist/src/lib/collision/collision-delegate.d.ts +0 -6
  233. package/dist/src/lib/collision/collision-delegate.d.ts.map +0 -1
  234. package/dist/src/lib/collision/collision-group.d.ts +0 -11
  235. package/dist/src/lib/collision/collision-group.d.ts.map +0 -1
  236. package/dist/src/lib/collision/collision-mask.d.ts +0 -18
  237. package/dist/src/lib/collision/collision-mask.d.ts.map +0 -1
  238. package/dist/src/lib/collision/collision.d.ts +0 -19
  239. package/dist/src/lib/collision/collision.d.ts.map +0 -1
  240. package/dist/src/lib/collision/utils.d.ts +0 -15
  241. package/dist/src/lib/collision/utils.d.ts.map +0 -1
  242. package/dist/src/lib/collision/world.d.ts +0 -23
  243. package/dist/src/lib/collision/world.d.ts.map +0 -1
  244. package/dist/src/lib/core/asset-manager.d.ts +0 -2
  245. package/dist/src/lib/core/asset-manager.d.ts.map +0 -1
  246. package/dist/src/lib/core/base-node-life-cycle.d.ts +0 -54
  247. package/dist/src/lib/core/base-node-life-cycle.d.ts.map +0 -1
  248. package/dist/src/lib/core/base-node.d.ts +0 -36
  249. package/dist/src/lib/core/base-node.d.ts.map +0 -1
  250. package/dist/src/lib/core/blueprints.d.ts +0 -22
  251. package/dist/src/lib/core/blueprints.d.ts.map +0 -1
  252. package/dist/src/lib/core/entity-asset-loader.d.ts +0 -16
  253. package/dist/src/lib/core/entity-asset-loader.d.ts.map +0 -1
  254. package/dist/src/lib/core/errors.d.ts +0 -5
  255. package/dist/src/lib/core/errors.d.ts.map +0 -1
  256. package/dist/src/lib/core/flags.d.ts +0 -3
  257. package/dist/src/lib/core/flags.d.ts.map +0 -1
  258. package/dist/src/lib/core/index.d.ts +0 -5
  259. package/dist/src/lib/core/index.d.ts.map +0 -1
  260. package/dist/src/lib/core/interfaces.d.ts +0 -25
  261. package/dist/src/lib/core/interfaces.d.ts.map +0 -1
  262. package/dist/src/lib/core/lazy-loader.d.ts +0 -80
  263. package/dist/src/lib/core/lazy-loader.d.ts.map +0 -1
  264. package/dist/src/lib/core/lifecycle-base.d.ts +0 -17
  265. package/dist/src/lib/core/lifecycle-base.d.ts.map +0 -1
  266. package/dist/src/lib/core/node-interface.d.ts +0 -12
  267. package/dist/src/lib/core/node-interface.d.ts.map +0 -1
  268. package/dist/src/lib/core/preset-shader.d.ts +0 -8
  269. package/dist/src/lib/core/preset-shader.d.ts.map +0 -1
  270. package/dist/src/lib/core/three-addons/Timer.d.ts +0 -92
  271. package/dist/src/lib/core/three-addons/Timer.d.ts.map +0 -1
  272. package/dist/src/lib/core/utility/nodes.d.ts +0 -13
  273. package/dist/src/lib/core/utility/nodes.d.ts.map +0 -1
  274. package/dist/src/lib/core/utility/strings.d.ts +0 -3
  275. package/dist/src/lib/core/utility/strings.d.ts.map +0 -1
  276. package/dist/src/lib/core/utility/vector.d.ts +0 -8
  277. package/dist/src/lib/core/utility/vector.d.ts.map +0 -1
  278. package/dist/src/lib/core/vector.d.ts +0 -4
  279. package/dist/src/lib/core/vector.d.ts.map +0 -1
  280. package/dist/src/lib/core/vessel.d.ts +0 -13
  281. package/dist/src/lib/core/vessel.d.ts.map +0 -1
  282. package/dist/src/lib/debug/console/console-state.d.ts +0 -20
  283. package/dist/src/lib/debug/console/console-state.d.ts.map +0 -1
  284. package/dist/src/lib/debug/console/console-store.d.ts +0 -6
  285. package/dist/src/lib/debug/console/console-store.d.ts.map +0 -1
  286. package/dist/src/lib/debug/debug-state.d.ts +0 -38
  287. package/dist/src/lib/debug/debug-state.d.ts.map +0 -1
  288. package/dist/src/lib/debug/debug-store.d.ts +0 -15
  289. package/dist/src/lib/debug/debug-store.d.ts.map +0 -1
  290. package/dist/src/lib/debug/state-based-debug-loader.d.ts +0 -8
  291. package/dist/src/lib/debug/state-based-debug-loader.d.ts.map +0 -1
  292. package/dist/src/lib/device/aspect-ratio.d.ts +0 -38
  293. package/dist/src/lib/device/aspect-ratio.d.ts.map +0 -1
  294. package/dist/src/lib/device/desktop.d.ts +0 -2
  295. package/dist/src/lib/device/desktop.d.ts.map +0 -1
  296. package/dist/src/lib/device/mobile.d.ts +0 -2
  297. package/dist/src/lib/device/mobile.d.ts.map +0 -1
  298. package/dist/src/lib/device/tablet.d.ts +0 -2
  299. package/dist/src/lib/device/tablet.d.ts.map +0 -1
  300. package/dist/src/lib/entities/actor.d.ts +0 -44
  301. package/dist/src/lib/entities/actor.d.ts.map +0 -1
  302. package/dist/src/lib/entities/box.d.ts +0 -27
  303. package/dist/src/lib/entities/box.d.ts.map +0 -1
  304. package/dist/src/lib/entities/builder.d.ts +0 -28
  305. package/dist/src/lib/entities/builder.d.ts.map +0 -1
  306. package/dist/src/lib/entities/create.d.ts +0 -15
  307. package/dist/src/lib/entities/create.d.ts.map +0 -1
  308. package/dist/src/lib/entities/delegates/animation.d.ts +0 -33
  309. package/dist/src/lib/entities/delegates/animation.d.ts.map +0 -1
  310. package/dist/src/lib/entities/delegates/debug.d.ts +0 -29
  311. package/dist/src/lib/entities/delegates/debug.d.ts.map +0 -1
  312. package/dist/src/lib/entities/delegates/loader.d.ts +0 -12
  313. package/dist/src/lib/entities/delegates/loader.d.ts.map +0 -1
  314. package/dist/src/lib/entities/destroy.d.ts +0 -4
  315. package/dist/src/lib/entities/destroy.d.ts.map +0 -1
  316. package/dist/src/lib/entities/entity-factory.d.ts +0 -10
  317. package/dist/src/lib/entities/entity-factory.d.ts.map +0 -1
  318. package/dist/src/lib/entities/entity.d.ts +0 -98
  319. package/dist/src/lib/entities/entity.d.ts.map +0 -1
  320. package/dist/src/lib/entities/index.d.ts +0 -12
  321. package/dist/src/lib/entities/index.d.ts.map +0 -1
  322. package/dist/src/lib/entities/plane.d.ts +0 -36
  323. package/dist/src/lib/entities/plane.d.ts.map +0 -1
  324. package/dist/src/lib/entities/rect.d.ts +0 -63
  325. package/dist/src/lib/entities/rect.d.ts.map +0 -1
  326. package/dist/src/lib/entities/sphere.d.ts +0 -29
  327. package/dist/src/lib/entities/sphere.d.ts.map +0 -1
  328. package/dist/src/lib/entities/sprite.d.ts +0 -54
  329. package/dist/src/lib/entities/sprite.d.ts.map +0 -1
  330. package/dist/src/lib/entities/text.d.ts +0 -49
  331. package/dist/src/lib/entities/text.d.ts.map +0 -1
  332. package/dist/src/lib/entities/zone.d.ts +0 -54
  333. package/dist/src/lib/entities/zone.d.ts.map +0 -1
  334. package/dist/src/lib/game/game-blueprint.d.ts +0 -38
  335. package/dist/src/lib/game/game-blueprint.d.ts.map +0 -1
  336. package/dist/src/lib/game/game-canvas.d.ts +0 -35
  337. package/dist/src/lib/game/game-canvas.d.ts.map +0 -1
  338. package/dist/src/lib/game/game-config.d.ts +0 -59
  339. package/dist/src/lib/game/game-config.d.ts.map +0 -1
  340. package/dist/src/lib/game/game-default.d.ts +0 -14
  341. package/dist/src/lib/game/game-default.d.ts.map +0 -1
  342. package/dist/src/lib/game/game-interfaces.d.ts +0 -29
  343. package/dist/src/lib/game/game-interfaces.d.ts.map +0 -1
  344. package/dist/src/lib/game/game-retro-resolutions.d.ts +0 -25
  345. package/dist/src/lib/game/game-retro-resolutions.d.ts.map +0 -1
  346. package/dist/src/lib/game/game-state.d.ts +0 -11
  347. package/dist/src/lib/game/game-state.d.ts.map +0 -1
  348. package/dist/src/lib/game/game.d.ts +0 -39
  349. package/dist/src/lib/game/game.d.ts.map +0 -1
  350. package/dist/src/lib/game/zylem-game.d.ts +0 -58
  351. package/dist/src/lib/game/zylem-game.d.ts.map +0 -1
  352. package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
  353. package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
  354. package/dist/src/lib/graphics/material.d.ts +0 -29
  355. package/dist/src/lib/graphics/material.d.ts.map +0 -1
  356. package/dist/src/lib/graphics/mesh.d.ts +0 -19
  357. package/dist/src/lib/graphics/mesh.d.ts.map +0 -1
  358. package/dist/src/lib/graphics/render-pass.d.ts +0 -17
  359. package/dist/src/lib/graphics/render-pass.d.ts.map +0 -1
  360. package/dist/src/lib/graphics/zylem-scene.d.ts +0 -50
  361. package/dist/src/lib/graphics/zylem-scene.d.ts.map +0 -1
  362. package/dist/src/lib/input/gamepad-provider.d.ts +0 -14
  363. package/dist/src/lib/input/gamepad-provider.d.ts.map +0 -1
  364. package/dist/src/lib/input/input-manager.d.ts +0 -15
  365. package/dist/src/lib/input/input-manager.d.ts.map +0 -1
  366. package/dist/src/lib/input/input-provider.d.ts +0 -7
  367. package/dist/src/lib/input/input-provider.d.ts.map +0 -1
  368. package/dist/src/lib/input/input.d.ts +0 -48
  369. package/dist/src/lib/input/input.d.ts.map +0 -1
  370. package/dist/src/lib/input/keyboard-provider.d.ts +0 -21
  371. package/dist/src/lib/input/keyboard-provider.d.ts.map +0 -1
  372. package/dist/src/lib/interfaces/entity.d.ts +0 -26
  373. package/dist/src/lib/interfaces/entity.d.ts.map +0 -1
  374. package/dist/src/lib/sounds/index.d.ts +0 -3
  375. package/dist/src/lib/sounds/index.d.ts.map +0 -1
  376. package/dist/src/lib/sounds/ping-pong-sound.d.ts +0 -5
  377. package/dist/src/lib/sounds/ping-pong-sound.d.ts.map +0 -1
  378. package/dist/src/lib/sounds/ricochet-sound.d.ts +0 -5
  379. package/dist/src/lib/sounds/ricochet-sound.d.ts.map +0 -1
  380. package/dist/src/lib/stage/debug-entity-cursor.d.ts +0 -24
  381. package/dist/src/lib/stage/debug-entity-cursor.d.ts.map +0 -1
  382. package/dist/src/lib/stage/entity-spawner.d.ts +0 -9
  383. package/dist/src/lib/stage/entity-spawner.d.ts.map +0 -1
  384. package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
  385. package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
  386. package/dist/src/lib/stage/stage-debug-delegate.d.ts +0 -26
  387. package/dist/src/lib/stage/stage-debug-delegate.d.ts.map +0 -1
  388. package/dist/src/lib/stage/stage-default.d.ts +0 -3
  389. package/dist/src/lib/stage/stage-default.d.ts.map +0 -1
  390. package/dist/src/lib/stage/stage-factory.d.ts +0 -6
  391. package/dist/src/lib/stage/stage-factory.d.ts.map +0 -1
  392. package/dist/src/lib/stage/stage-manager.d.ts +0 -30
  393. package/dist/src/lib/stage/stage-manager.d.ts.map +0 -1
  394. package/dist/src/lib/stage/stage-state.d.ts +0 -14
  395. package/dist/src/lib/stage/stage-state.d.ts.map +0 -1
  396. package/dist/src/lib/stage/stage.d.ts +0 -35
  397. package/dist/src/lib/stage/stage.d.ts.map +0 -1
  398. package/dist/src/lib/stage/zylem-stage.d.ts +0 -128
  399. package/dist/src/lib/stage/zylem-stage.d.ts.map +0 -1
  400. package/dist/src/lib/systems/test-system.d.ts +0 -2
  401. package/dist/src/lib/systems/test-system.d.ts.map +0 -1
  402. package/dist/src/lib/systems/transformable.system.d.ts +0 -25
  403. package/dist/src/lib/systems/transformable.system.d.ts.map +0 -1
  404. package/dist/src/lib/types/entity-types.d.ts +0 -24
  405. package/dist/src/lib/types/entity-types.d.ts.map +0 -1
  406. package/dist/src/lib/types/index.d.ts +0 -3
  407. package/dist/src/lib/types/index.d.ts.map +0 -1
  408. package/dist/src/lib/types/stage-types.d.ts +0 -26
  409. package/dist/src/lib/types/stage-types.d.ts.map +0 -1
  410. package/dist/src/lib/ui/Debug.d.ts +0 -6
  411. package/dist/src/lib/ui/Debug.d.ts.map +0 -1
  412. package/dist/src/lib/ui/console/Console.d.ts +0 -7
  413. package/dist/src/lib/ui/console/Console.d.ts.map +0 -1
  414. package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
  415. package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
  416. package/dist/src/lib/ui/debug-panel/Menu.d.ts +0 -6
  417. package/dist/src/lib/ui/debug-panel/Menu.d.ts.map +0 -1
  418. package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
  419. package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
  420. package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
  421. package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
  422. package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
  423. package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
  424. package/dist/src/lib/ui/debug-panel/sections/all.d.ts +0 -4
  425. package/dist/src/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
  426. package/dist/src/lib/ui/toolbar/Toolbar.d.ts +0 -6
  427. package/dist/src/lib/ui/toolbar/Toolbar.d.ts.map +0 -1
  428. package/dist/tests/e2e/basic-game.spec.d.ts +0 -2
  429. package/dist/tests/e2e/basic-game.spec.d.ts.map +0 -1
  430. package/dist/tests/integration/debug.sim.spec.d.ts +0 -2
  431. package/dist/tests/integration/debug.sim.spec.d.ts.map +0 -1
  432. package/dist/tests/unit/collision/collision.spec.d.ts +0 -2
  433. package/dist/tests/unit/collision/collision.spec.d.ts.map +0 -1
  434. package/dist/tests/unit/core/base-node.spec.d.ts +0 -2
  435. package/dist/tests/unit/core/base-node.spec.d.ts.map +0 -1
  436. package/dist/tests/unit/core/game.spec.d.ts +0 -2
  437. package/dist/tests/unit/core/game.spec.d.ts.map +0 -1
  438. package/dist/tests/unit/core/stage.spec.d.ts +0 -2
  439. package/dist/tests/unit/core/stage.spec.d.ts.map +0 -1
  440. package/dist/tests/unit/core/vessel.spec.d.ts +0 -2
  441. package/dist/tests/unit/core/vessel.spec.d.ts.map +0 -1
Binary file
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=00-readme-example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"00-readme-example.d.ts","sourceRoot":"","sources":["../../examples/00-readme-example.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=01-basic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"01-basic.d.ts","sourceRoot":"","sources":["../../examples/01-basic.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export {};
2
- /**
3
- *
4
- * score: varNumber(0)
5
- * winnerText: varString('')
6
- *
7
- *
8
- */
9
- //# sourceMappingURL=01.1-basic-ball.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"01.1-basic-ball.d.ts","sourceRoot":"","sources":["../../examples/01.1-basic-ball.ts"],"names":[],"mappings":";AAiBA;;;;;;GAMG"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=01.2-ricochet-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"01.2-ricochet-test.d.ts","sourceRoot":"","sources":["../../examples/01.2-ricochet-test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=01.3-rect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"01.3-rect.d.ts","sourceRoot":"","sources":["../../examples/01.3-rect.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=02-input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"02-input.d.ts","sourceRoot":"","sources":["../../examples/02-input.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=03-stage-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"03-stage-test.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/03-stage-test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const stageZero: import("../../src/lib/stage/stage").Stage;
2
- //# sourceMappingURL=stage0.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stage0.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage0.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,2CAEpB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const stage1: import("../../src/lib/stage/stage").Stage;
2
- //# sourceMappingURL=stage1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stage1.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage1.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,2CAET,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const stage2: import("../../src/lib/stage/stage").Stage;
2
- //# sourceMappingURL=stage2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stage2.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage2.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,2CAEX,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const stage3: import("../../src/lib/stage/stage").Stage;
2
- //# sourceMappingURL=stage3.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stage3.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage3.ts"],"names":[],"mappings":"AAiEA,eAAO,MAAM,MAAM,2CAGoC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=03.1-stage-variable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"03.1-stage-variable.d.ts","sourceRoot":"","sources":["../../examples/03.1-stage-variable.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- export {};
2
- /**
3
- *
4
- * import { update } from '../src/lib/actions/update';
5
- * import { sphere } from '../src/lib/entities';
6
- * const mySphere = await sphere({
7
- * size: new Vector3(4, 4, 4),
8
- * position: { x: 0, y: 0, z: 0 },
9
- * collision: { static: false },
10
- * material: { path: marsSurfacePath },
11
- * });
12
- *
13
- * update(mySphere, (context) => {
14
- *
15
- * });
16
- *
17
- */
18
- //# sourceMappingURL=04-vessel-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"04-vessel-test.d.ts","sourceRoot":"","sources":["../../examples/04-vessel-test.ts"],"names":[],"mappings":";AAwBA;;;;;;;;;;;;;;;GAeG"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=05-camera-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"05-camera-test.d.ts","sourceRoot":"","sources":["../../examples/05-camera-test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=06-entity-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"06-entity-test.d.ts","sourceRoot":"","sources":["../../examples/06-entity-test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=07-behaviors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"07-behaviors.d.ts","sourceRoot":"","sources":["../../examples/07-behaviors.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=07.01-behavior-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"07.01-behavior-context.d.ts","sourceRoot":"","sources":["../../examples/07.01-behavior-context.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=08-pong.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"08-pong.d.ts","sourceRoot":"","sources":["../../examples/08-pong.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=08.01-breakout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"08.01-breakout.d.ts","sourceRoot":"","sources":["../../examples/08.01-breakout.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=09-space-invaders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"09-space-invaders.d.ts","sourceRoot":"","sources":["../../examples/09-space-invaders.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=10-asteroids.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"10-asteroids.d.ts","sourceRoot":"","sources":["../../examples/10-asteroids.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=11-2d-platformer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"11-2d-platformer.d.ts","sourceRoot":"","sources":["../../examples/11-2d-platformer.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=12-3d-platformer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"12-3d-platformer.d.ts","sourceRoot":"","sources":["../../examples/12-3d-platformer.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=13-fps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"13-fps.d.ts","sourceRoot":"","sources":["../../examples/13-fps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=14-strategy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"14-strategy.d.ts","sourceRoot":"","sources":["../../examples/14-strategy.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=15-zylem-planet-demo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"15-zylem-planet-demo.d.ts","sourceRoot":"","sources":["../../examples/15-zylem-planet-demo.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=16-timbotron.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"16-timbotron.d.ts","sourceRoot":"","sources":["../../examples/16-timbotron.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=17-stress-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"17-stress-test.d.ts","sourceRoot":"","sources":["../../examples/17-stress-test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=architecture-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"architecture-test.d.ts","sourceRoot":"","sources":["../../examples/architecture-test.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { ZylemBox } from "../src/lib/entities/box";
2
- import { ZylemSphere } from "../src/lib/entities/sphere";
3
- import { Vector2 } from "three";
4
- export type PlaygroundPlaneType = 'grass' | 'dirt' | 'wood' | 'mars' | 'steel';
5
- export declare const playgroundPlane: (type: PlaygroundPlaneType, size?: Vector2) => Promise<import("../src/lib/entities").ZylemPlane>;
6
- export type PlaygroundActorType = 'player' | 'mascot';
7
- export declare const playgroundActor: (type: PlaygroundActorType) => Promise<import("../src/lib/entities").ZylemActor>;
8
- export declare const playgroundPlatforms: () => Promise<ZylemBox[]>;
9
- export declare const createSpheres: (count: number) => Promise<ZylemSphere[]>;
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../examples/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAS,OAAO,EAAW,MAAM,OAAO,CAAC;AAkBhD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAU/E,eAAO,MAAM,eAAe,GAAU,MAAM,mBAAmB,EAAE,OAAM,OAA+B,sDAYrG,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAoCtD,eAAO,MAAM,eAAe,GAAU,MAAM,mBAAmB,sDAW9D,CAAA;AAED,eAAO,MAAM,mBAAmB,2BA+F/B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,OAAO,MAAM,2BAIhD,CAAC"}
@@ -1,35 +0,0 @@
1
- function s(t, e) {
2
- setTimeout(e, t);
3
- }
4
- const c = /* @__PURE__ */ (() => {
5
- let t = !1;
6
- return (e, n) => {
7
- e && !t ? (t = !0, n()) : e || (t = !1);
8
- };
9
- })(), u = /* @__PURE__ */ (() => {
10
- let t = !1;
11
- return (e, n) => {
12
- !e && t ? (t = !1, n()) : e && (t = !0);
13
- };
14
- })(), f = /* @__PURE__ */ (() => {
15
- let t = -1 / 0, e = !1;
16
- return ({ timer: n, immediate: o = !0 }, l, r) => {
17
- let i = Date.now();
18
- !e && !o && (e = !0, t = i);
19
- const a = i - t;
20
- a >= n && (t = i, l()), r({ delta: a });
21
- };
22
- })(), m = /* @__PURE__ */ (() => {
23
- let t = 0;
24
- return (e, n) => {
25
- const o = Date.now();
26
- o - t >= e && (t = o, n());
27
- };
28
- })();
29
- export {
30
- c as actionOnPress,
31
- u as actionOnRelease,
32
- f as actionWithCooldown,
33
- m as actionWithThrottle,
34
- s as wait
35
- };
@@ -1,40 +0,0 @@
1
- const y = {
2
- boundaries: {
3
- top: 0,
4
- bottom: 0,
5
- left: 0,
6
- right: 0
7
- },
8
- stopMovement: !0
9
- };
10
- function d(i = {}) {
11
- return {
12
- type: "update",
13
- handler: (n) => {
14
- a(n, i);
15
- }
16
- };
17
- }
18
- function a(i, n) {
19
- const { me: r } = i, { boundaries: s, onBoundary: u } = {
20
- ...y,
21
- ...n
22
- }, e = r.getPosition();
23
- if (!e)
24
- return;
25
- let t = { top: !1, bottom: !1, left: !1, right: !1 };
26
- if (e.x <= s.left ? t.left = !0 : e.x >= s.right && (t.right = !0), e.y <= s.bottom ? t.bottom = !0 : e.y >= s.top && (t.top = !0), (n.stopMovement ?? !0) && t) {
27
- const o = r.getVelocity() ?? { x: 0, y: 0 };
28
- let { x: f, y: l } = o;
29
- (o?.y < 0 && t.bottom || o?.y > 0 && t.top) && (l = 0), (o?.x < 0 && t.left || o?.x > 0 && t.right) && (f = 0), r.moveXY(f, l);
30
- }
31
- u && t && u({
32
- me: r,
33
- boundary: t,
34
- position: { x: e.x, y: e.y, z: e.z },
35
- updateContext: i
36
- });
37
- }
38
- export {
39
- d as boundary2d
40
- };
@@ -1,100 +0,0 @@
1
- import { matchesCollisionSelector as T } from "../../../collision/utils.js";
2
- import { clamp as E } from "./ricochet.js";
3
- function tt(O = {}, b) {
4
- return {
5
- type: "collision",
6
- handler: (D) => {
7
- Z(D, O, b);
8
- }
9
- };
10
- }
11
- function Z(O, b, D) {
12
- const { entity: K, other: y } = O, f = K;
13
- if (y.collider?.isSensor())
14
- return;
15
- const { minSpeed: C = 2, maxSpeed: H = 20, separation: U = 0, collisionWith: L = void 0 } = {
16
- ...b
17
- }, I = b?.reflectionMode ?? "angled", W = b?.maxAngleDeg ?? 60, _ = b?.speedUpFactor ?? 1.05, j = b?.minOffsetForAngle ?? 0.15, G = b?.centerRetentionFactor ?? 0.5;
18
- if (!T(y, L))
19
- return;
20
- const i = f.getPosition(), X = y.body?.translation(), e = f.getVelocity();
21
- if (!i || !X || !e)
22
- return;
23
- let c = e.x, o = e.y, Y = i.x, P = i.y;
24
- const p = i.x - X.x, m = i.y - X.y;
25
- let n = null, s = null;
26
- const u = y.collider?.shape;
27
- if (u && (u.halfExtents && (n = Math.abs(u.halfExtents.x ?? u.halfExtents[0] ?? null), s = Math.abs(u.halfExtents.y ?? u.halfExtents[1] ?? null)), (n == null || s == null) && typeof u.radius == "number" && (n = n ?? Math.abs(u.radius), s = s ?? Math.abs(u.radius))), (n == null || s == null) && typeof y.collider?.halfExtents == "function") {
28
- const t = y.collider.halfExtents();
29
- t && (n = n ?? Math.abs(t.x), s = s ?? Math.abs(t.y));
30
- }
31
- if ((n == null || s == null) && typeof y.collider?.radius == "function") {
32
- const t = y.collider.radius();
33
- typeof t == "number" && (n = n ?? Math.abs(t), s = s ?? Math.abs(t));
34
- }
35
- let q = 0, z = 0;
36
- n && s ? (q = E(p / n, -1, 1), z = E(m / s, -1, 1)) : (q = Math.sign(p), z = Math.sign(m));
37
- let J = Math.abs(m) >= Math.abs(p), a = null, l = null;
38
- const M = f.collider?.shape;
39
- if (M && (M.halfExtents && (a = Math.abs(M.halfExtents.x ?? M.halfExtents[0] ?? null), l = Math.abs(M.halfExtents.y ?? M.halfExtents[1] ?? null)), (a == null || l == null) && typeof M.radius == "number" && (a = a ?? Math.abs(M.radius), l = l ?? Math.abs(M.radius))), (a == null || l == null) && typeof f.collider?.halfExtents == "function") {
40
- const t = f.collider.halfExtents();
41
- t && (a = a ?? Math.abs(t.x), l = l ?? Math.abs(t.y));
42
- }
43
- if ((a == null || l == null) && typeof f.collider?.radius == "function") {
44
- const t = f.collider.radius();
45
- typeof t == "number" && (a = a ?? Math.abs(t), l = l ?? Math.abs(t));
46
- }
47
- if (n != null && s != null && a != null && l != null) {
48
- const t = a + n - Math.abs(p), r = l + s - Math.abs(m);
49
- !Number.isNaN(t) && !Number.isNaN(r) && (J = r <= t);
50
- }
51
- let F = !1;
52
- if (J) {
53
- const t = (s ?? 0) + (l ?? 0) + U;
54
- if (P = X.y + (m > 0 ? t : -t), Y = i.x, n != null && s != null && n > s && I === "angled") {
55
- const v = W * Math.PI / 180, g = Math.max(0, Math.min(1, j)), N = E(q, -1, 1), V = Math.abs(N), S = Math.sqrt(e.x * e.x + e.y * e.y), h = E(S * _, C, H);
56
- if (V > g) {
57
- const d = (V - g) / (1 - g), x = Math.sign(N) * (d * v), A = Math.cos(x), w = Math.sin(x), B = Math.abs(h * A), Q = h * w;
58
- o = m > 0 ? B : -B, c = Q;
59
- } else {
60
- const d = e.x * G, x = Math.max(0, h * h - d * d), A = Math.sqrt(x);
61
- o = m > 0 ? A : -A, c = d;
62
- }
63
- F = !0;
64
- } else
65
- o = m > 0 ? Math.abs(e.y) : -Math.abs(e.y), I === "simple" && (F = !0);
66
- } else {
67
- const t = (n ?? 0) + (a ?? 0) + U;
68
- if (Y = X.x + (p > 0 ? t : -t), P = i.y, I === "angled") {
69
- const r = W * Math.PI / 180, v = Math.max(0, Math.min(1, j)), g = E(z, -1, 1), N = Math.abs(g), V = Math.sqrt(e.x * e.x + e.y * e.y), S = E(V * _, C, H);
70
- if (N > v) {
71
- const h = (N - v) / (1 - v), d = Math.sign(g) * (h * r), x = Math.cos(d), A = Math.sin(d), w = Math.abs(S * x), B = S * A;
72
- c = p > 0 ? w : -w, o = B;
73
- } else {
74
- const h = e.y * G, d = Math.max(0, S * S - h * h), x = Math.sqrt(d);
75
- c = p > 0 ? x : -x, o = h;
76
- }
77
- F = !0;
78
- } else
79
- c = p > 0 ? Math.abs(e.x) : -Math.abs(e.x), o = e.y, F = !0;
80
- }
81
- if (!F) {
82
- const t = Math.abs(c), r = Math.abs(o), v = Math.sign(q) * Math.abs(q) * t, g = Math.sign(z) * Math.abs(z) * r;
83
- c += v, o += g;
84
- }
85
- const R = Math.sqrt(c * c + o * o);
86
- if (R > 0) {
87
- const t = E(R, C, H);
88
- if (t !== R) {
89
- const r = t / R;
90
- c *= r, o *= r;
91
- }
92
- }
93
- (Y !== i.x || P !== i.y) && (f.setPosition(Y, P, i.z), f.moveXY(c, o), D && f.getVelocity() && D({
94
- position: { x: Y, y: P, z: i.z },
95
- ...O
96
- }));
97
- }
98
- export {
99
- tt as ricochet2DCollision
100
- };
@@ -1,37 +0,0 @@
1
- import { clamp as g } from "./ricochet.js";
2
- function w(a = {}, u) {
3
- return {
4
- type: "update",
5
- handler: (y) => {
6
- M(y, a, u);
7
- }
8
- };
9
- }
10
- function M(a, u, y) {
11
- const { me: r } = a, { restitution: d = 0, minSpeed: b = 2, maxSpeed: x = 20, boundaries: e = { top: 5, bottom: -5, left: -6.5, right: 6.5 }, separation: p = 0 } = { ...u }, t = r.getPosition(), o = r.getVelocity();
12
- if (!t || !o)
13
- return;
14
- let i = o.x, n = o.y, c = t.x, l = t.y, s = null;
15
- t.x <= e.left ? (i = Math.abs(o.x), c = e.left + p, s = "left") : t.x >= e.right && (i = -Math.abs(o.x), c = e.right - p, s = "right"), t.y <= e.bottom ? (n = Math.abs(o.y), l = e.bottom + p, s = "bottom") : t.y >= e.top && (n = -Math.abs(o.y), l = e.top - p, s = "top");
16
- const h = Math.sqrt(i * i + n * n);
17
- if (h > 0) {
18
- const f = g(h, b, x);
19
- if (f !== h) {
20
- const m = f / h;
21
- i *= m, n *= m;
22
- }
23
- }
24
- if (d && (i *= d, n *= d), (c !== t.x || l !== t.y) && (r.setPosition(c, l, t.z), r.moveXY(i, n), y && s)) {
25
- const f = r.getVelocity();
26
- f && y({
27
- boundary: s,
28
- position: { x: c, y: l, z: t.z },
29
- velocityBefore: o,
30
- velocityAfter: f,
31
- ...a
32
- });
33
- }
34
- }
35
- export {
36
- w as ricochet2DInBounds
37
- };
@@ -1,6 +0,0 @@
1
- function m(t, a, n) {
2
- return Math.max(a, Math.min(n, t));
3
- }
4
- export {
5
- m as clamp
6
- };
@@ -1,108 +0,0 @@
1
- import { Vector3 as l } from "three";
2
- function b(o, e) {
3
- if (!o.body)
4
- return;
5
- const n = o.body.linvel(), r = new l(e, n.y, n.z);
6
- o.body.setLinvel(r, !0);
7
- }
8
- function y(o, e) {
9
- if (!o.body)
10
- return;
11
- const n = o.body.linvel(), r = new l(n.x, e, n.z);
12
- o.body.setLinvel(r, !0);
13
- }
14
- function m(o, e) {
15
- if (!o.body)
16
- return;
17
- const n = o.body.linvel(), r = new l(n.x, n.y, e);
18
- o.body.setLinvel(r, !0);
19
- }
20
- function w(o, e, n) {
21
- if (!o.body)
22
- return;
23
- const r = o.body.linvel(), c = new l(e, n, r.z);
24
- o.body.setLinvel(c, !0);
25
- }
26
- function V(o, e, n) {
27
- if (!o.body)
28
- return;
29
- const r = o.body.linvel(), c = new l(e, r.y, n);
30
- o.body.setLinvel(c, !0);
31
- }
32
- function P(o, e) {
33
- if (!o.body)
34
- return;
35
- const n = o.body.linvel(), r = new l(n.x + e.x, n.y + e.y, n.z + e.z);
36
- o.body.setLinvel(r, !0);
37
- }
38
- function p(o) {
39
- o.body && (o.body.setLinvel(new l(0, 0, 0), !0), o.body.setLinearDamping(5));
40
- }
41
- function x(o, e, n) {
42
- const r = Math.sin(-n) * e, c = Math.cos(-n) * e;
43
- w(o, r, c);
44
- }
45
- function u(o) {
46
- return o.body ? o.body.translation() : null;
47
- }
48
- function X(o) {
49
- return o.body ? o.body.linvel() : null;
50
- }
51
- function f(o, e, n, r) {
52
- o.body && o.body.setTranslation({ x: e, y: n, z: r }, !0);
53
- }
54
- function z(o, e) {
55
- if (!o.body)
56
- return;
57
- const { y: n, z: r } = o.body.translation();
58
- o.body.setTranslation({ x: e, y: n, z: r }, !0);
59
- }
60
- function L(o, e) {
61
- if (!o.body)
62
- return;
63
- const { x: n, z: r } = o.body.translation();
64
- o.body.setTranslation({ x: n, y: e, z: r }, !0);
65
- }
66
- function Y(o, e) {
67
- if (!o.body)
68
- return;
69
- const { x: n, y: r } = o.body.translation();
70
- o.body.setTranslation({ x: n, y: r, z: e }, !0);
71
- }
72
- function g(o, e, n) {
73
- const r = u(o);
74
- if (!r)
75
- return;
76
- const { x: c, y: t } = r, i = c > e ? -e : c < -e ? e : c, s = t > n ? -n : t < -n ? n : t;
77
- (i !== c || s !== t) && f(o, i, s, 0);
78
- }
79
- function T(o, e, n, r) {
80
- const c = u(o);
81
- if (!c)
82
- return;
83
- const { x: t, y: i, z: s } = c, a = t > e ? -e : t < -e ? e : t, d = i > n ? -n : i < -n ? n : i, v = s > r ? -r : s < -r ? r : s;
84
- (a !== t || d !== i || v !== s) && f(o, a, d, v);
85
- }
86
- function A(o) {
87
- const e = o;
88
- return e.moveX = (n) => b(o, n), e.moveY = (n) => y(o, n), e.moveZ = (n) => m(o, n), e.moveXY = (n, r) => w(o, n, r), e.moveXZ = (n, r) => V(o, n, r), e.move = (n) => P(o, n), e.resetVelocity = () => p(o), e.moveForwardXY = (n, r) => x(o, n, r), e.getPosition = () => u(o), e.getVelocity = () => X(o), e.setPosition = (n, r, c) => f(o, n, r, c), e.setPositionX = (n) => z(o, n), e.setPositionY = (n) => L(o, n), e.setPositionZ = (n) => Y(o, n), e.wrapAroundXY = (n, r) => g(o, n, r), e.wrapAround3D = (n, r, c) => T(o, n, r, c), e;
89
- }
90
- export {
91
- u as getPosition,
92
- X as getVelocity,
93
- A as makeMoveable,
94
- P as move,
95
- x as moveForwardXY,
96
- b as moveX,
97
- w as moveXY,
98
- V as moveXZ,
99
- y as moveY,
100
- m as moveZ,
101
- p as resetVelocity,
102
- f as setPosition,
103
- z as setPositionX,
104
- L as setPositionY,
105
- Y as setPositionZ,
106
- T as wrapAround3D,
107
- g as wrapAroundXY
108
- };