@koreez/robotlegsjs-phaser3
v0.1.0
Published
RobotlegsJS integration with Phaser Scene Manager
Downloads
2
Readme
RobotlegsJS Phaser3 Extension
Integrate RobotlegsJS framework with Phaser3.
Usage
import { Context, IContext, MVCSBundle } from "@robotlegsjs/core";
import { ContextSceneManager } from "../src";
import { PhaserBundle } from "../src/robotlegs/bender/bundles/phaser/PhaserBundle";
import "phaser";
import { Preload } from "./states/Preload";
import { SceneMediatorConfig } from "./config/SceneMediatorConfig";
import { Boot } from "./states/Boot";
import { SceneKey } from "./constants/StateKey";
import { GameConfig } from "./config/GameConfig";
export class Game extends Phaser.Game {
private _context: IContext;
constructor() {
super({
type: Phaser.CANVAS,
width: 800,
height: 600,
backgroundColor: "#010101",
parent: "phaser-example"
});
this._context = new Context();
this._context
.install(MVCSBundle, PhaserBundle)
.configure(new ContextSceneManager((this as any).scene))
.configure(SceneMediatorConfig)
.configure(GameConfig)
.initialize();
this.scene.add(SceneKey.BOOT, new Boot(SceneKey.BOOT));
this.scene.start(SceneKey.BOOT);
}
}