@vpmedia/phaser 1.95.0 → 1.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +10 -10
  3. package/src/phaser/core/animation.js +61 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/cache.js +154 -154
  6. package/src/phaser/core/device.js +2 -1
  7. package/src/phaser/core/device_util.js +27 -27
  8. package/src/phaser/core/dom.js +43 -43
  9. package/src/phaser/core/event_manager.js +63 -63
  10. package/src/phaser/core/factory.js +47 -47
  11. package/src/phaser/core/frame.js +30 -30
  12. package/src/phaser/core/frame_data.js +30 -28
  13. package/src/phaser/core/frame_util.js +8 -8
  14. package/src/phaser/core/game.js +34 -18
  15. package/src/phaser/core/loader.js +170 -170
  16. package/src/phaser/core/loader_parser.js +22 -22
  17. package/src/phaser/core/raf.js +1 -1
  18. package/src/phaser/core/scene.js +16 -10
  19. package/src/phaser/core/scene_manager.js +51 -43
  20. package/src/phaser/core/signal.js +68 -52
  21. package/src/phaser/core/signal.test.js +37 -0
  22. package/src/phaser/core/sound.js +54 -54
  23. package/src/phaser/core/sound_manager.js +49 -49
  24. package/src/phaser/core/stage.js +16 -16
  25. package/src/phaser/core/time.js +30 -30
  26. package/src/phaser/core/timer.js +79 -64
  27. package/src/phaser/core/timer_event.js +9 -9
  28. package/src/phaser/core/tween.js +90 -90
  29. package/src/phaser/core/tween_data.js +30 -30
  30. package/src/phaser/core/tween_manager.js +29 -24
  31. package/src/phaser/core/world.js +4 -3
  32. package/src/phaser/display/bitmap_text.js +61 -54
  33. package/src/phaser/display/button.js +48 -47
  34. package/src/phaser/display/canvas/buffer.js +8 -8
  35. package/src/phaser/display/canvas/graphics.js +8 -8
  36. package/src/phaser/display/canvas/masker.js +5 -5
  37. package/src/phaser/display/canvas/pool.js +18 -18
  38. package/src/phaser/display/canvas/renderer.js +16 -16
  39. package/src/phaser/display/canvas/tinter.js +22 -22
  40. package/src/phaser/display/canvas/util.js +42 -42
  41. package/src/phaser/display/display_object.js +119 -108
  42. package/src/phaser/display/graphics.js +112 -112
  43. package/src/phaser/display/graphics_data.js +10 -10
  44. package/src/phaser/display/graphics_data_util.js +3 -3
  45. package/src/phaser/display/group.js +50 -50
  46. package/src/phaser/display/image.js +54 -50
  47. package/src/phaser/display/sprite_batch.js +2 -2
  48. package/src/phaser/display/sprite_util.js +19 -19
  49. package/src/phaser/display/text.js +212 -187
  50. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  51. package/src/phaser/display/webgl/base_texture.js +9 -9
  52. package/src/phaser/display/webgl/blend_manager.js +7 -7
  53. package/src/phaser/display/webgl/earcut.js +95 -95
  54. package/src/phaser/display/webgl/earcut_node.js +4 -4
  55. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  56. package/src/phaser/display/webgl/filter_manager.js +9 -9
  57. package/src/phaser/display/webgl/filter_texture.js +10 -10
  58. package/src/phaser/display/webgl/graphics.js +37 -37
  59. package/src/phaser/display/webgl/graphics_data.js +4 -4
  60. package/src/phaser/display/webgl/mask_manager.js +6 -6
  61. package/src/phaser/display/webgl/render_texture.js +16 -16
  62. package/src/phaser/display/webgl/renderer.js +20 -20
  63. package/src/phaser/display/webgl/shader/complex.js +4 -4
  64. package/src/phaser/display/webgl/shader/fast.js +4 -4
  65. package/src/phaser/display/webgl/shader/normal.js +8 -8
  66. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  67. package/src/phaser/display/webgl/shader/strip.js +4 -4
  68. package/src/phaser/display/webgl/shader_manager.js +9 -9
  69. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  70. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  71. package/src/phaser/display/webgl/texture.js +13 -13
  72. package/src/phaser/display/webgl/texture_util.js +8 -8
  73. package/src/phaser/display/webgl/util.js +25 -25
  74. package/src/phaser/geom/circle.js +69 -69
  75. package/src/phaser/geom/circle.test.js +1 -0
  76. package/src/phaser/geom/ellipse.js +28 -28
  77. package/src/phaser/geom/ellipse.test.js +1 -0
  78. package/src/phaser/geom/line.js +93 -93
  79. package/src/phaser/geom/line.test.js +1 -0
  80. package/src/phaser/geom/matrix.js +54 -54
  81. package/src/phaser/geom/matrix.test.js +1 -0
  82. package/src/phaser/geom/point.js +96 -96
  83. package/src/phaser/geom/point.test.js +1 -0
  84. package/src/phaser/geom/polygon.js +22 -22
  85. package/src/phaser/geom/rectangle.js +132 -132
  86. package/src/phaser/geom/rectangle.test.js +1 -0
  87. package/src/phaser/geom/rounded_rectangle.js +12 -12
  88. package/src/phaser/geom/rounded_rectangle.test.js +1 -0
  89. package/src/phaser/geom/util/circle.js +33 -33
  90. package/src/phaser/geom/util/circle.test.js +1 -0
  91. package/src/phaser/geom/util/ellipse.js +5 -5
  92. package/src/phaser/geom/util/ellipse.test.js +1 -0
  93. package/src/phaser/geom/util/line.js +26 -26
  94. package/src/phaser/geom/util/line.test.js +1 -0
  95. package/src/phaser/geom/util/matrix.js +8 -8
  96. package/src/phaser/geom/util/matrix.test.js +1 -0
  97. package/src/phaser/geom/util/point.js +97 -97
  98. package/src/phaser/geom/util/point.test.js +1 -0
  99. package/src/phaser/geom/util/polygon.js +4 -4
  100. package/src/phaser/geom/util/polygon.test.js +1 -0
  101. package/src/phaser/geom/util/rectangle.js +74 -74
  102. package/src/phaser/geom/util/rectangle.test.js +1 -0
  103. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  104. package/src/phaser/geom/util/rounded_rectangle.test.js +1 -0
  105. package/src/phaser/util/math.js +81 -81
  106. package/src/phaser/util/math.test.js +1 -0
  107. package/types/phaser/core/animation.d.ts +61 -56
  108. package/types/phaser/core/animation.d.ts.map +1 -1
  109. package/types/phaser/core/animation_manager.d.ts +55 -55
  110. package/types/phaser/core/cache.d.ts +154 -154
  111. package/types/phaser/core/device.d.ts.map +1 -1
  112. package/types/phaser/core/dom.d.ts +43 -43
  113. package/types/phaser/core/event_manager.d.ts +63 -63
  114. package/types/phaser/core/factory.d.ts +47 -47
  115. package/types/phaser/core/frame.d.ts +30 -30
  116. package/types/phaser/core/frame_data.d.ts +28 -27
  117. package/types/phaser/core/frame_data.d.ts.map +1 -1
  118. package/types/phaser/core/game.d.ts +52 -19
  119. package/types/phaser/core/game.d.ts.map +1 -1
  120. package/types/phaser/core/loader.d.ts +170 -170
  121. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  122. package/types/phaser/core/raf.d.ts +1 -1
  123. package/types/phaser/core/scene.d.ts +15 -9
  124. package/types/phaser/core/scene.d.ts.map +1 -1
  125. package/types/phaser/core/scene_manager.d.ts +51 -43
  126. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  127. package/types/phaser/core/signal.d.ts +54 -51
  128. package/types/phaser/core/signal.d.ts.map +1 -1
  129. package/types/phaser/core/sound.d.ts +54 -54
  130. package/types/phaser/core/sound_manager.d.ts +49 -49
  131. package/types/phaser/core/stage.d.ts +10 -10
  132. package/types/phaser/core/time.d.ts +30 -30
  133. package/types/phaser/core/timer.d.ts +64 -64
  134. package/types/phaser/core/timer_event.d.ts +9 -9
  135. package/types/phaser/core/tween.d.ts +90 -90
  136. package/types/phaser/core/tween_data.d.ts +30 -30
  137. package/types/phaser/core/tween_manager.d.ts +29 -24
  138. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  139. package/types/phaser/core/world.d.ts +4 -3
  140. package/types/phaser/core/world.d.ts.map +1 -1
  141. package/types/phaser/display/bitmap_text.d.ts +59 -52
  142. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  143. package/types/phaser/display/button.d.ts +47 -46
  144. package/types/phaser/display/button.d.ts.map +1 -1
  145. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  146. package/types/phaser/display/canvas/renderer.d.ts +16 -16
  147. package/types/phaser/display/display_object.d.ts +119 -108
  148. package/types/phaser/display/display_object.d.ts.map +1 -1
  149. package/types/phaser/display/graphics.d.ts +101 -101
  150. package/types/phaser/display/graphics_data.d.ts +10 -10
  151. package/types/phaser/display/group.d.ts +47 -47
  152. package/types/phaser/display/image.d.ts +42 -40
  153. package/types/phaser/display/image.d.ts.map +1 -1
  154. package/types/phaser/display/text.d.ts +207 -184
  155. package/types/phaser/display/text.d.ts.map +1 -1
  156. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  157. package/types/phaser/display/webgl/base_texture.d.ts +9 -9
  158. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  159. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  160. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  161. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  162. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  163. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  164. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  165. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  166. package/types/phaser/display/webgl/renderer.d.ts +20 -20
  167. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  168. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  169. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  170. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  171. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  172. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  173. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  174. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  175. package/types/phaser/display/webgl/texture.d.ts +12 -12
  176. package/types/phaser/geom/circle.d.ts +69 -69
  177. package/types/phaser/geom/ellipse.d.ts +28 -28
  178. package/types/phaser/geom/line.d.ts +93 -93
  179. package/types/phaser/geom/matrix.d.ts +54 -54
  180. package/types/phaser/geom/point.d.ts +96 -96
  181. package/types/phaser/geom/polygon.d.ts +22 -22
  182. package/types/phaser/geom/rectangle.d.ts +132 -132
  183. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  184. package/pnpm-workspace.yaml +0 -4
