angry-pixel 2.3.6 → 2.4.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.
package/lib/index.d.ts CHANGED
@@ -771,11 +771,24 @@ type Archetype = {
771
771
  /** Whether the entity starts enabled. Defaults to `true`. Set to `false` to disable the entity on creation. */
772
772
  enabled?: boolean;
773
773
  };
774
+ /**
775
+ * Options for the `removeAllEntities` method of the EntityManager
776
+ * @public
777
+ * @category Entity-Component-System
778
+ * @example
779
+ * ```js
780
+ * entityManager.removeAllEntities({ preserveEntitiesWithComponent: DontDestroy });
781
+ * ```
782
+ */
783
+ type RemoveAllEntitiesOptions = {
784
+ /** The entities that have a component of this type are preserved instead of being removed */
785
+ preserveEntitiesWithComponent: ComponentType;
786
+ };
774
787
  /**
775
788
  * This interface defines the core structure for system classes in the ECS architecture.\
776
789
  * Systems contain the game logic that operates on entities and their components.\
777
790
  * Dependencies like EntityManager can be injected using dependency injection decorators.\
778
- * Systems must implement onUpdate() and can optionally implement lifecycle hooks like onCreate(), onDestroy(), onEnabled() and onDisabled().
791
+ * Systems must implement onUpdate().
779
792
  * @public
780
793
  * @category Entity-Component-System
781
794
  * @example
@@ -792,26 +805,6 @@ type Archetype = {
792
805
  * ```
793
806
  */
