Sign in to follow this  
TomFiveThumbs

Collision within a Group

Recommended Posts

Can you check for collisions within a group?

 

I have a group of platforms, a group of boxes, and a player

 

The player collides with the platforms fine

The player collides with the boxes fine

The platforms collide with the boxes fine

 

But, I'd like the boxes to collide with each other.

 

Is this possible?

Share this post


Link to post
Share on other sites

Yes, it is possible!

 

Just add this to your update function:

game.physics.arcade.collide(group);

In action: http://examples.phaser.io/_site/view_full.html?d=arcade%20physics&f=group+vs+self.js&t=group%20vs%20self

 

 

Dang it! I was trying game.physics.arcade.collide(group, group);

 

So close!

 

thanks Zenryo

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.