@@ -5,10 +5,10 @@ import { TweenData } from './tween_data.js';
5
5
 
6
6
  export class Tween {
7
7
  /**
8
- * TBD.
9
- * @param {import('../display/display_object.js').DisplayObject} target - TBD.
10
- * @param {import('./game.js').Game} game - TBD.
11
- * @param {import('./tween_manager.js').TweenManager} manager - TBD.
8
+ * Creates a new Tween instance.
9
+ * @param {import('../display/display_object.js').DisplayObject} target - The object to tween.
10
+ * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.
11
+ * @param {import('./tween_manager.js').TweenManager} manager - Reference to the Tween Manager.
12
12
  */
13
13
  constructor(target, game, manager) {
14
14
  this.game = game;
@@ -54,15 +54,15 @@ export class Tween {
54
54
  }
55
55
 
56
56
  /**
57
- * TBD.
58
- * @param {object} properties - TBD.
59
- * @param {number} duration - TBD.
60
- * @param {string | Function} ease - TBD.
61
- * @param {boolean} autoStart - TBD.
62
- * @param {number} delay - TBD.
63
- * @param {number} repeat - TBD.
64
- * @param {boolean} yoyo - TBD.
65
- * @returns {Tween} TBD.
57
+ * Adds a tween to the timeline that animates properties to their target values.
58
+ * @param {object} properties - The properties to tween and their target values.
59
+ * @param {number} duration - The duration of the tween in milliseconds.
60
+ * @param {string | Function} ease - The easing function to use.
61
+ * @param {boolean} autoStart - Whether to start the tween immediately.
62
+ * @param {number} delay - The delay before starting the tween in milliseconds.
63
+ * @param {number} repeat - Number of times to repeat the tween.
64
+ * @param {boolean} yoyo - Whether to reverse the tween on repeat.
65
+ * @returns {Tween} This Tween object for chaining.
66
66
  */
67
67
  to(properties, duration = 1000, ease = 'Linear', autoStart = false, delay = 0, repeat = 0, yoyo = false) {
68
68
  if (typeof ease === 'string' && this.manager.easeMap[ease]) {
@@ -80,15 +80,15 @@ export class Tween {
80
80
  }
81
81
 
82
82
  /**
83
- * TBD.
84
- * @param {object} properties - TBD.
85
- * @param {number} duration - TBD.
86
- * @param {string | Function} ease - TBD.
87
- * @param {boolean} autoStart - TBD.
88
- * @param {number} delay - TBD.
89
- * @param {number} repeat - TBD.
90
- * @param {boolean} yoyo - TBD.
91
- * @returns {Tween} TBD.
83
+ * Adds a tween to the timeline that animates properties from their current values.
84
+ * @param {object} properties - The properties to tween and their target values.
85
+ * @param {number} duration - The duration of the tween in milliseconds.
86
+ * @param {string | Function} ease - The easing function to use.
87
+ * @param {boolean} autoStart - Whether to start the tween immediately.
88
+ * @param {number} delay - The delay before starting the tween in milliseconds.
89
+ * @param {number} repeat - Number of times to repeat the tween.
90
+ * @param {boolean} yoyo - Whether to reverse the tween on repeat.
91
+ * @returns {Tween} This Tween object for chaining.
92
92
  */
93
93
  from(properties, duration = 1000, ease = 'Linear', autoStart = false, delay = 0, repeat = 0, yoyo = false) {
94
94
  if (typeof ease === 'string' && this.manager.easeMap[ease]) {
@@ -107,9 +107,9 @@ export class Tween {
107
107
  }
108
108
 
109
109
  /**
110
- * TBD.
111
- * @param {number} index - TBD.
112
- * @returns {Tween} TBD.
110
+ * Starts the tween timeline from a specific index.
111
+ * @param {number} index - The index to start from in the timeline.
112
+ * @returns {Tween} This Tween object for chaining.
113
113
  */
114
114
  start(index = 0) {
115
115
  if (this.game === null || this.target === null || this.timeline.length === 0 || this.isRunning) {
@@ -142,9 +142,9 @@ export class Tween {
142
142
  }
143
143
 
144
144
  /**
145
- * TBD.
146
- * @param {boolean} complete - TBD.
147
- * @returns {Tween} TBD.
145
+ * Stops the tween and optionally completes it.
146
+ * @param {boolean} complete - Whether to dispatch the complete event.
147
+ * @returns {Tween} This Tween object for chaining.
148
148
  */
149
149
  stop(complete = false) {
150
150
  this.isRunning = false;
@@ -162,11 +162,11 @@ export class Tween {
162
162
  }
163
163
 
164
164
  /**
165
- * TBD.
166
- * @param {string} property - TBD.
167
- * @param {object} value - TBD.
168
- * @param {number} index - TBD.
169
- * @returns {Tween} TBD.
165
+ * Updates a property in the tween data.
166
+ * @param {string} property - The property name to update.
167
+ * @param {object} value - The new value for the property.
168
+ * @param {number} index - The index in the timeline to update.
169
+ * @returns {Tween} This Tween object for chaining.
170
170
  */
171
171
  updateTweenData(property, value, index = 0) {
172
172
  if (this.timeline.length === 0) {
@@ -183,21 +183,21 @@ export class Tween {
183
183
  }
184
184
 
185
185
  /**
186
- * TBD.
187
- * @param {number} duration - TBD.
188
- * @param {number} index - TBD.
189
- * @returns {Tween} TBD.
186
+ * Sets a delay for a specific timeline entry.
187
+ * @param {number} duration - The delay in milliseconds.
188
+ * @param {number} index - The index in the timeline to apply the delay to.
189
+ * @returns {Tween} This Tween object for chaining.
190
190
  */
191
191
  delay(duration, index) {
192
192
  return this.updateTweenData('delay', duration, index);
193
193
  }
194
194
 
195
195
  /**
196
- * TBD.
197
- * @param {number} total - TBD.
198
- * @param {number} repeatDelay - TBD.
199
- * @param {number} index - TBD.
200
- * @returns {Tween} TBD.
196
+ * Sets how many times to repeat the tween.
197
+ * @param {number} total - The number of times to repeat (-1 for infinite).
198
+ * @param {number} repeatDelay - Delay between repeats in milliseconds.
199
+ * @param {number} index - The index in the timeline to apply the repeat to.
200
+ * @returns {Tween} This Tween object for chaining.
201
201
  */
202
202
  repeat(total, repeatDelay = 0, index = 0) {
203
203
  this.updateTweenData('repeatCounter', total, index);
@@ -205,21 +205,21 @@ export class Tween {
205
205
  }
206
206
 
207
207
  /**
208
- * TBD.
209
- * @param {number} duration - TBD.
210
- * @param {number} index - TBD.
211
- * @returns {Tween} TBD.
208
+ * Sets the repeat delay for a specific timeline entry.
209
+ * @param {number} duration - The delay between repeats in milliseconds.
210
+ * @param {number} index - The index in the timeline to apply the delay to.
211
+ * @returns {Tween} This Tween object for chaining.
212
212
  */
213
213
  repeatDelay(duration, index) {
214
214
  return this.updateTweenData('repeatDelay', duration, index);
215
215
  }
216
216
 
217
217
  /**
218
- * TBD.
219
- * @param {boolean} enable - TBD.
220
- * @param {number} yoyoDelay - TBD.
221
- * @param {number} index - TBD.
222
- * @returns {Tween} TBD.
218
+ * Enables or disables yoyo behavior for a timeline entry.
219
+ * @param {boolean} enable - Whether to enable yoyo behavior.
220
+ * @param {number} yoyoDelay - Delay between yoyo cycles in milliseconds.
221
+ * @param {number} index - The index in the timeline to apply yoyo to.
222
+ * @returns {Tween} This Tween object for chaining.
223
223
  */
224
224
  yoyo(enable, yoyoDelay = 0, index = 0) {
225
225
  this.updateTweenData('yoyo', enable, index);
@@ -227,20 +227,20 @@ export class Tween {
227
227
  }
228
228
 
229
229
  /**
230
- * TBD.
231
- * @param {number} duration - TBD.
232
- * @param {number} index - TBD.
233
- * @returns {Tween} TBD.
230
+ * Sets the yoyo delay for a specific timeline entry.
231
+ * @param {number} duration - The delay between yoyo cycles in milliseconds.
232
+ * @param {number} index - The index in the timeline to apply the delay to.
233
+ * @returns {Tween} This Tween object for chaining.
234
234
  */
235
235
  yoyoDelay(duration, index) {
236
236
  return this.updateTweenData('yoyoDelay', duration, index);
237
237
  }
238
238
 
239
239
  /**
240
- * TBD.
241
- * @param {string|Function} ease - TBD.
242
- * @param {number} index - TBD.
243
- * @returns {Tween} TBD.
240
+ * Sets the easing function for a timeline entry.
241
+ * @param {string|Function} ease - The easing function to use.
242
+ * @param {number} index - The index in the timeline to apply easing to.
243
+ * @returns {Tween} This Tween object for chaining.
244
244
  */
245
245
  easing(ease, index) {
246
246
  if (typeof ease === 'string' && this.manager.easeMap[ease]) {
@@ -250,11 +250,11 @@ export class Tween {
250
250
  }
251
251
 
252
252
  /**
253
- * TBD.
254
- * @param {Function} interpolation - TBD.
255
- * @param {object} context - TBD.
256
- * @param {number} index - TBD.
257
- * @returns {Tween} TBD.
253
+ * Sets the interpolation function for a timeline entry.
254
+ * @param {Function} interpolation - The interpolation function to use.
255
+ * @param {object} context - The context in which to call the interpolation function.
256
+ * @param {number} index - The index in the timeline to apply interpolation to.
257
+ * @returns {Tween} This Tween object for chaining.
258
258
  */
259
259
  interpolation(interpolation, context = MathUtils, index = 0) {
260
260
  this.updateTweenData('interpolationFunction', interpolation, index);
@@ -262,9 +262,9 @@ export class Tween {
262
262
  }
263
263
 
264
264
  /**
265
- * TBD.
266
- * @param {number} total - TBD.
267
- * @returns {Tween} TBD.
265
+ * Sets how many times to repeat all timeline entries.
266
+ * @param {number} total - The number of times to repeat (-1 for infinite).
267
+ * @returns {Tween} This Tween object for chaining.
268
268
  */
269
269
  repeatAll(total = 0) {
270
270
  this.repeatCounter = total;
@@ -272,9 +272,9 @@ export class Tween {
272
272
  }
273
273
 
274
274
  /**
275
- * TBD.
276
- * @param {...any} args - TBD.
277
- * @returns {Tween} TBD.
275
+ * Chains one or more tweens to this tween.
276
+ * @param {...any} args - The tweens to chain.
277
+ * @returns {Tween} This Tween object for chaining.
278
278
  */
279
279
  chain(...args) {
280
280
  let i = args.length;
@@ -290,9 +290,9 @@ export class Tween {
290
290
  }
291
291
 
292
292
  /**
293
- * TBD.
294
- * @param {boolean} value - TBD.
295
- * @returns {Tween} TBD.
293
+ * Sets whether the tween should loop infinitely.
294
+ * @param {boolean} value - Whether to loop infinitely.
295
+ * @returns {Tween} This Tween object for chaining.
296
296
  */
297
297
  loop(value = true) {
298
298
  this.repeatCounter = value ? -1 : 0;
@@ -300,10 +300,10 @@ export class Tween {
300
300
  }
301
301
 
302
302
  /**
303
- * TBD.
304
- * @param {Function} callback - TBD.
305
- * @param {object} callbackContext - TBD.
306
- * @returns {Tween} TBD.
303
+ * Sets a callback to be called when the tween updates.
304
+ * @param {Function} callback - The callback function to call.
305
+ * @param {object} callbackContext - The context in which to call the callback.
306
+ * @returns {Tween} This Tween object for chaining.
307
307
  */
308
308
  onUpdateCallback(callback, callbackContext) {
309
309
  this._onUpdateCallback = callback;
@@ -312,7 +312,7 @@ export class Tween {
312
312
  }
313
313
 
314
314
  /**
315
- * TBD.
315
+ * Pauses the tween.
316
316
  */
317
317
  pause() {
318
318
  this.isPaused = true;
@@ -321,7 +321,7 @@ export class Tween {
321
321
  }
322
322
 
323
323
  /**
324
- * TBD.
324
+ * Internal method to pause the tween.
325
325
  */
326
326
  _pause() {
327
327
  if (!this._codePaused) {
@@ -331,7 +331,7 @@ export class Tween {
331
331
  }
332
332
 
333
333
  /**
334
- * TBD.
334
+ * Resumes the tween.
335
335
  */
336
336
  resume() {
337
337
  if (this.isPaused) {
@@ -346,7 +346,7 @@ export class Tween {
346
346
  }
347
347
 
348
348
  /**
349
- * TBD.
349
+ * Internal method to resume the tween.
350
350
  */
351
351
  _resume() {
352
352
  if (!this._codePaused) {
@@ -355,9 +355,9 @@ export class Tween {
355
355
  }
356
356
 
357
357
  /**
358
- * TBD.
359
- * @param {number} time - TBD.
360
- * @returns {boolean} TBD.
358
+ * Updates the tween state at a given time.
359
+ * @param {number} time - The current game time.
360
+ * @returns {boolean} True if the tween should continue running, false if it's complete.
361
361
  */
362
362
  update(time) {
363
363
  if (this.pendingDelete || !this.target) {
@@ -438,10 +438,10 @@ export class Tween {
438
438
  }
439
439
 
440
440
  /**
441
- * TBD.
442
- * @param {number} frameRate - TBD.
443
- * @param {object[]} data - TBD.
444
- * @returns {object[]} TBD.
441
+ * Generates animation data for a given frame rate.
442
+ * @param {number} frameRate - The target frame rate.
443
+ * @param {object[]} data - The array to store the generated data in.
444
+ * @returns {object[]} The populated data array.
445
445
  */
446
446
  generateData(frameRate = 60, data = []) {
447
447
  if (this.game === null || this.target === null) {
@@ -470,8 +470,8 @@ export class Tween {
470
470
  }
471
471
 
472
472
  /**
473
- * TBD.
474
- * @returns {number} TBD.
473
+ * Gets the total duration of all timeline entries.
474
+ * @returns {number} The total duration in milliseconds.
475
475
  */
476
476
  get totalDuration() {
477
477
  let total = 0;
@@ -3,8 +3,8 @@ import { TWEEN_COMPLETE, TWEEN_LOOPED, TWEEN_PENDING, TWEEN_RUNNING } from './co
3
3
 
4
4
  export class TweenData {
5
5
  /**
6
- * TBD.
7
- * @param {import('./tween.js').Tween} parent - TBD.
6
+ * Creates a new TweenData instance.
7
+ * @param {import('./tween.js').Tween} parent - The parent Tween instance.
8
8
  */
9
9
  constructor(parent) {
10
10
  this.parent = parent;
@@ -34,14 +34,14 @@ export class TweenData {
34
34
  }
35
35
 
36
36
  /**
37
- * TBD.
38
- * @param {object} properties - TBD.
39
- * @param {number} duration - TBD.
40
- * @param {(number) => number} ease - TBD.
41
- * @param {number} delay - TBD.
42
- * @param {number} repeat - TBD.
43
- * @param {boolean} yoyo - TBD.
44
- * @returns {TweenData} TBD.
37
+ * Sets the target properties to tween to.
38
+ * @param {object} properties - The properties to tween to.
39
+ * @param {number} duration - The duration of the tween in milliseconds.
40
+ * @param {(number) => number} ease - The easing function to use.
41
+ * @param {number} delay - The delay before starting the tween in milliseconds.
42
+ * @param {number} repeat - The number of times to repeat the tween (0 = no repeat, -1 = infinite).
43
+ * @param {boolean} yoyo - Whether to reverse the tween on each repeat.
44
+ * @returns {TweenData} This TweenData object for chaining.
45
45
  */
46
46
  to(properties, duration, ease, delay, repeat, yoyo) {
47
47
  this.vEnd = properties;
@@ -55,14 +55,14 @@ export class TweenData {
55
55
  }
56
56
 
57
57
  /**
58
- * TBD.
59
- * @param {object} properties - TBD.
60
- * @param {number} duration - TBD.
61
- * @param {(number) => number} ease - TBD.
62
- * @param {number} delay - TBD.
63
- * @param {number} repeat - TBD.
64
- * @param {boolean} yoyo - TBD.
65
- * @returns {TweenData} TBD.
58
+ * Sets the target properties to tween from (in reverse).
59
+ * @param {object} properties - The properties to tween from.
60
+ * @param {number} duration - The duration of the tween in milliseconds.
61
+ * @param {(number) => number} ease - The easing function to use.
62
+ * @param {number} delay - The delay before starting the tween in milliseconds.
63
+ * @param {number} repeat - The number of times to repeat the tween (0 = no repeat, -1 = infinite).
64
+ * @param {boolean} yoyo - Whether to reverse the tween on each repeat.
65
+ * @returns {TweenData} This TweenData object for chaining.
66
66
  */
67
67
  from(properties, duration, ease, delay, repeat, yoyo) {
68
68
  this.vEnd = properties;
@@ -76,8 +76,8 @@ export class TweenData {
76
76
  }
77
77
 
78
78
  /**
79
- * TBD.
80
- * @returns {TweenData} TBD.
79
+ * Starts the tween.
80
+ * @returns {TweenData} This TweenData object for chaining.
81
81
  */
82
82
  start() {
83
83
  this.startTime = this.game.time.time + this.delay;
@@ -108,8 +108,8 @@ export class TweenData {
108
108
  }
109
109
 
110
110
  /**
111
- * TBD.
112
- * @returns {TweenData} TBD.
111
+ * Loads the tween values from the parent object.
112
+ * @returns {TweenData} This TweenData object for chaining.
113
113
  */
114
114
  loadValues() {
115
115
  const keys = Object.keys(this.parent.properties);
@@ -145,9 +145,9 @@ export class TweenData {
145
145
  }
146
146
 
147
147
  /**
148
- * TBD.
149
- * @param {number} time - TBD.
150
- * @returns {number} TBD.
148
+ * Updates the tween at a given time.
149
+ * @param {number} time - The current time in milliseconds.
150
+ * @returns {number} The tween status (TWEEN_PENDING, TWEEN_RUNNING, or TWEEN_COMPLETE).
151
151
  */
152
152
  update(time) {
153
153
  if (!this.isRunning) {
@@ -188,9 +188,9 @@ export class TweenData {
188
188
  }
189
189
 
190
190
  /**
191
- * TBD.
192
- * @param {number} frameRate - TBD.
193
- * @returns {object[]} TBD.
191
+ * Generates an array of tween data points for a given frame rate.
192
+ * @param {number} frameRate - The frame rate to generate data for.
193
+ * @returns {object[]} An array of tween data points.
194
194
  */
195
195
  generateData(frameRate) {
196
196
  if (this.parent.reverse) {
@@ -237,8 +237,8 @@ export class TweenData {
237
237
  }
238
238
 
239
239
  /**
240
- * TBD.
241
- * @returns {number} TBD.
240
+ * Handles tween repetition logic.
241
+ * @returns {number} The tween status (TWEEN_LOOPED or TWEEN_COMPLETE).
242
242
  */
243
243
  repeat() {
244
244
  // If not a yoyo and repeatCounter = 0 then we're done
@@ -36,8 +36,8 @@ import {
36
36
 
37
37
  export class TweenManager {
38
38
  /**
39
- * TBD.
40
- * @param {import('./game.js').Game} game - TBD.
39
+ * Creates a new TweenManager instance.
40
+ * @param {import('./game.js').Game} game - The game instance this manager belongs to.
41
41
  */
42
42
  constructor(game) {
43
43
  this.game = game;
@@ -95,15 +95,16 @@ export class TweenManager {
95
95
  }
96
96
 
97
97
  /**
98
- * TBD.
99
- * @returns {Tween[]} TBD.
98
+ * Get all tweens managed by this manager.
99
+ * @returns {Tween[]} An array of all active tweens.
100
100
  */
101
101
  getAll() {
102
102
  return this._tweens;
103
103
  }
104
104
 
105
105
  /**
106
- * TBD.
106
+ * Remove all tweens from the manager.
107
+ * This method removes all active and pending tweens.
107
108
  */
108
109
  removeAll() {
109
110
  for (let i = 0; i < this._tweens.length; i += 1) {
@@ -113,9 +114,9 @@ export class TweenManager {
113
114
  }
114
115
 
115
116
  /**
116
- * TBD.
117
- * @param {object} obj - TBD.
118
- * @param {object[]} children - TBD.
117
+ * Remove tweens associated with an object or its children.
118
+ * @param {object} obj - The object to remove tweens from.
119
+ * @param {object[]} children - Optional array of child objects to remove tweens from.
119
120
  */
120
121
  removeFrom(obj, children = null) {
121
122
  let i;
@@ -143,8 +144,8 @@ export class TweenManager {
143
144
  }
144
145
 
145
146
  /**
146
- * TBD.
147
- * @param {Tween} tween - TBD.
147
+ * Add a tween to the manager.
148
+ * @param {Tween} tween - The tween to add.
148
149
  */
149
150
  add(tween) {
150
151
  tween.manager = this;
@@ -152,17 +153,17 @@ export class TweenManager {
152
153
  }
153
154
 
154
155
  /**
155
- * TBD.
156
- * @param {object} object - TBD.
157
- * @returns {Tween} TBD.
156
+ * Create a new tween for an object.
157
+ * @param {object} object - The object to create a tween for.
158
+ * @returns {Tween} The created Tween object.
158
159
  */
159
160
  create(object) {
160
161
  return new Tween(object, this.game, this);
161
162
  }
162
163
 
163
164
  /**
164
- * TBD.
165
- * @param {Tween | null | undefined} tween - TBD.
165
+ * Remove a tween from the manager.
166
+ * @param {Tween | null | undefined} tween - The tween to remove.
166
167
  */
167
168
  remove(tween) {
168
169
  let i = this._tweens.indexOf(tween);
@@ -177,8 +178,8 @@ export class TweenManager {
177
178
  }
178
179
 
179
180
  /**
180
- * TBD.
181
- * @returns {boolean} TBD.
181
+ * Update all tweens managed by this manager.
182
+ * @returns {boolean} True if any tweens were updated, false otherwise.
182
183
  */
183
184
  update() {
184
185
  const addTweens = this._add.length;
@@ -204,16 +205,17 @@ export class TweenManager {
204
205
  }
205
206
 
206
207
  /**
207
- * TBD.
208
- * @param {object} object - TBD.
209
- * @returns {boolean} TBD.
208
+ * Check if an object is currently being tweened.
209
+ * @param {object} object - The object to check.
210
+ * @returns {boolean} True if the object is being tweened, false otherwise.
210
211
  */
211
212
  isTweening(object) {
212
213
  return this._tweens.some((tween) => tween.target === object);
213
214
  }
214
215
 
215
216
  /**
216
- * TBD.
217
+ * Pause all tweens managed by this manager.
218
+ * This method pauses all active tweens.
217
219
  */
218
220
  _pauseAll() {
219
221
  for (let i = this._tweens.length - 1; i >= 0; i -= 1) {
@@ -222,7 +224,8 @@ export class TweenManager {
222
224
  }
223
225
 
224
226
  /**
225
- * TBD.
227
+ * Resume all tweens managed by this manager.
228
+ * This method resumes all paused tweens.
226
229
  */
227
230
  _resumeAll() {
228
231
  for (let i = this._tweens.length - 1; i >= 0; i -= 1) {
@@ -231,7 +234,8 @@ export class TweenManager {
231
234
  }
232
235
 
233
236
  /**
234
- * TBD.
237
+ * Pause all tweens managed by this manager.
238
+ * This method pauses all active tweens.
235
239
  */
236
240
  pauseAll() {
237
241
  for (let i = this._tweens.length - 1; i >= 0; i -= 1) {
@@ -240,7 +244,8 @@ export class TweenManager {
240
244
  }
241
245
 
242
246
  /**
243
- * TBD.
247
+ * Resume all tweens managed by this manager.
248
+ * This method resumes all paused tweens.
244
249
  */
245
250
  resumeAll() {
246
251
  for (let i = this._tweens.length - 1; i >= 0; i -= 1) {
@@ -2,15 +2,16 @@ import { Group } from '../display/group.js';
2
2
 
3
3
  export class World extends Group {
4
4
  /**
5
- * TBD.
6
- * @param {import('./game.js').Game} game - TBD.
5
+ * Creates a new World instance.
6
+ * @param {import('./game.js').Game} game - The game instance this world belongs to.
7
7
  */
8
8
  constructor(game) {
9
9
  super(game, null, '__world', false);
10
10
  }
11
11
 
12
12
  /**
13
- * TBD.
13
+ * Initialize the world.
14
+ * This method is called when the game boots and sets up the world.
14
15
  */
15
16
  boot() {
16
17
  this.game.stage.addChild(this);