Sign in to follow this  

[HELP] Group collider detection

Recommended Posts



Today I started with Phaser, I worked a lot at school with when I had free time. But I have a problem I can't delete an item in my group when my character makes a collision an item belonging to the group.

make my group: (in create function)


 game.physics.enable(character, Phaser.Physics.ARCADE);
 game.physics.enable(enemygroup, Phaser.Physics.ARCADE);

 enemygroup =;
 for(var i=0; i<10 ;i++)
            var s = enemygroup.create(,, 'monster');
            s.frame = 3;
            s.animations.add('enemymove', [2,3,4], 10, true);
            game.physics.enable(s, Phaser.Physics.ARCADE);


for detect collider:(in update function)

 game.physics.arcade.collide(character, enemygroup, function(){

 for(var i = 0; i < enemygroup.length; i++)
     if(game.physics.arcade.collide(character, enemygroup))



Thanks you for help !

good development at all and sorry for my bad english (i'm french).

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.