My sprite only collides with one object instead of multiple

I have a class that holds my enemy player object and I want it to collide with my player object however when I spawn multiple enemies it only collides with the original piece.

My enemy class:

class Enemy extends Phaser.Physics.Arcade.Sprite {

constructor(scene, x, y, texture) {
    super(scene, x, y, texture = 'player2', 'tank1')
    scene.physics.add.existing(this);'update', this.update, this);, 0);

    //var x = Phaser.Math.RND.between(0, 800);
    //var y = Phaser.Math.RND.between(0, 600); = this.enemytank;

    this.setOrigin(0.5, 0.5);
    this.body.setVelocity(100, 0);
    this.body.bounce.setTo(1, 1);
    //this.physics.velocityFromRotation(this.rotation, 100, this.body.velocity);

    this.turret = new turret(scene);
    this.shadow = new shadow(scene);  

update() {



create () {

for (var i = 0; i < blength; i++)
b = this.physics.add.existing (new Enemy(this, Phaser.Math.Between(-200,, Phaser.Math.Between(-200,;


update() {

this.physics.add.collider(player, b);


any ideas would be grateful

If you want multiple enemies, which behave in the same way, I’d suggest using groups.

//add more enemies to the group here

You can then have the collider manage collisions between the player and any enemies in the same way.

this.physics.add.overlap(this.player, this.enemies, function(){/*whatever the interaction is here*/}, 
null, this);

Hope this helps.