Hey folks, newbie programmer here. I have some experience with phaser 2, but i’ve hit a wall with phaser 3 and extending a group.
My code looks like this for the group itself
class Enemies extends Phaser.Physics.Arcade.Group {
constructor(world, scene, config) {
super(world, scene, config);
//none of the 3 below help :confused:
/*
scene.add.existing(this);
scene.physics.add.existing(this);
scene.physics.world.enableBody(this, 0);
*/
}
and here i use new to create the group and create an enemy
_initEnemies(){
this.enemies = new Enemies(this, this);
this.sprite = this.enemies.create(100, 100, ‘playerSprites’);
}
but the enemy is not created. Nothing happens. I’ve googled left and right and found nothing. I’m also wondering if its possible to create the enemy from within the extended sprite class?
Thanks for your time