Jump to content

Get Id of object in group


smdu57
 Share

Recommended Posts

Hello

I'm using an overlap between player (joueur) and bottles (bouteilles). bottles is a group of 4 bottle and I want to know which bottle I'm interacting with in the function called by the overlap 

game.physics.arcade.overlap(joueur,bouteilles,interragitb,null,this);

then the function 

function interragitb(joueur,bouteille){
	cursors = game.input.keyboard.createCursorKeys();
	if (cursors.up.isDown && points > 0)
    {
    	bouteille.frame = bouteille.frame +1;
    	point(0);
    }
}

and I want to increment a variable to know how many times I interracted with a spécific bottle how should I do ? Is there any way to get index in the group or var name ?

 

Thank you

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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