angry-pixel 1.1.1 → 1.1.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 (56) hide show
  1. package/lib/component/Animator.d.ts +8 -4
  2. package/lib/component/AudioPlayer.d.ts +6 -4
  3. package/lib/component/Button.d.ts +42 -0
  4. package/lib/component/Camera.d.ts +1 -2
  5. package/lib/component/RigidBody.d.ts +5 -4
  6. package/lib/component/Transform.d.ts +4 -4
  7. package/lib/component/collider/BallCollider.d.ts +3 -2
  8. package/lib/component/collider/BoxCollider.d.ts +3 -2
  9. package/lib/component/collider/Collider.d.ts +6 -1
  10. package/lib/component/collider/EdgeCollider.d.ts +7 -4
  11. package/lib/component/collider/PolygonCollider.d.ts +7 -4
  12. package/lib/component/collider/TilemapCollider.d.ts +3 -2
  13. package/lib/component/rendering/MaskRenderer.d.ts +3 -2
  14. package/lib/component/rendering/SpriteRenderer.d.ts +6 -5
  15. package/lib/component/rendering/TextRenderer.d.ts +3 -2
  16. package/lib/component/rendering/tilemap/CsvTilemapRenderer.d.ts +6 -6
  17. package/lib/component/rendering/tilemap/TileData.d.ts +9 -6
  18. package/lib/component/rendering/tilemap/TiledTilemapRenderer.d.ts +10 -5
  19. package/lib/component/rendering/tilemap/TilemapRenderer.d.ts +9 -7
  20. package/lib/core/Component.d.ts +41 -86
  21. package/lib/core/Game.d.ts +14 -15
  22. package/lib/core/GameActor.d.ts +95 -0
  23. package/lib/core/GameObject.d.ts +69 -88
  24. package/lib/core/Scene.d.ts +6 -65
  25. package/lib/core/facades/GameObjectManagerFacade.d.ts +41 -25
  26. package/lib/core/facades/TimeManagerFacade.d.ts +1 -0
  27. package/lib/core/managers/AssetManager.d.ts +5 -2
  28. package/lib/core/managers/GameObjectManager.d.ts +11 -10
  29. package/lib/core/managers/HeadlessIterationManager.d.ts +29 -0
  30. package/lib/core/managers/IterationManager copy.d.ts +42 -0
  31. package/lib/core/managers/IterationManager.d.ts +19 -7
  32. package/lib/core/managers/IterationManagerOld.d.ts +42 -0
  33. package/lib/core/managers/SceneManager.d.ts +5 -4
  34. package/lib/core/managers/TimeManager.d.ts +10 -6
  35. package/lib/core/managers/headless/HeadlessIterationManager.d.ts +29 -0
  36. package/lib/core/managers/headless/HeadlessRenderManager.d.ts +10 -0
  37. package/lib/core/managers/iteration/BrowserIterationManager.d.ts +35 -0
  38. package/lib/core/managers/iteration/FrameEvent.d.ts +13 -0
  39. package/lib/core/managers/iteration/HeadlessIterationManager.d.ts +29 -0
  40. package/lib/core/managers/iteration/IIterationManager.d.ts +7 -0
  41. package/lib/gameObject/GameCamera.d.ts +2 -2
  42. package/lib/index.cjs.js +1 -1
  43. package/lib/index.d.ts +3 -1
  44. package/lib/index.esm.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/input/GamepadController.d.ts +16 -4
  47. package/lib/math/Rectangle.d.ts +9 -2
  48. package/lib/math/Utils.d.ts +8 -2
  49. package/lib/physics/collision/CollisionManager.d.ts +7 -3
  50. package/lib/physics/collision/resolver/AABBResolver.d.ts +2 -2
  51. package/lib/physics/collision/resolver/SatResolver.d.ts +1 -2
  52. package/lib/physics/rigodBody/RigidBodyData.d.ts +2 -1
  53. package/lib/physics/rigodBody/RigidBodyManager.d.ts +4 -1
  54. package/lib/rendering/RenderManager.d.ts +8 -1
  55. package/lib/rendering/renderData/TextRenderData.d.ts +1 -1
  56. package/package.json +1 -1
