import GameObject from './GameObject.js'; /** * Represents a separate world or level in the game. * Scenes manage their own set of game objects and lifecycle. */ export default abstract class Scene { /** The set of game objects currently in the scene. */ objects: Set; /** * Called once when the scene becomes active. * Useful for initialising scene-specific objects. */ onLoad(): void; /** * Called when the game window or container is resized. * Useful for updating UI positions or camera bounds. * @param width The new width of the game window. * @param height The new height of the game window. */ onResize?(width: number, height: number): void; /** * Called every frame to update game logic within the scene. */ update(): void; /** * Adds a game object to the scene. * @param object The object to add. */ add(object: GameObject): void; /** * Removes a game object from the scene. * @param object The object to remove. */ remove(object: GameObject): void; /** * Removes all objects from the scene. */ clear(): void; }