I’m trying to create separate classes while inheriting containers. Containers work just fine on its own, but when I try to create something that inherits containers, nothing shows up. Is there something wrong with how i’m creating this container? (these are all separate files btw)
export default class SomeThing extends Phaser.GameObjects.Container {
constructor(scene, x, y) {
super(scene, x, y);
scene.add.existing(this);
console.log("SomeThing Created");
}
}
export class Game extends Scene {
constructor () {
super('Game');
}
create () {
var test = new SomeThing(0, this, 20, 20); // The console message shows up here just fine
var b = this.add.sprite(0, 0, 'items', 'items0001.png');
test.add(b); //If i dont add it to the container its fine. If i do, it disappears.
}
}