SceneManager.ts

src/core/SceneManager.ts
import 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

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC