excalibur 1.1.0-alpha.313 → 1.1.0-alpha.317

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 (69) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/STYLEGUIDE.md +5 -3
  3. package/build/esm/excalibur.development.js +308 -305
  4. package/build/esm/excalibur.js +308 -305
  5. package/build/esm/excalibur.min.development.js +250 -256
  6. package/build/esm/excalibur.min.js +250 -256
  7. package/build/esm/src/engine/actions/action-queue.d.ts +2 -2
  8. package/build/esm/src/engine/actor.d.ts +13 -17
  9. package/build/esm/src/engine/camera.d.ts +2 -2
  10. package/build/esm/src/engine/collision/bounding-box.d.ts +1 -1
  11. package/build/esm/src/engine/collision/colliders/polygon-collider.d.ts +1 -1
  12. package/build/esm/src/engine/collision/detection/collision-contact.d.ts +1 -1
  13. package/build/esm/src/engine/collision/detection/dynamic-tree.d.ts +1 -1
  14. package/build/esm/src/engine/collision/detection/quad-tree.d.ts +2 -2
  15. package/build/esm/src/engine/collision/detection/sparse-hash-grid-collision-processor.d.ts +1 -1
  16. package/build/esm/src/engine/collision/detection/sparse-hash-grid.d.ts +2 -2
  17. package/build/esm/src/engine/director/default-loader.d.ts +1 -1
  18. package/build/esm/src/engine/director/transition.d.ts +2 -2
  19. package/build/esm/src/engine/engine.d.ts +15 -9
  20. package/build/esm/src/engine/entity-component-system/components/pause-component.d.ts +27 -3
  21. package/build/esm/src/engine/entity-component-system/entity.d.ts +3 -3
  22. package/build/esm/src/engine/entity-component-system/system-manager.d.ts +1 -1
  23. package/build/esm/src/engine/garbage-collector.d.ts +1 -1
  24. package/build/esm/src/engine/graphics/animation.d.ts +2 -2
  25. package/build/esm/src/engine/graphics/context/circle-renderer/circle-renderer.d.ts +1 -1
  26. package/build/esm/src/engine/graphics/context/debug-circle-renderer/debug-circle-renderer.d.ts +1 -1
  27. package/build/esm/src/engine/graphics/context/debug-line-renderer/debug-line-renderer.d.ts +1 -1
  28. package/build/esm/src/engine/graphics/context/debug-point-renderer/debug-point-renderer.d.ts +1 -1
  29. package/build/esm/src/engine/graphics/context/image-renderer/image-renderer.d.ts +1 -1
  30. package/build/esm/src/engine/graphics/context/image-renderer-v2/image-renderer-v2.d.ts +1 -1
  31. package/build/esm/src/engine/graphics/context/material-renderer/material-renderer.d.ts +1 -1
  32. package/build/esm/src/engine/graphics/context/particle-renderer/particle-renderer.d.ts +1 -1
  33. package/build/esm/src/engine/graphics/context/rectangle-renderer/rectangle-renderer.d.ts +1 -1
  34. package/build/esm/src/engine/graphics/context/renderer.d.ts +1 -1
  35. package/build/esm/src/engine/graphics/context/shader.d.ts +1 -1
  36. package/build/esm/src/engine/graphics/font-text-instance.d.ts +1 -1
  37. package/build/esm/src/engine/graphics/graphic.d.ts +1 -1
  38. package/build/esm/src/engine/graphics/graphics-component.d.ts +1 -1
  39. package/build/esm/src/engine/graphics/image-source.d.ts +1 -1
  40. package/build/esm/src/engine/input/gamepad.d.ts +9 -5
  41. package/build/esm/src/engine/input/input-host.d.ts +1 -1
  42. package/build/esm/src/engine/input/keyboard.d.ts +29 -1
  43. package/build/esm/src/engine/input/pointer-event-receiver.d.ts +1 -1
  44. package/build/esm/src/engine/input/pointer-event.d.ts +1 -1
  45. package/build/esm/src/engine/input/wheel-event.d.ts +1 -1
  46. package/build/esm/src/engine/interfaces/loadable.d.ts +1 -1
  47. package/build/esm/src/engine/math/affine-matrix.d.ts +1 -1
  48. package/build/esm/src/engine/math/graph.d.ts +3 -3
  49. package/build/esm/src/engine/math/matrix.d.ts +1 -1
  50. package/build/esm/src/engine/math/transform.d.ts +1 -1
  51. package/build/esm/src/engine/particles/particles.d.ts +3 -3
  52. package/build/esm/src/engine/resources/font.d.ts +1 -1
  53. package/build/esm/src/engine/resources/gif.d.ts +1 -1
  54. package/build/esm/src/engine/resources/resource.d.ts +1 -1
  55. package/build/esm/src/engine/resources/sound/sound-manager.d.ts +1 -1
  56. package/build/esm/src/engine/resources/sound/sound-track.d.ts +3 -3
  57. package/build/esm/src/engine/resources/sound/sound.d.ts +4 -4
  58. package/build/esm/src/engine/scene.d.ts +2 -2
  59. package/build/esm/src/engine/screen.d.ts +1 -1
  60. package/build/esm/src/engine/tile-map/isometric-map.d.ts +2 -2
  61. package/build/esm/src/engine/tile-map/tile-map.d.ts +6 -5
  62. package/build/esm/src/engine/timer.d.ts +1 -1
  63. package/build/esm/src/engine/trigger.d.ts +2 -2
  64. package/build/esm/src/engine/util/clock.d.ts +3 -3
  65. package/build/esm/src/engine/util/coroutine.d.ts +2 -2
  66. package/build/esm/src/engine/util/future.d.ts +2 -2
  67. package/build/esm/src/engine/util/serializer.d.ts +1 -1
  68. package/build/esm/src/engine/util/web-audio.d.ts +1 -1
  69. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
  ### Breaking Changes