794
807
  interface System {
795
- /**
796
- * This method is called the first time the system is enabled
797
- * @public
798
- */
799
- onCreate?(): void;
800
- /**
801
- * This method is called when the system is destroyed
802
- * @public
803
- */
804
- onDestroy?(): void;
805
- /**
806
- * This method is called when the system is disabled
807
- * @public
808
- */
809
- onDisabled?(): void;
810
- /**
811
- * This method is called when the system is enabled
812
- * @public
813
- */
814
- onEnabled?(): void;
815
808
  /**
816
809
  * This method is called once every frame
817
810
  * @public
@@ -988,18 +981,18 @@ declare class EntityManager {
988
981
  removeEntity(entity: Entity): void;
989
982
  /**
990
983
  * Removes all Entities and all their Components
991
- * @param preserveComponentType Optional component type to preserve entities that have this component
984
+ * @param options Optional options object. See {@link RemoveAllEntitiesOptions}
992
985
  * @public
993
986
  * @example
994
987
  * ```js
995
988
  * // Remove all entities
996
989
  * entityManager.removeAllEntities();
997
990
  *
998
- * // Remove all entities except those that have a SpriteRenderer component
999
- * entityManager.removeAllEntities(SpriteRenderer);
991
+ * // Remove all entities except those that have a component of type DontDestroy
992
+ * entityManager.removeAllEntities({ preserveEntitiesWithComponent: DontDestroy });
1000
993
  * ```
1001
994
  */
1002
- removeAllEntities(preserveComponentType?: ComponentType): void;
995
+ removeAllEntities(options?: RemoveAllEntitiesOptions): void;
1003
996
  /**
1004
997
  * If the Entity exists, returns TRUE, otherwise it returns FALSE
1005
998
  * @param entity
@@ -1463,8 +1456,7 @@ declare class SystemManager {
1463
1456
  */
1464
1457
  groupHasSystems(group: SystemGroup): boolean;
1465
1458
  /**
1466
- * Enables a system by its type.\
1467
- * The method `onEnabled` of the system will be called. If the system is enabled for the first time, the method `onCreate` will also be called.
1459
+ * Enables a system by its type.
1468
1460
  * @param systemType The system class
1469
1461
  * @public
1470
1462
  * @example
@@ -1474,8 +1466,7 @@ declare class SystemManager {
1474
1466
  */
1475
1467
  enableSystem(systemType: SystemType): void;
1476
1468
  /**
1477
- * Disables a system by its type.\
1478
- * The method `onDisabled` of the system will be called.
1469
+ * Disables a system by its type.
1479
1470
  * @param systemType The system class
1480
1471
  * @public
1481
1472
  * @example
@@ -1493,7 +1484,6 @@ declare class SystemManager {
1493
1484
  setExecutionOrder(systemType: SystemType, position: number): void;
1494
1485
  /**
1495
1486
  * Removes a system by its type.
1496
- * The method `onDestroy` of the system will be called.
1497
1487
  * @param systemType The system class
1498
1488
  * @internal
1499
1489
  */
@@ -1575,13 +1565,16 @@ interface Collision {
1575
1565
  * playerCollider,
1576
1566
  * "enemy"
1577
1567
  * );
1578
- *
1579
- * // Get all current collisions
1580
- * const allCollisions = collisionRepository.findAll();
1581
1568
  * ```
1582
1569
  */
1583
1570
  declare class CollisionRepository {
1571
+ private collisionPool;
1572
+ private collisionPoolIndex;
1584
1573
  private collisions;
1574
+ private step;
1575
+ private findCache;
1576
+ /** @internal */
1577
+ private updateCache;
1585
1578
  /**
1586
1579
  * Searches for and returns a collection of collisions for the given collider
1587
1580
  * @param collider The local collider
@@ -1596,15 +1589,22 @@ declare class CollisionRepository {
1596
1589
  */
1597
1590
  findCollisionsForColliderAndLayer(collider: Collider, layer: string): Collision[];
1598
1591
  /**
1599
- * Returns all the collisions
1600
- * @public
1601
- * @returns A collection of collisions
1592
+ * Returns the raw collisions of the current physics step, for engine systems that need every collision at once.
1593
+ * - Each pair of colliding shapes is stored once, not once per side: the shape that detected the collision is
1594
+ * the local one. Check both `localEntity` and `remoteEntity` (and negate `resolution.direction` for the
1595
+ * remote side) to find every collision of an entity.
1596
+ * - The collisions are pooled: the objects and the array are reused on the next physics step. Read them
1597
+ * synchronously and do not keep references to them.
1598
+ *
1599
+ * Use `findCollisionsForCollider` or `findCollisionsForColliderAndLayer` instead when querying the collisions of
1600
+ * a single collider: they return copies, already oriented with that collider as the local one.
1601
+ * @internal
1602
1602
  */
1603
- findAll(): Collision[];
1603
+ getCollisions(): Collision[];
1604
1604
  /** @internal */
1605
- persist(collision: Collision): void;
1605
+ persist(localEntity: Entity, localCollider: Collider, remoteEntity: Entity, remoteCollider: Collider, { direction, penetration }: CollisionResolution): void;
1606
1606
  /** @internal */
1607
- removeAll(): void;
1607
+ clear(): void;
1608
1608
  }
1609
1609
 
1610
1610
  /**
@@ -1738,7 +1738,7 @@ interface AudioSource {
1738
1738
  declare class AssetManager {
1739
1739
  private readonly audioContext;
1740
1740
  private readonly assets;
1741
- constructor(audioContext: AudioContext | null);
1741
+ constructor(audioContext: AudioContext | undefined);
1742
1742
  /**
1743
1743
  * Returns TRUE if the assets are loaded
1744
1744
  * @returns TRUE or FALSE
@@ -1755,9 +1755,9 @@ declare class AssetManager {
1755
1755
  * Loads an audio asset
1756
1756
  * @param url The asset URL
1757
1757
  * @param name The asset name [optional]
1758
- * @returns The {@link AudioSource} (with its `buffer` populated asynchronously), or `null` if no AudioContext is available.
1758
+ * @returns The {@link AudioSource} (with its `buffer` populated asynchronously), or `undefined` if no AudioContext is available.
1759
1759
  */
1760
- loadAudio(url: string, name?: string): AudioSource | null;
1760
+ loadAudio(url: string, name?: string): AudioSource | undefined;
1761
1761
  private decodeAudioBuffer;
1762
1762
  /**
1763
1763
  * Loads a font asset
@@ -2056,15 +2056,16 @@ declare class SceneManager {
2056
2056
  /**
2057
2057
  * Loads a scene
2058
2058
  * @param name The name of the scene
2059
- * @param preserveEntitiesWithComponent Optional component type to preserve entities that have this component
2059
+ * @param options Optional options object. See {@link LoadSceneOptions}
2060
2060
  * @public
2061
2061
  */
2062
- loadScene(name: string, preserveEntitiesWithComponent?: ComponentType): void;
2062
+ loadScene(name: string, options?: LoadSceneOptions): void;
2063
2063
  /**
2064
2064
  * Loads the opening scene
2065
+ * @param options Optional options object. See {@link LoadSceneOptions}
2065
2066
  * @public
2066
2067
  */
2067
- loadOpeningScene(): void;
2068
+ loadOpeningScene(options?: LoadSceneOptions): void;
2068
2069
  /**
2069
2070
  * Returns true if the scene is loading
2070
2071
  * @public
@@ -2077,8 +2078,22 @@ declare class SceneManager {
2077
2078
  get sceneLoadedThisFrame(): boolean;
2078
2079
  /** @internal */
2079
2080
  update(): void;
2080
- private destroyCurrentScene;
2081
+ /** @internal */
2082
+ destroyCurrentScene(): void;
2081
2083
  }
2084
+ /**
2085
+ * Options for the `loadScene` and `loadOpeningScene` methods of the SceneManager
2086
+ * @public
2087
+ * @category Managers
2088
+ * @example
2089
+ * ```js
2090
+ * this.sceneManager.loadScene("Level2", { preserveEntitiesWithComponent: DontDestroy });
2091
+ * ```
2092
+ */
2093
+ type LoadSceneOptions = {
2094
+ /** The entities that have a component of this type are preserved across the scene transition */
2095
+ preserveEntitiesWithComponent: ComponentType;
2096
+ };
2082
2097
  /**
2083
2098
  * This type represents a scene class
2084
2099
  * @public
@@ -2102,14 +2117,12 @@ type SceneType<T extends Scene = Scene> = {
2102
2117
  * this.assetManager.loadImage("image.png");
2103
2118
  * }
2104
2119
  *
2105
- * registerSystems() {
2106
- * this.systems.push(
2120
+ * setup() {
2121
+ * this.systems = [
2107
2122
  * SomeSystem,
2108
2123
  * AnotherSystem
2109
- * );
2110
- * }
2124
+ * ];
2111
2125
  *
2112
- * createEntities() {
2113
2126
  * this.entityManager.createEntity([
2114
2127
  * SomeComponent,
2115
2128
  * AnotherComponent
@@ -2123,33 +2136,16 @@ declare abstract class Scene {
2123
2136
  protected readonly assetManager: AssetManager;
2124
2137
  systems: SystemType[];
2125
2138
  constructor(entityManager: EntityManager, assetManager: AssetManager);
2126
- /**
2127
- * Override this method to register the systems that will be executed in the scene
2128
- * @public
2129
- */
2130
- registerSystems(): void;
2131
2139
  /**
2132
2140
  * Override this method to load the assets needed for the scene
2133
2141
  * @public
2134
2142
  */
2135
2143
  loadAssets(): void;
2136
2144
  /**
2137
- * Override this method to create the entities needed for the scene
2138
- * @public
2139
- */
2140
- createEntities(): void;
2141
- /**
2142
- * Adds a system to the scene
2143
- * @param system The system to add
2145
+ * Override this method to create the entities and register the systems that will be executed in the scene
2144
2146
  * @public
2145
2147
  */
2146
- protected addSystem(system: SystemType): void;
2147
- /**
2148
- * Adds multiple systems to the scene
2149
- * @param systems The systems to add
2150
- * @public
2151
- */
2152
- protected addSystems(systems: SystemType[]): void;
2148
+ setup(): void;
2153
2149
  }
2154
2150
 
2155
2151
  /**
@@ -2631,12 +2627,12 @@ declare enum ButtonShape {
2631
2627
  * @example
2632
2628
  * ```js
2633
2629
  * const tiledWrapper = new TiledWrapper({
2634
- * tilemap: "tilemap.json",
2630
+ * tilemapPath: "tilemap.json",
2635
2631
  * layerToRender: "Ground"
2636
2632
  * });
2637
2633
  *
2638
2634
  * const tiledWrapper = new TiledWrapper({
2639
- * tilemap: assetManager.getJson("tilemap.json"),
2635
+ * tilemapPath: "tilemap.json",
2640
2636
  * layerToRender: "Ground",
2641
2637
  * objects: new Map([
2642
2638
  * ["Player", playerArchetype],
@@ -2647,37 +2643,31 @@ declare enum ButtonShape {
2647
2643
  * ```
2648
2644
  */
2649
2645
  interface TiledWrapperOptions {
2650
- tilemap: TiledTilemap | string;
2646
+ tilemapPath: string;
2651
2647
  layerToRender: string;
2652
2648
  objects: Map<string, TiledObjectBlueprint>;
2653
2649
  }
2654
2650
  /**
2655
2651
  * The TiledWrapper component wraps a Tiled map editor tilemap and handles rendering a specific layer.\
2656
2652
  * It provides an interface between Tiled's map format and the engine's tilemap rendering system.\
2657
- * The tiles animated in Tiled are mapped to the animations of the TilemapRenderer tileset.\
2653
+ * The tilemap is referenced by the URL of its JSON export, and it is loaded if the scene did not load it.\
2654
+ * The tilesets of the TilemapRenderer are created from the ones embedded in the tilemap, unless they are declared,\
2655
+ * so the tilesets need to be embedded in the JSON export.\
2656
+ * The tiles animated in Tiled are mapped to the animations of the tileset they belong to.\
2658
2657
  * It can also create entities from the objects of the tilemap, matching them by class with the `objects` map.
2659
2658
  * @public
2660
2659
  * @category Components
2661
2660
  * @example
2662
2661
  * ```js
2663
2662
  * const tiledWrapper = new TiledWrapper({
2664
- * tilemap: {
2665
- * width: 10,
2666
- * height: 10,
2667
- * infinite: false,
2668
- * layers: [],
2669
- * renderorder: "right-down",
2670
- * tilesets: [{ firstgid: 1 }],
2671
- * tilewidth: 32,
2672
- * tileheight: 32
2673
- * },
2663
+ * tilemapPath: "tilemap/map.json",
2674
2664
  * layerToRender: "Ground"
2675
2665
  * });
2676
2666
  * ```
2677
2667
  */
2678
2668
  declare class TiledWrapper {
2679
- /** The tilemap to render. */
2680
- tilemap: TiledTilemap | string;
2669
+ /** The URL of the JSON tilemap exported from Tiled. It is loaded if the scene did not load it. */
2670
+ tilemapPath: string;
2681
2671
  /** The layer to render. */
2682
2672
  layerToRender: string;
2683
2673
  /**
@@ -2691,8 +2681,12 @@ declare class TiledWrapper {
2691
2681
  _objectsCreated: boolean;
2692
2682
  /** @internal */
2693
2683
  _animationsMapped: boolean;
2694
- /** The coordinates (in tiles) of the top-left corner of the rendered layer. @internal */
2684
+ /** @internal The coordinates (in tiles) of the top-left corner of the rendered layer. */
2695
2685
  _origin: Vector2;
2686
+ /** @internal The tilemap read from the JSON export. */
2687
+ _tilemap: TiledTilemap;
2688
+ /** @internal TRUE if the tilesets of the TilemapRenderer were created from the tilemap. */
2689
+ _tilesetsCreated: boolean;
2696
2690
  /** @internal */
2697
2691
  static componentName: string;
2698
2692
  constructor(options?: Partial<TiledWrapperOptions>);
@@ -3656,6 +3650,10 @@ type Tileset$1 = {
3656
3650
  margin?: number;
3657
3651
  /** Space in pixels between adjacent tiles */
3658
3652
  spacing?: number;
3653
+ /** The id of the first tile of the tileset. Defaults to 1 */
3654
+ firstgid?: number;
3655
+ /** The number of tiles of the tileset. Obtained from the image if it is not set */
3656
+ tileCount?: number;
3659
3657
  /** Maps each animated tile id to the tile id currently displayed. @internal */
3660
3658
  _animationState?: Map<number, number>;
3661
3659
  /** Tileset values in texture coordinates. Computed once by the renderer. @internal */
@@ -3668,6 +3666,10 @@ type Tileset$1 = {
3668
3666
  type TilesetTexData = {
3669
3667
  /** The width of the tileset (in tiles) */
3670
3668
  columns: number;
3669
+ /** The id of the first tile of the tileset */
3670
+ firstgid: number;
3671
+ /** The number of tiles of the tileset */
3672
+ tileCount: number;
3671
3673
  /** The margin of the image */
3672
3674
  margin: Vector2;
3673
3675
  /** The distance between the origin of two adjacent tiles */
@@ -4479,13 +4481,13 @@ declare class TextRenderer {
4479
4481
  * ```js
4480
4482
  * const tilemapRenderer = new TilemapRenderer({
4481
4483
  * layer: "Default",
4482
- * tileset: {
4484
+ * tilesets: [{
4483
4485
  * image: this.assetManager.getImage("tileset.png"),
4484
4486
  * tileWidth: 32,
4485
4487
  * tileHeight: 32,
4486
4488
  * margin: 0,
4487
4489
  * spacing: 0
4488
- * },
4490
+ * }],
4489
4491
  * data: [1, 2, 3, 4],
4490
4492
  * chunks: [],
4491
4493
  * width: 2,
@@ -4502,7 +4504,7 @@ declare class TextRenderer {
4502
4504
  */
4503
4505
  interface TilemapRendererOptions {
4504
4506
  layer: string;
4505
- tileset: Tileset;
4507
+ tilesets: Tileset[];
4506
4508
  data: number[];
4507
4509
  chunks: Chunk[];
4508
4510
  width: number;
@@ -4518,7 +4520,8 @@ interface TilemapRendererOptions {
4518
4520
  }
4519
4521
  /**
4520
4522
  * The TilemapRenderer component renders 2D tile-based maps to the screen.\
4521
- * It uses a tileset image as a source for individual tiles, which are arranged according to a provided array of tile IDs.\
4523
+ * It uses one or more tileset images as a source for individual tiles, which are arranged according to a provided array of tile IDs.\
4524
+ * Each tileset owns the range of ids that starts at its `firstgid` and covers as many tiles as the tileset has.\
4522
4525
  * The component supports features like tinting, masking, opacity control, and custom tile dimensions.\
4523
4526
  * Maps can be rendered in chunks for improved performance with large tilemaps, and tiles can be assigned to specific render layers.\
4524
4527
  * Each tile is referenced by an ID, with 0 representing empty space.
@@ -4528,13 +4531,13 @@ interface TilemapRendererOptions {
4528
4531
  * ```js
4529
4532
  * const tilemapRenderer = new TilemapRenderer({
4530
4533
  * layer: "Default",
4531
- * tileset: {
4534
+ * tilesets: [{
4532
4535
  * image: this.assetManager.getImage("tileset.png"),
4533
4536
  * tileWidth: 32,
4534
4537
  * tileHeight: 32,
4535
4538
  * margin: 0,
4536
4539
  * spacing: 0
4537
- * },
4540
+ * }],
4538
4541
  * data: [1, 2, 3, 4],
4539
4542
  * chunks: [],
4540
4543
  * width: 2,
@@ -4552,8 +4555,11 @@ interface TilemapRendererOptions {
4552
4555
  declare class TilemapRenderer {
4553
4556
  /** The render layer */
4554
4557
  layer: string;
4555
- /** The Tileset instance */
4556
- tileset: Tileset;
4558
+ /**
4559
+ * The tilesets used by the tilemap, each one owning a range of tile ids defined by its `firstgid`.\
4560
+ * They are created by the TiledWrapper when the tilemap comes from Tiled.
4561
+ */
4562
+ tilesets: Tileset[];
4557
4563
  /** Array of tiles. ID 0 (zero) represents empty space.*/
4558
4564
  data: number[];
4559
4565
  /** Array of tile data split into chunks */
@@ -4619,14 +4625,14 @@ interface TileAnimationOptions {
4619
4625
  * @example
4620
4626
  * ```js
4621
4627
  * const tilemapRenderer = new TilemapRenderer({
4622
- * tileset: {
4628
+ * tilesets: [{
4623
4629
  * image: "tileset.png",
4624
4630
  * tileWidth: 32,
4625
4631
  * tileHeight: 32,
4626
4632
  * animations: new Map([
4627
4633
  * [3, new TileAnimation({ tiles: [3, 4, 5], fps: 6 })]
4628
4634
  * ])
4629
- * },
4635
+ * }],
4630
4636
  * data: [1, 2, 3, 4],
4631
4637
  * width: 2
4632
4638
  * });
@@ -4646,8 +4652,10 @@ declare class TileAnimation {
4646
4652
  /**
4647
4653
  * The Tileset configuration defines the properties of a tileset used by the TilemapRenderer.\
4648
4654
  * It specifies the source image containing the tiles, the size of the individual tiles,\
4649
- * and the optional margin and spacing of the image. The number of columns of the tileset\
4650
- * is obtained from the image. The tileset cannot be updated at runtime.
4655
+ * and the optional margin and spacing of the image. The number of columns and the number\
4656
+ * of tiles of the tileset are obtained from the image. When a tilemap uses several tilesets,\
4657
+ * each one needs a `firstgid`, the id of its first tile, following the same criteria as Tiled.\
4658
+ * The tileset cannot be updated at runtime.
4651
4659
  * @public
4652
4660
  * @category Components Configuration
4653
4661
  * @example
@@ -4660,6 +4668,14 @@ declare class TileAnimation {
4660
4668
  * margin: 1,
4661
4669
  * spacing: 2
4662
4670
  * };
4671
+ *
4672
+ * // a second tileset of 16x16 tiles, used by a tilemap whose first tileset has 72 tiles
4673
+ * const anotherTileset = {
4674
+ * image: this.assetManager.getImage("another-tileset.png"),
4675
+ * tileWidth: 16,
4676
+ * tileHeight: 16,
4677
+ * firstgid: 73
4678
+ * };
4663
4679
  * ```
4664
4680
  */
4665
4681
  type Tileset = {
@@ -4671,6 +4687,10 @@ type Tileset = {
4671
4687
  margin?: number;
4672
4688
  /** Space in pixels between adjacent tiles */
4673
4689
  spacing?: number;
4690
+ /** The id of the first tile of the tileset. Defaults to 1 */
4691
+ firstgid?: number;
4692
+ /** The number of tiles of the tileset. Obtained from the image if it is not set */
4693
+ tileCount?: number;
4674
4694
  /** Animated tiles, keyed by the tile id to animate */
4675
4695
  animations?: Map<number, TileAnimation>;
4676
4696
  /** Maps each animated tile id to the tile id currently displayed. @internal */
@@ -5205,13 +5225,14 @@ declare class InputManager {
5205
5225
 
5206
5226
  /**
5207
5227
  * Abstract base class for creating game systems with commonly needed dependencies injected.\
5208
- * Provides access to the following core managers and services:\
5209
- * - EntityManager: For managing game entities and components\
5210
- * - AssetManager: For loading and managing game resources\
5211
- * - SceneManager: For controlling scene transitions and state\
5212
- * - TimeManager: For handling game timing and delta time\
5213
- * - InputManager: For processing keyboard, mouse and touch input\
5214
- * - CollisionRepository: For physics and collision detection\
5228
+ * Provides access to the following core managers and services:
5229
+ * - EntityManager: For managing game entities and components
5230
+ * - SystemManager: For managing game systems
5231
+ * - AssetManager: For loading and managing game resources
5232
+ * - SceneManager: For controlling scene transitions and state
5233
+ * - TimeManager: For handling game timing and delta time
5234
+ * - InputManager: For processing keyboard, mouse and touch input
5235
+ * - CollisionRepository: For physics and collision detection
5215
5236
  * - GameConfig: For accessing game configuration settings
5216
5237
  * @public
5217
5238
  * @category Core
@@ -5226,17 +5247,28 @@ declare class InputManager {
5226
5247
  */
5227
5248
  declare abstract class GameSystem implements System {
5228
5249
  protected readonly entityManager: EntityManager;
5250
+ protected readonly systemManager: SystemManager;
5229
5251
  protected readonly assetManager: AssetManager;
5230
5252
  protected readonly sceneManager: SceneManager;
5231
5253
  protected readonly timeManager: TimeManager;
5232
5254
  protected readonly inputManager: InputManager;
5233
5255
  protected readonly collisionRepository: CollisionRepository;
5234
5256
  protected readonly gameConfig: GameConfig;
5257
+ /**
5258
+ * This method is called once every frame
5259
+ * @public
5260
+ */
5235
5261
  onUpdate(): void;
5236
- onCreate(): void;
5237
- onEnabled(): void;
5238
- onDisabled(): void;
5239
- onDestroy(): void;
5262
+ /**
5263
+ * This method is called when the scene finishes loading, after its entities have been created
5264
+ * @public
5265
+ */
5266
+ onSceneLoaded(): void;
5267
+ /**
5268
+ * This method is called when the scene is destroyed, before its entities are removed
5269
+ * @public
5270
+ */
5271
+ onSceneDestroyed(): void;
5240
5272
  }
5241
5273
 
5242
5274
  /**
@@ -5395,4 +5427,4 @@ declare const SYMBOLS: {
5395
5427
  TimeManager: symbol;
5396
5428
  };
5397
5429
 
5398
- export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerOptions, type AudioSource, BallCollider, type BallColliderOptions, BoxCollider, type BoxColliderOptions, BroadPhaseMethods, Button, type ButtonOptions, ButtonShape, Camera, type CameraOptions, type Chunk, Circumference, type Collider, type Collision, type CollisionMatrix, CollisionMethods, CollisionRepository, type CollisionResolution, type Component, type ComponentType, DarknessRenderer, type DarknessRendererOptions, type DependencyName, type DependencyType, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, GeometricRenderer, type GeometricRendererOptions, GeometricShape, InputManager, type IntervalOptions, Keyboard, LightRenderer, type LightRendererOptions, MaskRenderer, type MaskRendererOptions, MaskShape, Mouse, type PlaySfxOptions, Polygon, PolygonCollider, type PolygonColliderOptions, type PropertyKey, Rectangle, RigidBody, type RigidBodyOptions, RigidBodyType, SYMBOLS, Scene, SceneManager, type SceneType, type SearchResult, type Shape, type Slice, SpriteRenderer, type SpriteRendererOptions, type System, type SystemGroup, SystemManager, type SystemType, TextAlignment, TextRenderer, type TextRendererOptions, TileAnimation, type TileAnimationOptions, type TiledChunk, type TiledGroupLayer, type TiledLayer, type TiledObject, type TiledObjectBlueprint, type TiledObjectFactory, type TiledObjectLayer, type TiledObjectProperties, type TiledProperty, type TiledTileAnimationFrame, type TiledTilemap, type TiledTileset, type TiledTilesetTile, TiledWrapper, type TiledWrapperOptions, TilemapCollider, type TilemapColliderOptions, TilemapOrientation, TilemapRenderer, type TilemapRendererOptions, type Tileset, TimeManager, type TouchInteraction, TouchScreen, Transform, type TransformOptions, Vector2, type VibrationInput, VideoRenderer, type VideoRendererOptions, between, clamp, debugRenderLayer, decorate, defaultRenderLayer, defaultTextureAtlasOptions, degreesToRadians, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };
5430
+ export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerOptions, type AudioSource, BallCollider, type BallColliderOptions, BoxCollider, type BoxColliderOptions, BroadPhaseMethods, Button, type ButtonOptions, ButtonShape, Camera, type CameraOptions, type Chunk, Circumference, type Collider, type Collision, type CollisionMatrix, CollisionMethods, CollisionRepository, type CollisionResolution, type Component, type ComponentType, DarknessRenderer, type DarknessRendererOptions, type DependencyName, type DependencyType, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, GeometricRenderer, type GeometricRendererOptions, GeometricShape, InputManager, type IntervalOptions, Keyboard, LightRenderer, type LightRendererOptions, type LoadSceneOptions, MaskRenderer, type MaskRendererOptions, MaskShape, Mouse, type PlaySfxOptions, Polygon, PolygonCollider, type PolygonColliderOptions, type PropertyKey, Rectangle, type RemoveAllEntitiesOptions, RigidBody, type RigidBodyOptions, RigidBodyType, SYMBOLS, Scene, SceneManager, type SceneType, type SearchResult, type Shape, type Slice, SpriteRenderer, type SpriteRendererOptions, type System, type SystemGroup, SystemManager, type SystemType, TextAlignment, TextRenderer, type TextRendererOptions, TileAnimation, type TileAnimationOptions, type TiledChunk, type TiledGroupLayer, type TiledLayer, type TiledObject, type TiledObjectBlueprint, type TiledObjectFactory, type TiledObjectLayer, type TiledObjectProperties, type TiledProperty, type TiledTileAnimationFrame, type TiledTilemap, type TiledTileset, type TiledTilesetTile, TiledWrapper, type TiledWrapperOptions, TilemapCollider, type TilemapColliderOptions, TilemapOrientation, TilemapRenderer, type TilemapRendererOptions, type Tileset, TimeManager, type TouchInteraction, TouchScreen, Transform, type TransformOptions, Vector2, type VibrationInput, VideoRenderer, type VideoRendererOptions, between, clamp, debugRenderLayer, decorate, defaultRenderLayer, defaultTextureAtlasOptions, degreesToRadians, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };