Jump to content

How can I check if a sprite is within another sprite?


Recommended Posts

Dear community,


I am trying to move my player object towards my mouse and am trying to achieve that if the player colllides with a group of sprites (stars) that the star in the group of stars is deleted. The thing is, I only want this to happen if the player entirely covers the star. Both stars and players use the P2JS physics. I wonder if this is needed. So I have 2 problems now.


First I used arcade and i could easily move my player with the mouse. How can I do this in p2JS?

Since Im now using p2JS because of circle colliders, how can i check if another circle (star) is within the larger circle (the player)?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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