class Example extends Phaser.Scene { constructor () { super({ key: "Boot" }); } preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v355'); this.load.image('face', 'assets/pics/bw-face.png'); } create () { this.face = this.add.image(400, 300, 'face'); } } const config = { type: Phaser.CANVAS, parent: 'phaser-example', width: 800, height: 600 }; const game = new Phaser.Game(config); game.scene.add('Boot', Example); game.scene.start('Boot');
Scan to open on your mobile device
class Example extends Phaser.Scene { constructor () { super({ key: "Boot" }); } preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v355'); this.load.image('face', 'assets/pics/bw-face.png'); } create () { this.face = this.add.image(400, 300, 'face'); } } const config = { type: Phaser.CANVAS, parent: 'phaser-example', width: 800, height: 600 }; const game = new Phaser.Game(config); game.scene.add('Boot', Example); game.scene.start('Boot');