excalibur 0.25.2 → 0.25.3

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 (446) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/build/dist/Actions/Action/Blink.js +51 -0
  3. package/build/dist/Actions/Action/Blink.js.map +1 -0
  4. package/build/dist/Actions/Action/CallMethod.js +21 -0
  5. package/build/dist/Actions/Action/CallMethod.js.map +1 -0
  6. package/build/dist/Actions/Action/Delay.js +25 -0
  7. package/build/dist/Actions/Action/Delay.js.map +1 -0
  8. package/build/dist/Actions/Action/Die.js +22 -0
  9. package/build/dist/Actions/Action/Die.js.map +1 -0
  10. package/build/dist/Actions/Action/EaseTo.js +69 -0
  11. package/build/dist/Actions/Action/EaseTo.js.map +1 -0
  12. package/build/dist/Actions/Action/Fade.js +46 -0
  13. package/build/dist/Actions/Action/Fade.js.map +1 -0
  14. package/build/dist/Actions/Action/Follow.js +55 -0
  15. package/build/dist/Actions/Action/Follow.js.map +1 -0
  16. package/build/dist/Actions/Action/Meet.js +52 -0
  17. package/build/dist/Actions/Action/Meet.js.map +1 -0
  18. package/build/dist/Actions/Action/MoveBy.js +47 -0
  19. package/build/dist/Actions/Action/MoveBy.js.map +1 -0
  20. package/build/dist/Actions/Action/MoveTo.js +40 -0
  21. package/build/dist/Actions/Action/MoveTo.js.map +1 -0
  22. package/build/dist/Actions/Action/Repeat.js +31 -0
  23. package/build/dist/Actions/Action/Repeat.js.map +1 -0
  24. package/build/dist/Actions/Action/RepeatForever.js +37 -0
  25. package/build/dist/Actions/Action/RepeatForever.js.map +1 -0
  26. package/build/dist/Actions/Action/RotateBy.js +91 -0
  27. package/build/dist/Actions/Action/RotateBy.js.map +1 -0
  28. package/build/dist/Actions/Action/RotateTo.js +90 -0
  29. package/build/dist/Actions/Action/RotateTo.js.map +1 -0
  30. package/build/dist/Actions/Action/ScaleBy.js +45 -0
  31. package/build/dist/Actions/Action/ScaleBy.js.map +1 -0
  32. package/build/dist/Actions/Action/ScaleTo.js +56 -0
  33. package/build/dist/Actions/Action/ScaleTo.js.map +1 -0
  34. package/build/dist/Actions/Action.js +2 -0
  35. package/build/dist/Actions/Action.js.map +1 -0
  36. package/build/dist/Actions/ActionContext.js +305 -0
  37. package/build/dist/Actions/ActionContext.js.map +1 -0
  38. package/build/dist/Actions/ActionQueue.js +87 -0
  39. package/build/dist/Actions/ActionQueue.js.map +1 -0
  40. package/build/dist/Actions/Actionable.js +2 -0
  41. package/build/dist/Actions/Actionable.js.map +1 -0
  42. package/build/dist/Actions/ActionsComponent.js +198 -0
  43. package/build/dist/Actions/ActionsComponent.js.map +1 -0
  44. package/build/dist/Actions/ActionsSystem.js +18 -0
  45. package/build/dist/Actions/ActionsSystem.js.map +1 -0
  46. package/build/dist/Actions/Index.js +22 -0
  47. package/build/dist/Actions/Index.js.map +1 -0
  48. package/build/dist/Actions/RotationType.js +27 -0
  49. package/build/dist/Actions/RotationType.js.map +1 -0
  50. package/build/dist/Actor.js +831 -0
  51. package/build/dist/Actor.js.map +1 -0
  52. package/build/dist/Camera.js +663 -0
  53. package/build/dist/Camera.js.map +1 -0
  54. package/build/dist/Class.js +48 -0
  55. package/build/dist/Class.js.map +1 -0
  56. package/build/dist/Collision/BodyComponent.js +351 -0
  57. package/build/dist/Collision/BodyComponent.js.map +1 -0
  58. package/build/dist/Collision/BoundingBox.js +361 -0
  59. package/build/dist/Collision/BoundingBox.js.map +1 -0
  60. package/build/dist/Collision/ColliderComponent.js +198 -0
  61. package/build/dist/Collision/ColliderComponent.js.map +1 -0
  62. package/build/dist/Collision/Colliders/CircleCollider.js +264 -0
  63. package/build/dist/Collision/Colliders/CircleCollider.js.map +1 -0
  64. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +211 -0
  65. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +1 -0
  66. package/build/dist/Collision/Colliders/Collider.js +26 -0
  67. package/build/dist/Collision/Colliders/Collider.js.map +1 -0
  68. package/build/dist/Collision/Colliders/CollisionJumpTable.js +301 -0
  69. package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +1 -0
  70. package/build/dist/Collision/Colliders/CompositeCollider.js +232 -0
  71. package/build/dist/Collision/Colliders/CompositeCollider.js.map +1 -0
  72. package/build/dist/Collision/Colliders/EdgeCollider.js +253 -0
  73. package/build/dist/Collision/Colliders/EdgeCollider.js.map +1 -0
  74. package/build/dist/Collision/Colliders/PolygonCollider.js +389 -0
  75. package/build/dist/Collision/Colliders/PolygonCollider.js.map +1 -0
  76. package/build/dist/Collision/Colliders/SeparatingAxis.js +67 -0
  77. package/build/dist/Collision/Colliders/SeparatingAxis.js.map +1 -0
  78. package/build/dist/Collision/Colliders/Shape.js +102 -0
  79. package/build/dist/Collision/Colliders/Shape.js.map +1 -0
  80. package/build/dist/Collision/CollisionSystem.js +116 -0
  81. package/build/dist/Collision/CollisionSystem.js.map +1 -0
  82. package/build/dist/Collision/CollisionType.js +33 -0
  83. package/build/dist/Collision/CollisionType.js.map +1 -0
  84. package/build/dist/Collision/Detection/CollisionContact.js +46 -0
  85. package/build/dist/Collision/Detection/CollisionContact.js.map +1 -0
  86. package/build/dist/Collision/Detection/CollisionProcessor.js +2 -0
  87. package/build/dist/Collision/Detection/CollisionProcessor.js.map +1 -0
  88. package/build/dist/Collision/Detection/DynamicTree.js +442 -0
  89. package/build/dist/Collision/Detection/DynamicTree.js.map +1 -0
  90. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js +211 -0
  91. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js.map +1 -0
  92. package/build/dist/Collision/Detection/Pair.js +92 -0
  93. package/build/dist/Collision/Detection/Pair.js.map +1 -0
  94. package/build/dist/Collision/Group/CollisionGroup.js +114 -0
  95. package/build/dist/Collision/Group/CollisionGroup.js.map +1 -0
  96. package/build/dist/Collision/Group/CollisionGroupManager.js +52 -0
  97. package/build/dist/Collision/Group/CollisionGroupManager.js.map +1 -0
  98. package/build/dist/Collision/Index.js +29 -0
  99. package/build/dist/Collision/Index.js.map +1 -0
  100. package/build/dist/Collision/Integrator.js +11 -0
  101. package/build/dist/Collision/Integrator.js.map +1 -0
  102. package/build/dist/Collision/MotionSystem.js +42 -0
  103. package/build/dist/Collision/MotionSystem.js.map +1 -0
  104. package/build/dist/Collision/Physics.js +163 -0
  105. package/build/dist/Collision/Physics.js.map +1 -0
  106. package/build/dist/Collision/Side.js +51 -0
  107. package/build/dist/Collision/Side.js.map +1 -0
  108. package/build/dist/Collision/Solver/ArcadeSolver.js +101 -0
  109. package/build/dist/Collision/Solver/ArcadeSolver.js.map +1 -0
  110. package/build/dist/Collision/Solver/ContactConstraintPoint.js +83 -0
  111. package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +1 -0
  112. package/build/dist/Collision/Solver/RealisticSolver.js +248 -0
  113. package/build/dist/Collision/Solver/RealisticSolver.js.map +1 -0
  114. package/build/dist/Collision/Solver/Solver.js +37 -0
  115. package/build/dist/Collision/Solver/Solver.js.map +1 -0
  116. package/build/dist/Color.js +461 -0
  117. package/build/dist/Color.js.map +1 -0
  118. package/build/dist/Configurable.js +32 -0
  119. package/build/dist/Configurable.js.map +1 -0
  120. package/build/dist/Debug/Debug.js +375 -0
  121. package/build/dist/Debug/Debug.js.map +1 -0
  122. package/build/dist/Debug/DebugFlags.js +40 -0
  123. package/build/dist/Debug/DebugFlags.js.map +1 -0
  124. package/build/dist/Debug/DebugSystem.js +251 -0
  125. package/build/dist/Debug/DebugSystem.js.map +1 -0
  126. package/build/dist/Debug/index.js +4 -0
  127. package/build/dist/Debug/index.js.map +1 -0
  128. package/build/dist/Deprecated.js +2 -0
  129. package/build/dist/Deprecated.js.map +1 -0
  130. package/build/dist/Drawing/Animation.js +294 -0
  131. package/build/dist/Drawing/Animation.js.map +1 -0
  132. package/build/dist/Drawing/CanvasDrawComponent.js +16 -0
  133. package/build/dist/Drawing/CanvasDrawComponent.js.map +1 -0
  134. package/build/dist/Drawing/CanvasDrawingSystem.js +95 -0
  135. package/build/dist/Drawing/CanvasDrawingSystem.js.map +1 -0
  136. package/build/dist/Drawing/Index.js +10 -0
  137. package/build/dist/Drawing/Index.js.map +1 -0
  138. package/build/dist/Drawing/Polygon.js +139 -0
  139. package/build/dist/Drawing/Polygon.js.map +1 -0
  140. package/build/dist/Drawing/Sprite.js +355 -0
  141. package/build/dist/Drawing/Sprite.js.map +1 -0
  142. package/build/dist/Drawing/SpriteEffects.js +246 -0
  143. package/build/dist/Drawing/SpriteEffects.js.map +1 -0
  144. package/build/dist/Drawing/SpriteSheet.js +413 -0
  145. package/build/dist/Drawing/SpriteSheet.js.map +1 -0
  146. package/build/dist/Drawing/Texture.js +69 -0
  147. package/build/dist/Drawing/Texture.js.map +1 -0
  148. package/build/dist/Engine.d.ts +4 -1
  149. package/build/dist/Engine.js +985 -0
  150. package/build/dist/Engine.js.map +1 -0
  151. package/build/dist/EntityComponentSystem/Component.js +65 -0
  152. package/build/dist/EntityComponentSystem/Component.js.map +1 -0
  153. package/build/dist/EntityComponentSystem/Components/MotionComponent.js +33 -0
  154. package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +1 -0
  155. package/build/dist/EntityComponentSystem/Components/TransformComponent.js +249 -0
  156. package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +1 -0
  157. package/build/dist/EntityComponentSystem/Entity.js +452 -0
  158. package/build/dist/EntityComponentSystem/Entity.js.map +1 -0
  159. package/build/dist/EntityComponentSystem/EntityManager.js +128 -0
  160. package/build/dist/EntityComponentSystem/EntityManager.js.map +1 -0
  161. package/build/dist/EntityComponentSystem/Query.js +91 -0
  162. package/build/dist/EntityComponentSystem/Query.js.map +1 -0
  163. package/build/dist/EntityComponentSystem/QueryManager.js +90 -0
  164. package/build/dist/EntityComponentSystem/QueryManager.js.map +1 -0
  165. package/build/dist/EntityComponentSystem/System.js +76 -0
  166. package/build/dist/EntityComponentSystem/System.js.map +1 -0
  167. package/build/dist/EntityComponentSystem/SystemManager.js +102 -0
  168. package/build/dist/EntityComponentSystem/SystemManager.js.map +1 -0
  169. package/build/dist/EntityComponentSystem/Util.js +5 -0
  170. package/build/dist/EntityComponentSystem/Util.js.map +1 -0
  171. package/build/dist/EntityComponentSystem/World.js +55 -0
  172. package/build/dist/EntityComponentSystem/World.js.map +1 -0
  173. package/build/dist/EntityComponentSystem/index.js +11 -0
  174. package/build/dist/EntityComponentSystem/index.js.map +1 -0
  175. package/build/dist/EventDispatcher.js +114 -0
  176. package/build/dist/EventDispatcher.js.map +1 -0
  177. package/build/dist/Events/ExEvent.js +12 -0
  178. package/build/dist/Events/ExEvent.js.map +1 -0
  179. package/build/dist/Events/MediaEvents.js +75 -0
  180. package/build/dist/Events/MediaEvents.js.map +1 -0
  181. package/build/dist/Events/PointerEvents.js +52 -0
  182. package/build/dist/Events/PointerEvents.js.map +1 -0
  183. package/build/dist/Events.js +497 -0
  184. package/build/dist/Events.js.map +1 -0
  185. package/build/dist/Flags.js +90 -0
  186. package/build/dist/Flags.js.map +1 -0
  187. package/build/dist/Graphics/Animation.js +310 -0
  188. package/build/dist/Graphics/Animation.js.map +1 -0
  189. package/build/dist/Graphics/Canvas.js +38 -0
  190. package/build/dist/Graphics/Canvas.js.map +1 -0
  191. package/build/dist/Graphics/Circle.js +47 -0
  192. package/build/dist/Graphics/Circle.js.map +1 -0
  193. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +2 -0
  194. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +1 -0
  195. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +207 -0
  196. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +1 -0
  197. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +331 -0
  198. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +1 -0
  199. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js +160 -0
  200. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js.map +1 -0
  201. package/build/dist/Graphics/Context/debug-text.js +47 -0
  202. package/build/dist/Graphics/Context/debug-text.js.map +1 -0
  203. package/build/dist/Graphics/Context/image-renderer/image-renderer.js +209 -0
  204. package/build/dist/Graphics/Context/image-renderer/image-renderer.js.map +1 -0
  205. package/build/dist/Graphics/Context/line-renderer/line-renderer.js +87 -0
  206. package/build/dist/Graphics/Context/line-renderer/line-renderer.js.map +1 -0
  207. package/build/dist/Graphics/Context/point-renderer/point-renderer.js +82 -0
  208. package/build/dist/Graphics/Context/point-renderer/point-renderer.js.map +1 -0
  209. package/build/dist/Graphics/Context/quad-index-buffer.js +69 -0
  210. package/build/dist/Graphics/Context/quad-index-buffer.js.map +1 -0
  211. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js +272 -0
  212. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js.map +1 -0
  213. package/build/dist/Graphics/Context/render-source.js +16 -0
  214. package/build/dist/Graphics/Context/render-source.js.map +1 -0
  215. package/build/dist/Graphics/Context/render-target.js +65 -0
  216. package/build/dist/Graphics/Context/render-target.js.map +1 -0
  217. package/build/dist/Graphics/Context/renderer.js +2 -0
  218. package/build/dist/Graphics/Context/renderer.js.map +1 -0
  219. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js +53 -0
  220. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js.map +1 -0
  221. package/build/dist/Graphics/Context/shader.js +236 -0
  222. package/build/dist/Graphics/Context/shader.js.map +1 -0
  223. package/build/dist/Graphics/Context/state-stack.js +27 -0
  224. package/build/dist/Graphics/Context/state-stack.js.map +1 -0
  225. package/build/dist/Graphics/Context/texture-loader.d.ts +8 -0
  226. package/build/dist/Graphics/Context/texture-loader.js +121 -0
  227. package/build/dist/Graphics/Context/texture-loader.js.map +1 -0
  228. package/build/dist/Graphics/Context/transform-stack.js +30 -0
  229. package/build/dist/Graphics/Context/transform-stack.js.map +1 -0
  230. package/build/dist/Graphics/Context/vertex-buffer.js +45 -0
  231. package/build/dist/Graphics/Context/vertex-buffer.js.map +1 -0
  232. package/build/dist/Graphics/Context/vertex-layout.js +93 -0
  233. package/build/dist/Graphics/Context/vertex-layout.js.map +1 -0
  234. package/build/dist/Graphics/Context/webgl-adapter.js +19 -0
  235. package/build/dist/Graphics/Context/webgl-adapter.js.map +1 -0
  236. package/build/dist/Graphics/Context/webgl-util.js +105 -0
  237. package/build/dist/Graphics/Context/webgl-util.js.map +1 -0
  238. package/build/dist/Graphics/DebugGraphicsComponent.js +15 -0
  239. package/build/dist/Graphics/DebugGraphicsComponent.js.map +1 -0
  240. package/build/dist/Graphics/Filtering.js +17 -0
  241. package/build/dist/Graphics/Filtering.js.map +1 -0
  242. package/build/dist/Graphics/Font.js +293 -0
  243. package/build/dist/Graphics/Font.js.map +1 -0
  244. package/build/dist/Graphics/FontCommon.js +109 -0
  245. package/build/dist/Graphics/FontCommon.js.map +1 -0
  246. package/build/dist/Graphics/Graphic.js +200 -0
  247. package/build/dist/Graphics/Graphic.js.map +1 -0
  248. package/build/dist/Graphics/GraphicsComponent.js +290 -0
  249. package/build/dist/Graphics/GraphicsComponent.js.map +1 -0
  250. package/build/dist/Graphics/GraphicsDiagnostics.js +9 -0
  251. package/build/dist/Graphics/GraphicsDiagnostics.js.map +1 -0
  252. package/build/dist/Graphics/GraphicsGroup.js +69 -0
  253. package/build/dist/Graphics/GraphicsGroup.js.map +1 -0
  254. package/build/dist/Graphics/GraphicsSystem.js +153 -0
  255. package/build/dist/Graphics/GraphicsSystem.js.map +1 -0
  256. package/build/dist/Graphics/ImageSource.js +116 -0
  257. package/build/dist/Graphics/ImageSource.js.map +1 -0
  258. package/build/dist/Graphics/Polygon.js +59 -0
  259. package/build/dist/Graphics/Polygon.js.map +1 -0
  260. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js +7 -0
  261. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js.map +1 -0
  262. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js +52 -0
  263. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js.map +1 -0
  264. package/build/dist/Graphics/PostProcessor/PostProcessor.js +2 -0
  265. package/build/dist/Graphics/PostProcessor/PostProcessor.js.map +1 -0
  266. package/build/dist/Graphics/PostProcessor/ScreenShader.js +56 -0
  267. package/build/dist/Graphics/PostProcessor/ScreenShader.js.map +1 -0
  268. package/build/dist/Graphics/Raster.js +207 -0
  269. package/build/dist/Graphics/Raster.js.map +1 -0
  270. package/build/dist/Graphics/Rectangle.js +29 -0
  271. package/build/dist/Graphics/Rectangle.js.map +1 -0
  272. package/build/dist/Graphics/Sprite.js +103 -0
  273. package/build/dist/Graphics/Sprite.js.map +1 -0
  274. package/build/dist/Graphics/SpriteFont.js +120 -0
  275. package/build/dist/Graphics/SpriteFont.js.map +1 -0
  276. package/build/dist/Graphics/SpriteSheet.js +115 -0
  277. package/build/dist/Graphics/SpriteSheet.js.map +1 -0
  278. package/build/dist/Graphics/Text.js +94 -0
  279. package/build/dist/Graphics/Text.js.map +1 -0
  280. package/build/dist/Graphics/index.js +42 -0
  281. package/build/dist/Graphics/index.js.map +1 -0
  282. package/build/dist/Id.js +8 -0
  283. package/build/dist/Id.js.map +1 -0
  284. package/build/dist/Input/CapturePointerConfig.js +5 -0
  285. package/build/dist/Input/CapturePointerConfig.js.map +1 -0
  286. package/build/dist/Input/EngineInput.js +2 -0
  287. package/build/dist/Input/EngineInput.js.map +1 -0
  288. package/build/dist/Input/Gamepad.js +358 -0
  289. package/build/dist/Input/Gamepad.js.map +1 -0
  290. package/build/dist/Input/Index.js +22 -0
  291. package/build/dist/Input/Index.js.map +1 -0
  292. package/build/dist/Input/Keyboard.js +267 -0
  293. package/build/dist/Input/Keyboard.js.map +1 -0
  294. package/build/dist/Input/NativePointerButton.js +12 -0
  295. package/build/dist/Input/NativePointerButton.js.map +1 -0
  296. package/build/dist/Input/PointerAbstraction.js +41 -0
  297. package/build/dist/Input/PointerAbstraction.js.map +1 -0
  298. package/build/dist/Input/PointerButton.js +12 -0
  299. package/build/dist/Input/PointerButton.js.map +1 -0
  300. package/build/dist/Input/PointerComponent.js +28 -0
  301. package/build/dist/Input/PointerComponent.js.map +1 -0
  302. package/build/dist/Input/PointerEvent.js +25 -0
  303. package/build/dist/Input/PointerEvent.js.map +1 -0
  304. package/build/dist/Input/PointerEventReceiver.js +414 -0
  305. package/build/dist/Input/PointerEventReceiver.js.map +1 -0
  306. package/build/dist/Input/PointerScope.js +16 -0
  307. package/build/dist/Input/PointerScope.js.map +1 -0
  308. package/build/dist/Input/PointerSystem.js +217 -0
  309. package/build/dist/Input/PointerSystem.js.map +1 -0
  310. package/build/dist/Input/PointerType.js +11 -0
  311. package/build/dist/Input/PointerType.js.map +1 -0
  312. package/build/dist/Input/WheelDeltaMode.js +7 -0
  313. package/build/dist/Input/WheelDeltaMode.js.map +1 -0
  314. package/build/dist/Input/WheelEvent.js +21 -0
  315. package/build/dist/Input/WheelEvent.js.map +1 -0
  316. package/build/dist/Interfaces/Audio.js +2 -0
  317. package/build/dist/Interfaces/Audio.js.map +1 -0
  318. package/build/dist/Interfaces/AudioImplementation.js +11 -0
  319. package/build/dist/Interfaces/AudioImplementation.js.map +1 -0
  320. package/build/dist/Interfaces/Clonable.js +2 -0
  321. package/build/dist/Interfaces/Clonable.js.map +1 -0
  322. package/build/dist/Interfaces/Drawable.js +2 -0
  323. package/build/dist/Interfaces/Drawable.js.map +1 -0
  324. package/build/dist/Interfaces/Evented.js +2 -0
  325. package/build/dist/Interfaces/Evented.js.map +1 -0
  326. package/build/dist/Interfaces/Index.js +10 -0
  327. package/build/dist/Interfaces/Index.js.map +1 -0
  328. package/build/dist/Interfaces/LifecycleEvents.js +51 -0
  329. package/build/dist/Interfaces/LifecycleEvents.js.map +1 -0
  330. package/build/dist/Interfaces/Loadable.js +2 -0
  331. package/build/dist/Interfaces/Loadable.js.map +1 -0
  332. package/build/dist/Interfaces/PointerEventHandlers.js +2 -0
  333. package/build/dist/Interfaces/PointerEventHandlers.js.map +1 -0
  334. package/build/dist/Interfaces/Trait.js +2 -0
  335. package/build/dist/Interfaces/Trait.js.map +1 -0
  336. package/build/dist/Label.js +273 -0
  337. package/build/dist/Label.js.map +1 -0
  338. package/build/dist/Loader.js +367 -0
  339. package/build/dist/Loader.js.map +1 -0
  340. package/build/dist/Math/Index.js +10 -0
  341. package/build/dist/Math/Index.js.map +1 -0
  342. package/build/dist/Math/Random.js +239 -0
  343. package/build/dist/Math/Random.js.map +1 -0
  344. package/build/dist/Math/global-coordinates.js +30 -0
  345. package/build/dist/Math/global-coordinates.js.map +1 -0
  346. package/build/dist/Math/line.js +194 -0
  347. package/build/dist/Math/line.js.map +1 -0
  348. package/build/dist/Math/matrix.js +446 -0
  349. package/build/dist/Math/matrix.js.map +1 -0
  350. package/build/dist/Math/projection.js +24 -0
  351. package/build/dist/Math/projection.js.map +1 -0
  352. package/build/dist/Math/ray.js +52 -0
  353. package/build/dist/Math/ray.js.map +1 -0
  354. package/build/dist/Math/util.js +82 -0
  355. package/build/dist/Math/util.js.map +1 -0
  356. package/build/dist/Math/vector-view.js +25 -0
  357. package/build/dist/Math/vector-view.js.map +1 -0
  358. package/build/dist/Math/vector.js +326 -0
  359. package/build/dist/Math/vector.js.map +1 -0
  360. package/build/dist/Particles.js +449 -0
  361. package/build/dist/Particles.js.map +1 -0
  362. package/build/dist/Polyfill.js +56 -0
  363. package/build/dist/Polyfill.js.map +1 -0
  364. package/build/dist/Promises.js +205 -0
  365. package/build/dist/Promises.js.map +1 -0
  366. package/build/dist/Resources/Gif.js +479 -0
  367. package/build/dist/Resources/Gif.js.map +1 -0
  368. package/build/dist/Resources/Index.js +4 -0
  369. package/build/dist/Resources/Index.js.map +1 -0
  370. package/build/dist/Resources/Resource.js +74 -0
  371. package/build/dist/Resources/Resource.js.map +1 -0
  372. package/build/dist/Resources/Sound/AudioContext.js +16 -0
  373. package/build/dist/Resources/Sound/AudioContext.js.map +1 -0
  374. package/build/dist/Resources/Sound/Index.js +4 -0
  375. package/build/dist/Resources/Sound/Index.js.map +1 -0
  376. package/build/dist/Resources/Sound/Sound.js +240 -0
  377. package/build/dist/Resources/Sound/Sound.js.map +1 -0
  378. package/build/dist/Resources/Sound/WebAudioInstance.js +160 -0
  379. package/build/dist/Resources/Sound/WebAudioInstance.js.map +1 -0
  380. package/build/dist/Scene.js +458 -0
  381. package/build/dist/Scene.js.map +1 -0
  382. package/build/dist/Screen.js +634 -0
  383. package/build/dist/Screen.js.map +1 -0
  384. package/build/dist/ScreenElement.js +29 -0
  385. package/build/dist/ScreenElement.js.map +1 -0
  386. package/build/dist/TileMap.js +488 -0
  387. package/build/dist/TileMap.js.map +1 -0
  388. package/build/dist/Timer.js +198 -0
  389. package/build/dist/Timer.js.map +1 -0
  390. package/build/dist/Traits/Index.js +5 -0
  391. package/build/dist/Traits/Index.js.map +1 -0
  392. package/build/dist/Traits/OffscreenCulling.js +35 -0
  393. package/build/dist/Traits/OffscreenCulling.js.map +1 -0
  394. package/build/dist/Trigger.js +113 -0
  395. package/build/dist/Trigger.js.map +1 -0
  396. package/build/dist/Util/Actors.js +19 -0
  397. package/build/dist/Util/Actors.js.map +1 -0
  398. package/build/dist/Util/Browser.js +66 -0
  399. package/build/dist/Util/Browser.js.map +1 -0
  400. package/build/dist/Util/Clock.js +219 -0
  401. package/build/dist/Util/Clock.js.map +1 -0
  402. package/build/dist/Util/CullingBox.js +104 -0
  403. package/build/dist/Util/CullingBox.js.map +1 -0
  404. package/build/dist/Util/Decorators.js +78 -0
  405. package/build/dist/Util/Decorators.js.map +1 -0
  406. package/build/dist/Util/Detector.js +167 -0
  407. package/build/dist/Util/Detector.js.map +1 -0
  408. package/build/dist/Util/DrawUtil.js +117 -0
  409. package/build/dist/Util/DrawUtil.js.map +1 -0
  410. package/build/dist/Util/EasingFunctions.js +118 -0
  411. package/build/dist/Util/EasingFunctions.js.map +1 -0
  412. package/build/dist/Util/Fps.js +47 -0
  413. package/build/dist/Util/Fps.js.map +1 -0
  414. package/build/dist/Util/Index.js +7 -0
  415. package/build/dist/Util/Index.js.map +1 -0
  416. package/build/dist/Util/Log.js +195 -0
  417. package/build/dist/Util/Log.js.map +1 -0
  418. package/build/dist/Util/Observable.js +60 -0
  419. package/build/dist/Util/Observable.js.map +1 -0
  420. package/build/dist/Util/Pool.js +66 -0
  421. package/build/dist/Util/Pool.js.map +1 -0
  422. package/build/dist/Util/SortedList.js +261 -0
  423. package/build/dist/Util/SortedList.js.map +1 -0
  424. package/build/dist/Util/Sound.js +22 -0
  425. package/build/dist/Util/Sound.js.map +1 -0
  426. package/build/dist/Util/Util.js +294 -0
  427. package/build/dist/Util/Util.js.map +1 -0
  428. package/build/dist/Util/Watch.js +67 -0
  429. package/build/dist/Util/Watch.js.map +1 -0
  430. package/build/dist/Util/WebAudio.js +62 -0
  431. package/build/dist/Util/WebAudio.js.map +1 -0
  432. package/build/dist/excalibur.js +101 -22
  433. package/build/dist/excalibur.js.map +1 -1
  434. package/build/dist/excalibur.min.js +1 -1
  435. package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
  436. package/build/dist/excalibur.min.js.map +1 -1
  437. package/build/dist/index.js +74 -0
  438. package/build/dist/index.js.map +1 -0
  439. package/build/esm/Engine.d.ts +4 -1
  440. package/build/esm/Graphics/Context/texture-loader.d.ts +8 -0
  441. package/build/esm/excalibur.js +101 -22
  442. package/build/esm/excalibur.js.map +1 -1
  443. package/build/esm/excalibur.min.js +1 -1
  444. package/build/esm/excalibur.min.js.LICENSE.txt +1 -1
  445. package/build/esm/excalibur.min.js.map +1 -1
  446. package/package.json +23 -22