9
9
 
10
+ - API naming is now consistent: synchronous boolean state is always a **getter** (`isX`), side-effecting calls are **verb methods**, and async state is a **Promise property** that never has an `isX()` form. Zero-arg `isX()`/`hasX()` methods became getters, drop the parentheses:
11
+ - `Entity.isKilled` (and `Actor`), `Engine.isRunning`, `Engine.isDisposed`, `Clock.isRunning`, `Scene.isCurrentScene`, `CollisionContact.isCanceled`, `CoroutineInstance.isRunning/isComplete`
12
+ - `Sound` and `SoundTrack`: `isPlaying`, `isPaused`, `isStopped`
13
+ - `Loadable.isLoaded` (`Resource`, `ImageSource`, `Font`, `Gif`, `Sound`, `SoundManager`, `DefaultLoader`)
14
+ - `Matrix/AffineMatrix.isIdentity`, `Transform.isMirrored`, `BoundingBox.hasZeroDimensions`, `Camera.hasChanged`, `ActionQueue.hasNext/isComplete`, `Graphic.isStale`, `RendererPlugin.hasPendingDraws`, `WebAudio.isUnlocked`, `Serializer.isInitialized`
15
+ - Methods that mutate or do real work stay verbs: `PolygonCollider.isConvex` -> `checkConvex()` (O(n)), the mutating `hasChanged` getter on `SparseHashGrid` and its collision processor -> `refreshAndCheckChanged()`, and every `toggleEnabled(enabled)` on the input classes -> `setEnabled(enabled)` (it takes an explicit value, it never toggled)
16
+ - Settable booleans follow the same `isX` naming as the already-shipped `isVisible`: the `visible` option on `ActorOptions`, `TriggerOptions` and `GraphicsComponentOptions` is now `isVisible`, and `Particle.visible` is now `Particle.isVisible`
17
+ - `Tile.solid` (`TileMap` and `IsometricMap` tiles) and the `solid` tile option are now `isSolid`
18
+ - `GarbageCollector.running()` is now the getter `isRunning`; `FontTextInstance.disposed` is now `isDisposed`
19
+ - Pausing: `Actor.paused` (a `PauseComponent`, not a boolean) and `Particle.paused` are now the read-only `pauseComponent`, `PauseComponent.paused` is now the read-only `isPaused`, and `PauseComponentInterface` is now `PauseComponentOptions`. Use `Actor.canPause` and `Actor.isPaused` for everyday code
20
+ - Spelling: `isOffScreen` -> `isOffscreen` (one word, like the web platform's `OffscreenCanvas`; "on screen" stays split: `forceOnScreen`, `onScreenOnly`, `getOnScreenTiles()`), `isHiDpi` -> `isHiDPI` on `Engine` and `Screen`, and `Future.isCompleted` -> `isComplete`
21
+ - Renamed: `Engine.loadingComplete` -> `Engine.isLoaded`; `Engine.ready` (boolean) -> `Engine.isReady`; `Engine.isReady()` (Promise) -> `await engine.ready`; `Animation.done` -> `Animation.isComplete`; `Timer.complete` and `Transition.complete` -> `isComplete`; `Gamepad.connected` -> `Gamepad.isConnected`; `SystemManager.initialized` -> `isInitialized`; `Engine.toggleInputEnabled(enabled)` -> `Engine.setInputEnabled(enabled)`; graph edge option `directed` -> `isDirected`; `PointerEvent.active`/`WheelEvent.active` -> `isActive`; `Transition.started` -> `hasStarted`; `Gamepads.enabled` (polling opt-in) -> `Gamepads.pollingEnabled`
22
+
10
23
  - Sound: the audio implementation abstraction has been removed and Web Audio is the only implementation. `ex.WebAudioInstance` is replaced by `ex.SoundTrack` (returned by `Sound.instances` and `NativeSoundEvent.track`), and the `ex.Audio`, `ex.AudioImplementation`, `ex.ExResponse`, `ex.ExResponseType` and `ex.ExResponseTypesLookup` exports are gone (pass the response type string to `new ex.Resource(path, 'arraybuffer')` instead). Per-track volume moved to the owning `Sound`, so `SoundTrack` has no `volume`.
11
24
  - `Sound.play()` always starts a new track and never changes the Sound's configuration. Previously `play()` resumed paused tracks, and `play(volume)`/`play({ volume })` permanently set `Sound.volume`. Use the new `Sound.resume()` to continue paused (or seeked) tracks, and `play({ volume, pitch, playbackRate, loop, position, duration, scheduledStartTime, onPlay })` for one-off overrides that apply to that track only (`volume` multiplies `Sound.volume`). `play(volume: number)` still works as a one-off volume but is deprecated. The unused `Sound.scheduledStartTime` property is removed, use the play option. The `onPlay` hook's `source` is now the track's per-play volume gain (an `AudioNode`); the buffer source is available as `bufferSource` for param automation.
12
25
  - `SoundManager.play(name, volume)` is now `play(name, options?)` taking the same `PlayOptions`, and `SoundConfig.channels` (a list) is now a single `channel`.
@@ -199,6 +212,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
199
212
 
200
213
  ### Fixed
201
214
 
215
+ - Fixed `ex.ScreenElement` ignoring an explicit `canPause` option, the constructor always forced `canPause = false`. It still defaults to `false` but now honors `canPause: true`
202
216
  - Fixed issue where moving a `TileMap` after making cells solid left the tile collision boundaries behind at the old position. `Tile.defaultGeometry` returned a cached world-space bounding box that was never invalidated when the tilemap moved, so `_updateColliders()` rebuilt colliders from stale geometry on every move; making cells solid after the move had the same effect. `defaultGeometry` now recalculates when the tile is flagged dirty, matching the existing `pos`/`center` getters, so collision boundaries track `tilemap.pos` in any order (issue #3494)
203
217
  - Fixed `RepeatForever.reset()` doing nothing. Reset now stops the active child action and rebuilds the repeat sequence from the entity's current state, allowing stopped repeats to be reused
204
218
  - Fixed `SoundManager.channel.setVolume()` doing nothing (it passed the channel name where a sound was expected), `SoundManager.unmute()` starting every managed sound, and `SoundManager.untrack()` leaving the sound in its channels.
package/STYLEGUIDE.md CHANGED
@@ -55,9 +55,11 @@
55
55
  - Use JavaScript getters/setters for things that feel like properties, but have logic behind them
56
56
  - Use getters for things that should be strict `readonly` properties
57
57
  - Use properties for quantities that have no logic behind them
58
- - Use methods for commands, performing an action, or making queries
59
- - Prefer verbs like `show()` or `hide()` for booleans instead of properties like `.isVisible = true`
60
- - Example: `isDebug` should be `enableDebug()`/`disableDebug()` or `toggleDebug() // returns current mode`
58
+ - Use methods for commands, performing an action, or queries that take arguments
59
+ - Name synchronous boolean state `isX`/`hasX` and expose it as a property or getter, never a zero-arg `isX()` method (`actor.isKilled`, `actor.isVisible = false`)
60
+ - Use a verb method when the call has a side effect or does real work (`engine.start()`, `contact.cancel()`, `input.setEnabled(false)`)
61
+ - Async state is a Promise property without the `is` (`await engine.ready`), the synchronous check is `engine.isReady`
62
+ - See the API Naming section of `site/docs/02-fundamentals/02-conventions.mdx` for the full rules and exceptions
61
63
 
62
64
  #### CONSIDER
63
65