Game.ts

src/core/Game.ts
import { Application, Container } from 'pixi.js';
import * as TWEEN from '@tweenjs/tween.js';
import { COLORS } from '../constants';
import { InputManager } from '../systems/InputManager';
import { AudioManager } from '../systems/AudioManager';
import { AssetManager } from '../systems/AssetManager';
import { PhysicsWorld } from '../systems/PhysicsWorld';
import { SceneManager } from './SceneManager';
/**
* Top-level game orchestrator. Owns the PIXI application, systems (input,
* audio, physics, assets), and the scene manager.
*
* Lifecycle:
* const game = new Game();
* await game.init(rootElement); // bootstraps PIXI + Rapier
* await game.scenes.switch(MenuScene);
*
* The render loop is driven by PIXI's ticker; per-frame logic delegates to
* SceneManager.update(dt). The canvas auto-resizes to the parent and propagates

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