@@ -0,0 +1,91 @@
1
+ import { RotationType } from '../RotationType';
2
+ import { TransformComponent } from '../../EntityComponentSystem/Components/TransformComponent';
3
+ import { MotionComponent } from '../../EntityComponentSystem/Components/MotionComponent';
4
+ import { TwoPI } from '../../Math/util';
5
+ export class RotateBy {
6
+ constructor(entity, angleRadiansOffset, speed, rotationType) {
7
+ this._started = false;
8
+ this._stopped = false;
9
+ this._tx = entity.get(TransformComponent);
10
+ this._motion = entity.get(MotionComponent);
11
+ this._speed = speed;
12
+ this._offset = angleRadiansOffset;
13
+ this._rotationType = rotationType || RotationType.ShortestPath;
14
+ }
15
+ update(_delta) {
16
+ if (!this._started) {
17
+ this._started = true;
18
+ this._start = this._tx.rotation;
19
+ this._currentNonCannonAngle = this._tx.rotation;
20
+ this._end = this._start + this._offset;
21
+ const distance1 = Math.abs(this._end - this._start);
22
+ const distance2 = TwoPI - distance1;
23
+ if (distance1 > distance2) {
24
+ this._shortDistance = distance2;
25
+ this._longDistance = distance1;
26
+ }
27
+ else {
28
+ this._shortDistance = distance1;
29
+ this._longDistance = distance2;
30
+ }
31
+ this._shortestPathIsPositive = (this._start - this._end + TwoPI) % TwoPI >= Math.PI;
32
+ switch (this._rotationType) {
33
+ case RotationType.ShortestPath:
34
+ this._distance = this._shortDistance;
35
+ if (this._shortestPathIsPositive) {
36
+ this._direction = 1;
37
+ }
38
+ else {
39
+ this._direction = -1;
40
+ }
41
+ break;
42
+ case RotationType.LongestPath:
43
+ this._distance = this._longDistance;
44
+ if (this._shortestPathIsPositive) {
45
+ this._direction = -1;
46
+ }
47
+ else {
48
+ this._direction = 1;
49
+ }
50
+ break;
51
+ case RotationType.Clockwise:
52
+ this._direction = 1;
53
+ if (this._shortDistance >= 0) {
54
+ this._distance = this._shortDistance;
55
+ }
56
+ else {
57
+ this._distance = this._longDistance;
58
+ }
59
+ break;
60
+ case RotationType.CounterClockwise:
61
+ this._direction = -1;
62
+ if (this._shortDistance <= 0) {
63
+ this._distance = this._shortDistance;
64
+ }
65
+ else {
66
+ this._distance = this._longDistance;
67
+ }
68
+ break;
69
+ }
70
+ }
71
+ this._motion.angularVelocity = this._direction * this._speed;
72
+ this._currentNonCannonAngle += this._direction * this._speed * (_delta / 1000);
73
+ if (this.isComplete()) {
74
+ this._tx.rotation = this._end;
75
+ this._motion.angularVelocity = 0;
76
+ this._stopped = true;
77
+ }
78
+ }
79
+ isComplete() {
80
+ const distanceTravelled = Math.abs(this._currentNonCannonAngle - this._start);
81
+ return this._stopped || distanceTravelled >= Math.abs(this._distance);
82
+ }
83
+ stop() {
84
+ this._motion.angularVelocity = 0;
85
+ this._stopped = true;
86
+ }
87
+ reset() {
88
+ this._started = false;
89
+ }
90
+ }
91
+ //# sourceMappingURL=RotateBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RotateBy.js","sourceRoot":"","sources":["../../../../src/engine/Actions/Action/RotateBy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,QAAQ;IAmBnB,YAAY,MAAc,EAAE,kBAA0B,EAAE,KAAa,EAAE,YAA2B;QAF1F,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,kBAAkB,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,YAAY,IAAI,YAAY,CAAC,YAAY,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;YAChC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,GAA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AC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,90 @@
1
+ import { RotationType } from '../RotationType';
2
+ import { TransformComponent } from '../../EntityComponentSystem/Components/TransformComponent';
3
+ import { MotionComponent } from '../../EntityComponentSystem/Components/MotionComponent';
4
+ import { TwoPI } from '../../Math/util';
5
+ export class RotateTo {
6
+ constructor(entity, angleRadians, speed, rotationType) {
7
+ this._started = false;
8
+ this._stopped = false;
9
+ this._tx = entity.get(TransformComponent);
10
+ this._motion = entity.get(MotionComponent);
11
+ this._end = angleRadians;
12
+ this._speed = speed;
13
+ this._rotationType = rotationType || RotationType.ShortestPath;
14
+ }
15
+ update(_delta) {
16
+ if (!this._started) {
17
+ this._started = true;
18
+ this._start = this._tx.rotation;
19
+ this._currentNonCannonAngle = this._tx.rotation;
20
+ const distance1 = Math.abs(this._end - this._start);
21
+ const distance2 = TwoPI - distance1;
22
+ if (distance1 > distance2) {
23
+ this._shortDistance = distance2;
24
+ this._longDistance = distance1;
25
+ }
26
+ else {
27
+ this._shortDistance = distance1;
28
+ this._longDistance = distance2;
29
+ }
30
+ this._shortestPathIsPositive = (this._start - this._end + TwoPI) % TwoPI >= Math.PI;
31
+ switch (this._rotationType) {
32
+ case RotationType.ShortestPath:
33
+ this._distance = this._shortDistance;
34
+ if (this._shortestPathIsPositive) {
35
+ this._direction = 1;
36
+ }
37
+ else {
38
+ this._direction = -1;
39
+ }
40
+ break;
41
+ case RotationType.LongestPath:
42
+ this._distance = this._longDistance;
43
+ if (this._shortestPathIsPositive) {
44
+ this._direction = -1;
45
+ }
46
+ else {
47
+ this._direction = 1;
48
+ }
49
+ break;
50
+ case RotationType.Clockwise:
51
+ this._direction = 1;
52
+ if (this._shortestPathIsPositive) {
53
+ this._distance = this._shortDistance;
54
+ }
55
+ else {
56
+ this._distance = this._longDistance;
57
+ }
58
+ break;
59
+ case RotationType.CounterClockwise:
60
+ this._direction = -1;
61
+ if (!this._shortestPathIsPositive) {
62
+ this._distance = this._shortDistance;
63
+ }
64
+ else {
65
+ this._distance = this._longDistance;
66
+ }
67
+ break;
68
+ }
69
+ }
70
+ this._motion.angularVelocity = this._direction * this._speed;
71
+ this._currentNonCannonAngle += this._direction * this._speed * (_delta / 1000);
72
+ if (this.isComplete()) {
73
+ this._tx.rotation = this._end;
74
+ this._motion.angularVelocity = 0;
75
+ this._stopped = true;
76
+ }
77
+ }
78
+ isComplete() {
79
+ const distanceTravelled = Math.abs(this._currentNonCannonAngle - this._start);
80
+ return this._stopped || distanceTravelled >= Math.abs(this._distance);
81
+ }
82
+ stop() {
83
+ this._motion.angularVelocity = 0;
84
+ this._stopped = true;
85
+ }
86
+ reset() {
87
+ this._started = false;
88
+ }
89
+ }
90
+ //# sourceMappingURL=RotateTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RotateTo.js","sourceRoot":"","sources":["../../../../src/engine/Actions/Action/RotateTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,QAAQ;IAiBnB,YAAY,MAAc,EAAE,YAAoB,EAAE,KAAa,EAAE,YAA2B;QAFpF,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,K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AAC,MAAM,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,QAAQ,IAAI,iBAAiB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxE,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,45 @@
1
+ import { Vector } from '../../Math/vector';
2
+ import { MotionComponent } from '../../EntityComponentSystem/Components/MotionComponent';
3
+ import { TransformComponent } from '../../EntityComponentSystem/Components/TransformComponent';
4
+ export class ScaleBy {
5
+ constructor(entity, scaleOffsetX, scaleOffsetY, speed) {
6
+ this._started = false;
7
+ this._stopped = false;
8
+ this._tx = entity.get(TransformComponent);
9
+ this._motion = entity.get(MotionComponent);
10
+ this._offset = new Vector(scaleOffsetX, scaleOffsetY);
11
+ this._speedX = this._speedY = speed;
12
+ }
13
+ update(_delta) {
14
+ if (!this._started) {
15
+ this._started = true;
16
+ this._startScale = this._tx.scale.clone();
17
+ this._endScale = this._startScale.add(this._offset);
18
+ this._distanceX = Math.abs(this._endScale.x - this._startScale.x);
19
+ this._distanceY = Math.abs(this._endScale.y - this._startScale.y);
20
+ this._directionX = this._endScale.x < this._startScale.x ? -1 : 1;
21
+ this._directionY = this._endScale.y < this._startScale.y ? -1 : 1;
22
+ }
23
+ this._motion.scaleFactor.x = this._speedX * this._directionX;
24
+ this._motion.scaleFactor.y = this._speedY * this._directionY;
25
+ if (this.isComplete()) {
26
+ this._tx.scale = this._endScale;
27
+ this._motion.scaleFactor.x = 0;
28
+ this._motion.scaleFactor.y = 0;
29
+ }
30
+ }
31
+ isComplete() {
32
+ return (this._stopped ||
33
+ (Math.abs(this._tx.scale.x - this._startScale.x) >= this._distanceX &&
34
+ Math.abs(this._tx.scale.y - this._startScale.y) >= this._distanceY));
35
+ }
36
+ stop() {
37
+ this._motion.scaleFactor.x = 0;
38
+ this._motion.scaleFactor.y = 0;
39
+ this._stopped = true;
40
+ }
41
+ reset() {
42
+ this._started = false;
43
+ }
44
+ }
45
+ //# sourceMappingURL=ScaleBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScaleBy.js","sourceRoot":"","sources":["../../../../src/engine/Actions/Action/ScaleBy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAG/F,MAAM,OAAO,OAAO;IAgBlB,YAAY,MAAc,EAAE,YAAoB,EAAE,YAAoB,EAAE,KAAa;QAJ7E,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAIvB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtC,CAAC;IAEM,MAAM,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,UAAU,GAA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AG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CACtE,CAAC;IACJ,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,56 @@
1
+ import { vec } from '../../Math/vector';
2
+ import { MotionComponent } from '../../EntityComponentSystem/Components/MotionComponent';
3
+ import { TransformComponent } from '../../EntityComponentSystem/Components/TransformComponent';
4
+ export class ScaleTo {
5
+ constructor(entity, scaleX, scaleY, speedX, speedY) {
6
+ this._started = false;
7
+ this._stopped = false;
8
+ this._tx = entity.get(TransformComponent);
9
+ this._motion = entity.get(MotionComponent);
10
+ this._endX = scaleX;
11
+ this._endY = scaleY;
12
+ this._speedX = speedX;
13
+ this._speedY = speedY;
14
+ }
15
+ update(_delta) {
16
+ if (!this._started) {
17
+ this._started = true;
18
+ this._startX = this._tx.scale.x;
19
+ this._startY = this._tx.scale.y;
20
+ this._distanceX = Math.abs(this._endX - this._startX);
21
+ this._distanceY = Math.abs(this._endY - this._startY);
22
+ }
23
+ if (!(Math.abs(this._tx.scale.x - this._startX) >= this._distanceX)) {
24
+ const directionX = this._endY < this._startY ? -1 : 1;
25
+ this._motion.scaleFactor.x = this._speedX * directionX;
26
+ }
27
+ else {
28
+ this._motion.scaleFactor.x = 0;
29
+ }
30
+ if (!(Math.abs(this._tx.scale.y - this._startY) >= this._distanceY)) {
31
+ const directionY = this._endY < this._startY ? -1 : 1;
32
+ this._motion.scaleFactor.y = this._speedY * directionY;
33
+ }
34
+ else {
35
+ this._motion.scaleFactor.y = 0;
36
+ }
37
+ if (this.isComplete()) {
38
+ this._tx.scale = vec(this._endX, this._endY);
39
+ this._motion.scaleFactor.x = 0;
40
+ this._motion.scaleFactor.y = 0;
41
+ }
42
+ }
43
+ isComplete() {
44
+ return (this._stopped ||
45
+ (Math.abs(this._tx.scale.y - this._startX) >= this._distanceX && Math.abs(this._tx.scale.y - this._startY) >= this._distanceY));
46
+ }
47
+ stop() {
48
+ this._motion.scaleFactor.x = 0;
49
+ this._motion.scaleFactor.y = 0;
50
+ this._stopped = true;
51
+ }
52
+ reset() {
53
+ this._started = false;
54
+ }
55
+ }
56
+ //# sourceMappingURL=ScaleTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScaleTo.js","sourceRoot":"","sources":["../../../../src/engine/Actions/Action/ScaleTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAI/F,MAAM,OAAO,OAAO;IAelB,YAAY,MAAc,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc;QAFlF,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC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,CAAC,OAAO,GAAG,UAAU,CAAC;SACxD;aAAM;YACL,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;QAED,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YACrB,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;SAChC;IACH,CAAC;IAEM,UAAU;QACf,OAAO,CACL,IAAI,CAAC,QAAQ;YACb,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAC/H,CAAC;IACJ,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../src/engine/Actions/Action.ts"],"names":[],"mappings":""}
@@ -0,0 +1,305 @@
1
+ import { EasingFunctions } from '../Util/EasingFunctions';
2
+ import { ActionQueue } from './ActionQueue';
3
+ import { Repeat } from './Action/Repeat';
4
+ import { RepeatForever } from './Action/RepeatForever';
5
+ import { MoveBy } from './Action/MoveBy';
6
+ import { MoveTo } from './Action/MoveTo';
7
+ import { RotateTo } from './Action/RotateTo';
8
+ import { RotateBy } from './Action/RotateBy';
9
+ import { ScaleTo } from './Action/ScaleTo';
10
+ import { ScaleBy } from './Action/ScaleBy';
11
+ import { CallMethod } from './Action/CallMethod';
12
+ import { EaseTo } from './Action/EaseTo';
13
+ import { Blink } from './Action/Blink';
14
+ import { Fade } from './Action/Fade';
15
+ import { Delay } from './Action/Delay';
16
+ import { Die } from './Action/Die';
17
+ import { Follow } from './Action/Follow';
18
+ import { Meet } from './Action/Meet';
19
+ import { Vector } from '../Math/vector';
20
+ /**
21
+ * The fluent Action API allows you to perform "actions" on
22
+ * [[Actor|Actors]] such as following, moving, rotating, and
23
+ * more. You can implement your own actions by implementing
24
+ * the [[Action]] interface.
25
+ */
26
+ export class ActionContext {
27
+ constructor(entity) {
28
+ this._entity = entity;
29
+ this._queue = new ActionQueue(entity);
30
+ }
31
+ getQueue() {
32
+ return this._queue;
33
+ }
34
+ update(elapsedMs) {
35
+ this._queue.update(elapsedMs);
36
+ }
37
+ /**
38
+ * Clears all queued actions from the Actor
39
+ */
40
+ clearActions() {
41
+ this._queue.clearActions();
42
+ }
43
+ easeTo(...args) {
44
+ var _a, _b;
45
+ let x = 0;
46
+ let y = 0;
47
+ let duration = 0;
48
+ let easingFcn = EasingFunctions.Linear;
49
+ if (args[0] instanceof Vector) {
50
+ x = args[0].x;
51
+ y = args[0].y;
52
+ duration = args[1];
53
+ easingFcn = (_a = args[2]) !== null && _a !== void 0 ? _a : easingFcn;
54
+ }
55
+ else {
56
+ x = args[0];
57
+ y = args[1];
58
+ duration = args[2];
59
+ easingFcn = (_b = args[3]) !== null && _b !== void 0 ? _b : easingFcn;
60
+ }
61
+ this._queue.add(new EaseTo(this._entity, x, y, duration, easingFcn));
62
+ return this;
63
+ }
64
+ moveTo(xOrPos, yOrSpeed, speedOrUndefined) {
65
+ let x = 0;
66
+ let y = 0;
67
+ let speed = 0;
68
+ if (xOrPos instanceof Vector) {
69
+ x = xOrPos.x;
70
+ y = xOrPos.y;
71
+ speed = yOrSpeed;
72
+ }
73
+ else {
74
+ x = xOrPos;
75
+ y = yOrSpeed;
76
+ speed = speedOrUndefined;
77
+ }
78
+ this._queue.add(new MoveTo(this._entity, x, y, speed));
79
+ return this;
80
+ }
81
+ moveBy(xOffsetOrVector, yOffsetOrSpeed, speedOrUndefined) {
82
+ let xOffset = 0;
83
+ let yOffset = 0;
84
+ let speed = 0;
85
+ if (xOffsetOrVector instanceof Vector) {
86
+ xOffset = xOffsetOrVector.x;
87
+ yOffset = xOffsetOrVector.y;
88
+ speed = yOffsetOrSpeed;
89
+ }
90
+ else {
91
+ xOffset = xOffsetOrVector;
92
+ yOffset = yOffsetOrSpeed;
93
+ speed = speedOrUndefined;
94
+ }
95
+ this._queue.add(new MoveBy(this._entity, xOffset, yOffset, speed));
96
+ return this;
97
+ }
98
+ /**
99
+ * This method will rotate an actor to the specified angle at the speed
100
+ * specified (in radians per second) and return back the actor. This
101
+ * method is part of the actor 'Action' fluent API allowing action chaining.
102
+ * @param angleRadians The angle to rotate to in radians
103
+ * @param speed The angular velocity of the rotation specified in radians per second
104
+ * @param rotationType The [[RotationType]] to use for this rotation
105
+ */
106
+ rotateTo(angleRadians, speed, rotationType) {
107
+ this._queue.add(new RotateTo(this._entity, angleRadians, speed, rotationType));
108
+ return this;
109
+ }
110
+ /**
111
+ * This method will rotate an actor by the specified angle offset, from it's current rotation given a certain speed
112
+ * in radians/sec and return back the actor. This method is part
113
+ * of the actor 'Action' fluent API allowing action chaining.
114
+ * @param angleRadiansOffset The angle to rotate to in radians relative to the current rotation
115
+ * @param speed The speed in radians/sec the actor should rotate at
116
+ * @param rotationType The [[RotationType]] to use for this rotation, default is shortest path
117
+ */
118
+ rotateBy(angleRadiansOffset, speed, rotationType) {
119
+ this._queue.add(new RotateBy(this._entity, angleRadiansOffset, speed, rotationType));
120
+ return this;
121
+ }
122
+ scaleTo(sizeXOrVector, sizeYOrSpeed, speedXOrUndefined, speedYOrUndefined) {
123
+ let sizeX = 1;
124
+ let sizeY = 1;
125
+ let speedX = 0;
126
+ let speedY = 0;
127
+ if (sizeXOrVector instanceof Vector && sizeYOrSpeed instanceof Vector) {
128
+ sizeX = sizeXOrVector.x;
129
+ sizeY = sizeXOrVector.y;
130
+ speedX = sizeYOrSpeed.x;
131
+ speedY = sizeYOrSpeed.y;
132
+ }
133
+ if (typeof sizeXOrVector === 'number' && typeof sizeYOrSpeed === 'number') {
134
+ sizeX = sizeXOrVector;
135
+ sizeY = sizeYOrSpeed;
136
+ speedX = speedXOrUndefined;
137
+ speedY = speedYOrUndefined;
138
+ }
139
+ this._queue.add(new ScaleTo(this._entity, sizeX, sizeY, speedX, speedY));
140
+ return this;
141
+ }
142
+ scaleBy(sizeOffsetXOrVector, sizeOffsetYOrSpeed, speed) {
143
+ let sizeOffsetX = 1;
144
+ let sizeOffsetY = 1;
145
+ if (sizeOffsetXOrVector instanceof Vector) {
146
+ sizeOffsetX = sizeOffsetXOrVector.x;
147
+ sizeOffsetY = sizeOffsetXOrVector.y;
148
+ speed = sizeOffsetYOrSpeed;
149
+ }
150
+ if (typeof sizeOffsetXOrVector === 'number' && typeof sizeOffsetYOrSpeed === 'number') {
151
+ sizeOffsetX = sizeOffsetXOrVector;
152
+ sizeOffsetY = sizeOffsetYOrSpeed;
153
+ }
154
+ this._queue.add(new ScaleBy(this._entity, sizeOffsetX, sizeOffsetY, speed));
155
+ return this;
156
+ }
157
+ /**
158
+ * This method will cause an actor to blink (become visible and not
159
+ * visible). Optionally, you may specify the number of blinks. Specify the amount of time
160
+ * the actor should be visible per blink, and the amount of time not visible.
161
+ * This method is part of the actor 'Action' fluent API allowing action chaining.
162
+ * @param timeVisible The amount of time to stay visible per blink in milliseconds
163
+ * @param timeNotVisible The amount of time to stay not visible per blink in milliseconds
164
+ * @param numBlinks The number of times to blink
165
+ */
166
+ blink(timeVisible, timeNotVisible, numBlinks = 1) {
167
+ this._queue.add(new Blink(this._entity, timeVisible, timeNotVisible, numBlinks));
168
+ return this;
169
+ }
170
+ /**
171
+ * This method will cause an actor's opacity to change from its current value
172
+ * to the provided value by a specified time (in milliseconds). This method is
173
+ * part of the actor 'Action' fluent API allowing action chaining.
174
+ * @param opacity The ending opacity
175
+ * @param time The time it should take to fade the actor (in milliseconds)
176
+ */
177
+ fade(opacity, time) {
178
+ this._queue.add(new Fade(this._entity, opacity, time));
179
+ return this;
180
+ }
181
+ /**
182
+ * This method will delay the next action from executing for a certain
183
+ * amount of time (in milliseconds). This method is part of the actor
184
+ * 'Action' fluent API allowing action chaining.
185
+ * @param time The amount of time to delay the next action in the queue from executing in milliseconds
186
+ */
187
+ delay(time) {
188
+ this._queue.add(new Delay(time));
189
+ return this;
190
+ }
191
+ /**
192
+ * This method will add an action to the queue that will remove the actor from the
193
+ * scene once it has completed its previous Any actions on the
194
+ * action queue after this action will not be executed.
195
+ */
196
+ die() {
197
+ this._queue.add(new Die(this._entity));
198
+ return this;
199
+ }
200
+ /**
201
+ * This method allows you to call an arbitrary method as the next action in the
202
+ * action queue. This is useful if you want to execute code in after a specific
203
+ * action, i.e An actor arrives at a destination after traversing a path
204
+ */
205
+ callMethod(method) {
206
+ this._queue.add(new CallMethod(method));
207
+ return this;
208
+ }
209
+ /**
210
+ * This method will cause the actor to repeat all of the actions built in
211
+ * the `repeatBuilder` callback. If the number of repeats
212
+ * is not specified it will repeat forever. This method is part of
213
+ * the actor 'Action' fluent API allowing action chaining
214
+ *
215
+ * ```typescript
216
+ * // Move up in a zig-zag by repeated moveBy's
217
+ * actor.actions.repeat(repeatCtx => {
218
+ * repeatCtx.moveBy(10, 0, 10);
219
+ * repeatCtx.moveBy(0, 10, 10);
220
+ * }, 5);
221
+ * ```
222
+ *
223
+ * @param repeatBuilder The builder to specify the repeatable list of actions
224
+ * @param times The number of times to repeat all the previous actions in the action queue. If nothing is specified the actions
225
+ * will repeat forever
226
+ */
227
+ repeat(repeatBuilder, times) {
228
+ if (!times) {
229
+ this.repeatForever(repeatBuilder);
230
+ return this;
231
+ }
232
+ this._queue.add(new Repeat(this._entity, repeatBuilder, times));
233
+ return this;
234
+ }
235
+ /**
236
+ * This method will cause the actor to repeat all of the actions built in
237
+ * the `repeatBuilder` callback. If the number of repeats
238
+ * is not specified it will repeat forever. This method is part of
239
+ * the actor 'Action' fluent API allowing action chaining
240
+ *
241
+ * ```typescript
242
+ * // Move up in a zig-zag by repeated moveBy's
243
+ * actor.actions.repeat(repeatCtx => {
244
+ * repeatCtx.moveBy(10, 0, 10);
245
+ * repeatCtx.moveBy(0, 10, 10);
246
+ * }, 5);
247
+ * ```
248
+ *
249
+ * @param repeatBuilder The builder to specify the repeatable list of actions
250
+ */
251
+ repeatForever(repeatBuilder) {
252
+ this._queue.add(new RepeatForever(this._entity, repeatBuilder));
253
+ return this;
254
+ }
255
+ /**
256
+ * This method will cause the entity to follow another at a specified distance
257
+ * @param entity The entity to follow
258
+ * @param followDistance The distance to maintain when following, if not specified the actor will follow at the current distance.
259
+ */
260
+ follow(entity, followDistance) {
261
+ if (followDistance === undefined) {
262
+ this._queue.add(new Follow(this._entity, entity));
263
+ }
264
+ else {
265
+ this._queue.add(new Follow(this._entity, entity, followDistance));
266
+ }
267
+ return this;
268
+ }
269
+ /**
270
+ * This method will cause the entity to move towards another until they
271
+ * collide "meet" at a specified speed.
272
+ * @param entity The entity to meet
273
+ * @param speed The speed in pixels per second to move, if not specified it will match the speed of the other actor
274
+ */
275
+ meet(entity, speed) {
276
+ if (speed === undefined) {
277
+ this._queue.add(new Meet(this._entity, entity));
278
+ }
279
+ else {
280
+ this._queue.add(new Meet(this._entity, entity, speed));
281
+ }
282
+ return this;
283
+ }
284
+ /**
285
+ * Returns a promise that resolves when the current action queue up to now
286
+ * is finished.
287
+ * @deprecated Use `toPromise()` will be removed in v0.26.0
288
+ */
289
+ asPromise() {
290
+ return this.toPromise();
291
+ }
292
+ /**
293
+ * Returns a promise that resolves when the current action queue up to now
294
+ * is finished.
295
+ */
296
+ toPromise() {
297
+ const temp = new Promise((resolve) => {
298
+ this._queue.add(new CallMethod(() => {
299
+ resolve();
300
+ }));
301
+ });
302
+ return temp;
303
+ }
304
+ }
305
+ //# sourceMappingURL=ActionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionContext.js","sourceRoot":"","sources":["../../../src/engine/Actions/ActionContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,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