@@ -1,54 +1,70 @@
1
- import { GameObjectManager, GameObjectFactory } from "../managers/GameObjectManager";
2
- import { GameObject } from "../GameObject";
1
+ import { GameObjectManager } from "../managers/GameObjectManager";
2
+ import { GameObject, GameObjectClass } from "../GameObject";
3
+ import { InitOptions } from "../GameActor";
3
4
  export declare class GameObjectManagerFacade {
4
5
  private static manager;
5
6
  static initialize(manager: GameObjectManager): void;
6
7
  /**
7
- * @param gameObjectFactory The factory function for the game object
8
- * @param name The name of the game object, this must not be used by another game object
9
- * @param parent (optional) The parent game object
8
+ * Adds a new game object to the scene.
9
+ * @param gameObjectClass The class of the game object
10
+ * @param options [optional] This options will be passed to the init method
11
+ * @param parent [optional] The parent game object
12
+ * @param name [optional] The name of the game object
10
13
  * @returns the added game object
11
14
  */
12
- static addGameObject<T extends GameObject>(gameObjectFactory: GameObjectFactory, name: string, parent?: GameObject): T;
15
+ static addGameObject<T extends GameObject>(gameObjectClass: GameObjectClass<T>, options?: InitOptions, parent?: GameObject, name?: string): T;
13
16
  /**
14
- * @returns All the added game objects
17
+ * Returns all the game objects in the scene.
18
+ * @returns The found game objects
15
19
  */
16
- static getGameObjects(): GameObject[];
20
+ static findAllGameObjects(): GameObject[];
17
21
  /**
22
+ * Returns a collection of game objects found for the given class
23
+ * @param gameObjectClass The game object class to find
24
+ * @returns The found game objects
25
+ */
26
+ static findGameObjects<T extends GameObject>(gameObjectClass: GameObjectClass<T>): T[];
27
+ /**
28
+ * Returns the first game object found for the given class, or undefined otherwise.
29
+ * @param gameObjectClass The game object class to find
30
+ * @returns The found game object
31
+ */
32
+ static findGameObject<T extends GameObject>(gameObjectClass: GameObjectClass<T>): T;
33
+ /**
34
+ * Returns the first game object found for the given name, or undefined otherwise.
18
35
  * @param name The name of the game object to find
19
36
  * @returns The found game object
20
37
  */
21
- static findGameObjectByName<T extends GameObject>(name: string): T;
38
+ static findGameObject<T extends GameObject>(name: string): T;
22
39
  /**
40
+ * Returns a collection of game objects found for the given parent
23
41
  * @param parent The parent game object
24
42
  * @returns The found game objects
25
43
  */
26
- static findGameObjectsByParent(parent: GameObject): GameObject[];
44
+ static findGameObjectsByParent<T extends GameObject>(parent: GameObject): T[];
27
45
  /**
28
- *
46
+ * Returns the first child found for the given parent and class, or undefined otherwise.
29
47
  * @param parent The parent game object
30
- * @param name The name of the game object to find
31
- * @returns The found game objects
48
+ * @param gameObjectClass The class of the child game object to find
49
+ * @returns The found child game object
32
50
  */
33
- static findGameObjectByParentAndName<T extends GameObject>(parent: GameObject, name: string): T;
51
+ static findGameObjectByParent<T extends GameObject>(parent: GameObject, gameObjectClass: GameObjectClass<T>): T;
34
52
  /**
35
- * @param tag The tag of the game objects to find
36
- * @returns The found game objects
53
+ * Returns the first child found for the given parent and name, or undefined otherwise.
54
+ * @param parent The parent game object
55
+ * @param name The name of the child game object to find
56
+ * @returns The found child game object
37
57
  */
38
- static findGameObjectsByTag(tag: string): GameObject[];
58
+ static findGameObjectByParent<T extends GameObject>(parent: GameObject, name: string): T;
39
59
  /**
40
- * @param tag The tag of the game object to find
41
- * @returns The found game object
60
+ * Returns a collection of game objects found for the given tag
61
+ * @param tag The tag of the game objects to find
62
+ * @returns The found game objects
42
63
  */
43
- static findGameObjectByTag<T extends GameObject>(tag: string): T;
64
+ static findGameObjectsByTag<T extends GameObject>(tag: string): T[];
44
65
  /**
45
66
  * Destroy the game objects
46
67
  * @param gameObject The game object to destory
47
68
  */
48
69
  static destroyGameObject(gameObject: GameObject): void;
49
- /**
50
- * Destroy one game objects by its name
51
- * @param name The name of the game object
52
- */
53
- static destroyGameObjectByName(name: string): void;
54
70
  }
@@ -7,4 +7,5 @@ export declare class TimeManagerFacade {
7
7
  static setTimeScale(scale: number): void;
8
8
  static get unscaledDeltaTime(): number;
9
9
  static get physicsDeltaTime(): number;
10
+ static get browserDeltaTime(): number;
10
11
  }
