shohan4556

[Help] Collide same sprite with different image

Recommended Posts

3 minutes ago, gilber966 said:

Hola

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath

If any of the 4 points of the small cube, it is within the triangle

 

I dont understand why isPointPath can do this. 

I want to do with Phaser.

is there any way to do it with Phaser.

Share this post


Link to post
Share on other sites

You see why not use frameworks.


Do not try the large square as a square, treat him like two triangles, then each point of the four that make up the small square, you calculate if within any triangle, if only one is inside is that your picture small collided with one of the two triangles.

 

 

 

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...

  • Recently Browsing   0 members

    No registered users viewing this page.