Jump to content

Phaser Reset Group?


WiLD11
 Share

Recommended Posts

Hello, I have been trying to figure something out for a while now. 

So, I have a player who catches things from above, once he catches something it gets stacked on his hand. Those things which are stacked are in a group called Slices. What I  want to do is when the player hits the number of 3 Slices the group gets reset back to 0 (so there would be no more stacked slices) and then continue with the stacking from 0.

 

Sorry if the explanation is bad :\ I will try to clear it out more if you have any questions

Thanks!

Link to comment
Share on other sites

11 minutes ago, WiLD11 said:

That would not work. As that would destroy the group in its entirety. All I want to do is kind of reset it to 0 children 

try something like this when your player hits 3 of whatever value ( if Slices is your group name )


for(var i =0; i < 3; i++){
Slices.children[i].kill()
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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