class Example extends Phaser.Scene { preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v385'); this.load.image('bunny', 'assets/sprites/bunny.png'); } create () { const bunny = this.add.sprite(400, 300, 'bunny'); bunny.alpha = 0.5; } } const config = { type: Phaser.WEBGL, parent: 'phaser-example', width: 800, height: 600, scene: Example }; const game = new Phaser.Game(config);
Scan to open on your mobile device
class Example extends Phaser.Scene { preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v385'); this.load.image('bunny', 'assets/sprites/bunny.png'); } create () { const bunny = this.add.sprite(400, 300, 'bunny'); bunny.alpha = 0.5; } } const config = { type: Phaser.WEBGL, parent: 'phaser-example', width: 800, height: 600, scene: Example }; const game = new Phaser.Game(config);