Class SceneAbstract

Base class for all game scenes.
Provides core functionality for loading assets, registering systems, and setting up entities.
Scenes are the main organizational unit for game states and levels.
Each scene has access to the EntityManager for creating/managing entities and the AssetManager for loading and accessing game resources.

class MainScene extends Scene {
loadAssets() {
this.assetManager.loadImage("image.png");
}

registerSystems() {
this.systems.push(
SomeSystem,
AnotherSystem
);
}

createEntities() {
this.entityManager.createEntity([
SomeComponent,
AnotherComponent
]);
}
}

Constructors

Properties

assetManager: AssetManager
entityManager: EntityManager
systems: SystemType[] = []

Methods

  • Override this method to create the entities needed for the scene

    Returns void

  • Override this method to register the systems that will be executed in the scene

    Returns void