@koreez/robotlegsjs-phaser3

RobotlegsJS integration with Phaser Scene Manager

Usage no npm install needed!

<script type="module">
  import koreezRobotlegsjsPhaser3 from 'https://cdn.skypack.dev/@koreez/robotlegsjs-phaser3';
</script>

README

RobotlegsJS Phaser3 Extension

Gitter chat npm version styled with prettier

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);
    }
}

See example

License

MIT