Newer
Older
rpg / apps / game / src / scenes / BootScene.ts
import type { Scene } from '@rpg/engine';
import type { Game } from '../Game';
import { MenuScene } from './MenuScene';

/**
 * Загрузочная сцена: пока ассетов нет, просто ждём кадр-два и уходим в меню.
 * Здесь же в будущем — прогрессивная загрузка текстур и звуковых пакетов.
 */
export class BootScene implements Scene {
    private wait = 0.2;

    constructor(private game: Game) {}

    enter(): void {}

    exit(): void {}

    update(dt: number): void {
        this.wait -= dt;
        if (this.wait <= 0) {
            void this.game.scenes.replace(new MenuScene(this.game));
        }
    }

    render(): void {}
}