Just starting out with Phaser js and attempting to create a game using Object-Oriented Programming. The challenge I'm facing is trying to load my character into the scene, but nothing seems to be happening. No errors or exceptions are being thrown. I've been following this guidance:
Phaser 3 Creating Class for player
Could someone please point out what I might be doing incorrectly here?
Below is the code snippet I've been working on:
var player
class MainLevelScene extends Phaser.Scene
{
constructor() {
super('MainLevelScene');
}
preload()
{
this.load.image('sky','assets/sky.png');
}
create()
{
this.add.image(400,200,'sky');
player = this.physics.add.existing(new Player(this, 100, 450));
}
update()
{
}
}
class Player extends Phaser.Physics.Arcade.Sprite
{
constructor(MainLevelScene, x, y) {
super(MainLevelScene, x, y, 'assets/dude.png');
}
}