Here is what my constructor look like :
constructor(params: any) {
super(params.scene, params.x, params.y, params.key);
this.initInput();
this.initEntity();
this.initAnimations();
}
And the initEntity() :
initEntity() {
this.scene.physics.world.enable(this);
this.body.setCollideWorldBounds(true);
this.scene.add.existing(this);
}
I saw other class like this that was doing all the initEntity things on params.scene
instead of this.scene
but the result is the same for me.
PS: I’m using Typescript