Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Best way to walk through(behind) the top of a sprite, but collide with its base?


Ralph
 Share

Recommended Posts

Hi there, basically Im planning on switching the tree's in my game to larger more extravagant trees and what I wanted to do was to be able to walk through the top of the sprite, giving the appearance that you are walking behind the tree, but not let them walk through the base of the tree. I couldn't think of a way to do this. I was thinking I would do it with 2 spites maybe? But i thought that was too redundant. I know other frameworks like RPGJS has this but I don't know if phaser does.

 

Thanks for any help in advanced. 

Link to comment
Share on other sites

Just now, phreaknation said:

You could use a polygon or rectangle to give that effect so that only part of the sprite is has a body.

Yeah I remembered after I posted that there was a way to change the shape of the phsyics body but I cant remember how. Do I need to use p2 to do it?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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