Jump to content

How to check [EASY]


szabloreki
 Share

Recommended Posts

Hi everyone

Can somebody tell me how I can check which sprite of the group [index] is colliding?

example:

 

 

this.game.physics.arcade.overlap(this.bullets, this.ENEMY.enemies, this.bulletsColision, null,this);





function bulletsColision(bullets, enemies){


console.log(enemies.id of group);






}

 

 

Link to comment
Share on other sites

I'm not sure if this is the best approach but try this:

this.game.physics.arcade.overlap(this.bullets, this.groupOfEnemies, 
    this.bulletsColision, null,this);


function bulletsColision(bullets, enemy) {
    console.log( this.groupOfEnemies.getIndex(enemy) );
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...