@@ -3,13 +3,16 @@ export declare enum AssetType {
3
3
  Audio = "Audio",
4
4
  Video = "Video"
5
5
  }
6
+ export interface IAssetManager {
7
+ getAssetsLoaded(): boolean;
8
+ loadImage(url: string): HTMLImageElement;
9
+ }
6
10
  export declare class AssetManager {
7
11
  private assets;
8
12
  getAssetsLoaded(): boolean;
9
- laadImage(url: string): HTMLImageElement;
13
+ loadImage(url: string): HTMLImageElement;
10
14
  loadAudio(url: string): HTMLAudioElement;
11
15
  getImage(url: string): HTMLImageElement;
12
- getVideo(url: string): HTMLVideoElement;
13
16
  getAudio(url: string): HTMLAudioElement;
14
17
  getAsset<EType extends HTMLImageElement | HTMLVideoElement | HTMLAudioElement>(url: string, type?: AssetType | null): EType;
15
18
  private createAsset;
@@ -1,15 +1,16 @@
1
- import { GameObject } from "../GameObject";
2
- export declare type GameObjectFactory = () => GameObject;
1
+ import { GameObject, GameObjectClass } from "../GameObject";
2
+ import { InitOptions } from "../GameActor";
3
3
  export declare class GameObjectManager {
4
4
  private gameObjects;
5
- addGameObject<T extends GameObject>(gameObjectFactory: GameObjectFactory, name: string, parent?: GameObject): T;
6
- getGameObjects(): GameObject[];
7
- findGameObjectById(id: string): GameObject;
8
- findGameObjectByName(name: string): GameObject;
9
- findGameObjectsByParent(parent: GameObject): GameObject[];
10
- findGameObjectByParentAndName(parent: GameObject, name: string): GameObject;
11
- findGameObjectsByTag(tag: string): GameObject[];
12
- findGameObjectByTag(tag: string): GameObject;
5
+ addGameObject<T extends GameObject>(gameObjectClass: GameObjectClass<T>, options?: InitOptions, parent?: GameObject, name?: string): T;
6
+ findGameObjects<T extends GameObject>(gameObjectClass?: GameObjectClass<T>): T[];
7
+ findGameObjectById<T extends GameObject>(id: string): T;
8
+ findGameObject<T extends GameObject>(gameObjectClass: GameObjectClass<T>): T;
9
+ findGameObject<T extends GameObject>(name: string): T;
10
+ findGameObjectsByParent<T extends GameObject>(parent: GameObject): T[];
11
+ findGameObjectByParent<T extends GameObject>(parent: GameObject, gameObjectClass: GameObjectClass<T>): T;
12
+ findGameObjectByParent<T extends GameObject>(parent: GameObject, name: string): T;
13
+ findGameObjectsByTag<T extends GameObject>(tag: string): T[];
13
14
  destroyAllGameObjects(): void;
14
15
  destroyGameObject(gameObject: GameObject): void;
15
16
  private destroy;
@@ -0,0 +1,29 @@
1
+ import { GameObjectManager } from "./GameObjectManager";
2
+ import { SceneManager } from "./SceneManager";
3
+ import { CollisionManager } from "../../physics/collision/CollisionManager";
4
+ import { RigidBodyManager } from "../../physics/rigodBody/RigidBodyManager";
5
+ import { TimeManager } from "./TimeManager";
6
+ import { IIterationManager } from "./IterationManager";
7
+ export declare class HeadlessIterationManager implements IIterationManager {
8
+ private readonly timeManager;
9
+ private readonly collisionManager;
10
+ private readonly physicsManager;
11
+ private readonly gameObjectManager;
12
+ private readonly sceneManager;
13
+ running: boolean;
14
+ private currentScene;
15
+ private gameObjects;
16
+ private components;
17
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
18
+ start(): void;
19
+ pause(): void;
20
+ resume(): void;
21
+ stop(): void;
22
+ private startLoop;
23
+ private gameLogicIteration;
24
+ private physicsIteration;
25
+ private asyncGameLoop;
26
+ private asyncPhysicsLoop;
27
+ private load;
28
+ private dispatchFrameEvent;
29
+ }
@@ -0,0 +1,42 @@
1
+ import { GameObjectManager } from "./GameObjectManager";
2
+ import { SceneManager } from "./SceneManager";
3
+ import { InputManager } from "../../input/InputManager";
4
+ import { CollisionManager } from "../../physics/collision/CollisionManager";
5
+ import { RigidBodyManager } from "../../physics/rigodBody/RigidBodyManager";
6
+ import { RenderManager } from "../../rendering/RenderManager";
7
+ import { TimeManager } from "./TimeManager";
8
+ export declare enum FrameEvent {
9
+ Init = 0,
10
+ Start = 1,
11
+ Update = 2,
12
+ UpdateEngine = 3,
13
+ UpdateCollider = 4,
14
+ UpdatePhysics = 5,
15
+ UpdateTransform = 6,
16
+ UpdatePreRender = 7,
17
+ UpdateCamera = 8,
18
+ UpdateRender = 9,
19
+ Destroy = 10
20
+ }
21
+ export declare class IterationManager {
22
+ private readonly timeManager;
23
+ private readonly collisionManager;
24
+ private readonly physicsManager;
25
+ private readonly renderManager;
26
+ private readonly inputManager;
27
+ private readonly gameObjectManager;
28
+ private readonly sceneManager;
29
+ private gameLoopAccumulator;
30
+ private physicsLoopAccumulator;
31
+ private currentScene;
32
+ private gameObjects;
33
+ private components;
34
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, renderManager: RenderManager, inputManager: InputManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
35
+ update(time: number): void;
36
+ private load;
37
+ private mainIteration;
38
+ private physicsIteration;
39
+ private preRenderIteration;
40
+ private renderIteration;
41
+ private dispatchFrameEvent;
42
+ }
@@ -18,7 +18,14 @@ export declare enum FrameEvent {
18
18
  UpdateRender = 9,
19
19
  Destroy = 10
20
20
  }
21
- export declare class IterationManager {
21
+ export interface IIterationManager {
22
+ running: boolean;
23
+ start(): void;
24
+ pause(): void;
25
+ resume(): void;
26
+ stop(): void;
27
+ }
28
+ export declare class IterationManager implements IIterationManager {
22
29
  private readonly timeManager;
23
30
  private readonly collisionManager;
24
31
  private readonly physicsManager;
@@ -26,17 +33,22 @@ export declare class IterationManager {
26
33
  private readonly inputManager;
27
34
  private readonly gameObjectManager;
28
35
  private readonly sceneManager;
36
+ running: boolean;
29
37
  private gameLoopAccumulator;
30
- private physicsLoopAccumulator;
31
38
  private currentScene;
32
39
  private gameObjects;
33
40
  private components;
34
41
  constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, renderManager: RenderManager, inputManager: InputManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
35
- update(time: number): void;
36
- private load;
37
- private mainIteration;
38
- private physicsIteration;
39
- private preRenderIteration;
42
+ start(): void;
43
+ pause(): void;
44
+ resume(): void;
45
+ stop(): void;
46
+ private startLoop;
47
+ private requestAnimationLoop;
48
+ private gameLogicIteration;
40
49
  private renderIteration;
50
+ private physicsIteration;
51
+ private asyncPhysicsLoop;
52
+ private load;
41
53
  private dispatchFrameEvent;
42
54
  }
@@ -0,0 +1,42 @@
1
+ import { GameObjectManager } from "./GameObjectManager";
2
+ import { SceneManager } from "./SceneManager";
3
+ import { InputManager } from "../../input/InputManager";
4
+ import { CollisionManager } from "../../physics/collision/CollisionManager";
5
+ import { RigidBodyManager } from "../../physics/rigodBody/RigidBodyManager";
6
+ import { RenderManager } from "../../rendering/RenderManager";
7
+ import { TimeManager } from "./TimeManager";
8
+ export declare enum FrameEvent {
9
+ Init = 0,
10
+ Start = 1,
11
+ Update = 2,
12
+ UpdateEngine = 3,
13
+ UpdateCollider = 4,
14
+ UpdatePhysics = 5,
15
+ UpdateTransform = 6,
16
+ UpdatePreRender = 7,
17
+ UpdateCamera = 8,
18
+ UpdateRender = 9,
19
+ Destroy = 10
20
+ }
21
+ export declare class IterationManager {
22
+ private readonly timeManager;
23
+ private readonly collisionManager;
24
+ private readonly physicsManager;
25
+ private readonly renderManager;
26
+ private readonly inputManager;
27
+ private readonly gameObjectManager;
28
+ private readonly sceneManager;
29
+ private gameLoopAccumulator;
30
+ private physicsLoopAccumulator;
31
+ private currentScene;
32
+ private gameObjects;
33
+ private components;
34
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, renderManager: RenderManager, inputManager: InputManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
35
+ update(time: number): void;
36
+ private load;
37
+ private mainIteration;
38
+ private physicsIteration;
39
+ private preRenderIteration;
40
+ private renderIteration;
41
+ private dispatchFrameEvent;
42
+ }
@@ -1,18 +1,19 @@
1
1
  import { Game } from "../Game";
2
2
  import { Scene } from "../Scene";
3
3
  import { RenderManager } from "../../rendering/RenderManager";
4
- export declare type SceneConstructor = () => Scene;
4
+ import { InitOptions } from "../GameActor";
5
+ export declare type SceneClass = new (name: string, game: Game) => Scene;
5
6
  export declare class SceneManager {
6
7
  private game;
7
- private renderManager;
8
+ private renderManager?;
8
9
  private scenes;
9
10
  private currentScene;
10
11
  private openingSceneName;
11
12
  private sceneToLoad;
12
13
  currentSceneName: string;
13
- constructor(game: Game, renderManager: RenderManager);
14
+ constructor(game: Game, renderManager?: RenderManager);
14
15
  getCurrentScene<T extends Scene>(): T;
15
- addScene(name: string, sceneConstructor: SceneConstructor, openingScene?: boolean): void;
16
+ addScene(sceneClass: SceneClass, name: string, options?: InitOptions, openingScene?: boolean): void;
16
17
  loadOpeningScene(): void;
17
18
  loadScene(name: string): void;
18
19
  update(): void;
@@ -1,7 +1,6 @@
1
- export declare const MIN_BROWSER_FRAMERATE = 15;
1
+ export declare const MIN_GAME_FRAMERATE = 15;
2
2
  export declare const DEFAULT_GAME_FRAMERATE = 60;
3
- export declare const MIN_PHYSICS_FRAMERATE = 60;
4
- export declare const DEFAULT_PHYSICS_FRAMERATE = 240;
3
+ export declare const DEFAULT_PHYSICS_FRAMERATE = 180;
5
4
  export declare class TimeManager {
6
5
  readonly minGameDeltatime: number;
7
6
  readonly minPhysicsDeltaTime: number;
@@ -9,12 +8,17 @@ export declare class TimeManager {
9
8
  readonly physicsFramerate: number;
10
9
  timeScale: number;
11
10
  browserDeltaTime: number;
11
+ gameDeltaTime: number;
12
12
  unscaledGameDeltaTime: number;
13
13
  unscaledPhysicsDeltaTime: number;
14
- private readonly max;
15
- private then;
14
+ private readonly maxDeltaTime;
15
+ private thenForGame;
16
+ private thenForPhysics;
17
+ private thenForBrowser;
16
18
  constructor(physicsFramerate: number);
17
- update(time: number): void;
19
+ updateForGame(time: number): void;
20
+ updateForBrowser(time: number): void;
21
+ updateForPhysics(time: number): void;
18
22
  get deltaTime(): number;
19
23
  get physicsDeltaTime(): number;
20
24
  }
@@ -0,0 +1,29 @@
1
+ import { GameObjectManager } from "../GameObjectManager";
2
+ import { SceneManager } from "../SceneManager";
3
+ import { CollisionManager } from "../../../physics/collision/CollisionManager";
4
+ import { RigidBodyManager } from "../../../physics/rigodBody/RigidBodyManager";
5
+ import { TimeManager } from "../TimeManager";
6
+ import { IIterationManager } from "../IterationManager";
7
+ export declare class HeadlessIterationManager implements IIterationManager {
8
+ private readonly timeManager;
9
+ private readonly collisionManager;
10
+ private readonly physicsManager;
11
+ private readonly gameObjectManager;
12
+ private readonly sceneManager;
13
+ running: boolean;
14
+ private currentScene;
15
+ private gameObjects;
16
+ private components;
17
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
18
+ start(): void;
19
+ pause(): void;
20
+ resume(): void;
21
+ stop(): void;
22
+ private startLoop;
23
+ private gameLogicIteration;
24
+ private physicsIteration;
25
+ private asyncGameLoop;
26
+ private asyncPhysicsLoop;
27
+ private load;
28
+ private dispatchFrameEvent;
29
+ }
@@ -0,0 +1,10 @@
1
+ import { CameraData } from "../../../rendering/CameraData";
2
+ import { RenderData } from "../../../rendering/renderData/RenderData";
3
+ import { IRenderManager } from "../../../rendering/RenderManager";
4
+ export declare class HeadlessRenderManager implements IRenderManager {
5
+ clearCanvas(): void;
6
+ addRenderData(renderData: RenderData): void;
7
+ addCameraData(cameraData: CameraData): void;
8
+ render(): void;
9
+ clearData(): void;
10
+ }
@@ -0,0 +1,35 @@
1
+ import { GameObjectManager } from "../GameObjectManager";
2
+ import { SceneManager } from "../SceneManager";
3
+ import { InputManager } from "../../../input/InputManager";
4
+ import { CollisionManager } from "../../../physics/collision/CollisionManager";
5
+ import { RigidBodyManager } from "../../../physics/rigodBody/RigidBodyManager";
6
+ import { RenderManager } from "../../../rendering/RenderManager";
7
+ import { TimeManager } from "../TimeManager";
8
+ import { IIterationManager } from "./IIterationManager";
9
+ export declare class BrowserIterationManager implements IIterationManager {
10
+ private readonly timeManager;
11
+ private readonly collisionManager;
12
+ private readonly physicsManager;
13
+ private readonly renderManager;
14
+ private readonly inputManager;
15
+ private readonly gameObjectManager;
16
+ private readonly sceneManager;
17
+ running: boolean;
18
+ private gameLoopAccumulator;
19
+ private currentScene;
20
+ private gameObjects;
21
+ private components;
22
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, renderManager: RenderManager, inputManager: InputManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
23
+ start(): void;
24
+ pause(): void;
25
+ resume(): void;
26
+ stop(): void;
27
+ private startLoop;
28
+ private requestAnimationLoop;
29
+ private gameLogicIteration;
30
+ private renderIteration;
31
+ private physicsIteration;
32
+ private asyncPhysicsLoop;
33
+ private load;
34
+ private dispatchFrameEvent;
35
+ }
@@ -0,0 +1,13 @@
1
+ export declare enum FrameEvent {
2
+ Init = 0,
3
+ Start = 1,
4
+ Update = 2,
5
+ UpdateEngine = 3,
6
+ UpdateCollider = 4,
7
+ UpdatePhysics = 5,
8
+ UpdateTransform = 6,
9
+ UpdatePreRender = 7,
10
+ UpdateCamera = 8,
11
+ UpdateRender = 9,
12
+ Destroy = 10
13
+ }
@@ -0,0 +1,29 @@
1
+ import { GameObjectManager } from "../GameObjectManager";
2
+ import { SceneManager } from "../SceneManager";
3
+ import { CollisionManager } from "../../../physics/collision/CollisionManager";
4
+ import { RigidBodyManager } from "../../../physics/rigodBody/RigidBodyManager";
5
+ import { TimeManager } from "../TimeManager";
6
+ import { IIterationManager } from "./IIterationManager";
7
+ export declare class HeadlessIterationManager implements IIterationManager {
8
+ private readonly timeManager;
9
+ private readonly collisionManager;
10
+ private readonly physicsManager;
11
+ private readonly gameObjectManager;
12
+ private readonly sceneManager;
13
+ running: boolean;
14
+ private currentScene;
15
+ private gameObjects;
16
+ private components;
17
+ constructor(timeManager: TimeManager, collisionManager: CollisionManager, physicsManager: RigidBodyManager, gameObjectManager: GameObjectManager, sceneManager: SceneManager);
18
+ start(): void;
19
+ pause(): void;
20
+ resume(): void;
21
+ stop(): void;
22
+ private startLoop;
23
+ private gameLogicIteration;
24
+ private physicsIteration;
25
+ private asyncGameLoop;
26
+ private asyncPhysicsLoop;
27
+ private load;
28
+ private dispatchFrameEvent;
29
+ }
@@ -0,0 +1,7 @@
1
+ export interface IIterationManager {
2
+ running: boolean;
3
+ start(): void;
4
+ pause(): void;
5
+ resume(): void;
6
+ stop(): void;
7
+ }
@@ -2,8 +2,8 @@ import { GameObject } from "../core/GameObject";
2
2
  import { Camera } from "../component/Camera";
3
3
  import { Rectangle } from "../math/Rectangle";
4
4
  export declare class GameCamera extends GameObject {
5
- readonly camera: Camera;
6
- constructor();
5
+ camera: Camera;
6
+ protected init(): void;
7
7
  set layers(layers: string[]);
8
8
  get layers(): string[];
9
9
  set depth(depth: number);