class MyScene extends Phaser.Scene {
constructor (config)
{
super(config);
}
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v385');
this.load.image('face', 'assets/pics/bw-face.png');
}
create ()
{
this.face = this.add.image(400, 300, 'face');
}
}
const config = {
type: Phaser.WEBGL,
width: 800,
height: 600,
backgroundColor: '#000000',
parent: 'phaser-example',
scene: MyScene
};
const game = new Phaser.Game(config);
class MyScene extends Phaser.Scene {
constructor (config)
{
super(config);
}
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v385');
this.load.image('face', 'assets/pics/bw-face.png');
}
create ()
{
this.face = this.add.image(400, 300, 'face');
}
}
const config = {
type: Phaser.WEBGL,
width: 800,
height: 600,
backgroundColor: '#000000',
parent: 'phaser-example',
scene: MyScene
};
const game = new Phaser.Game(config);