src/core/SceneManager.tsimport type { Container } from 'pixi.js';import type { Game } from './Game';import { Scene, type SceneClass } from './Scene';/*** Owns the currently-active Scene and provides instant scene transitions.** Lifecycle on switch():* 1. previous.exit() — scene cleans up listeners, physics bodies, etc.* 2. previous removed and destroyed (children too)* 3. new scene constructed and added to root* 4. await new.enter(data)* 5. new.resize(w, h) — gives the scene its starting size before first frame*/export class SceneManager {private current?: Scene;constructor(private game: Game,private root: Container,
Showing the first 20 lines.
Get full code