Jump to content

Changing the shape of the body (collision)


Martiny
 Share

Recommended Posts

Well, I have this shape in my game, and I'm wondering if Phaser would let me change the sprite body of my image so it would perfectly fit its shape. I couldn't find anything in the docs/examples. Maybe I overlooked?

 

 

 

nib8.png

 

I could make it smaller, but it would still be a square. How could I change it so it could be a circle, diamond, triangle, etc?

Link to comment
Share on other sites

Right.. ArcadePhysics is limited to AABBs only (although I am playing with Circles too at the moment). However Alvin has been busy experimenting getting p2.js running inside Phaser and it's looking very promising so far, so that will be a major focus for the 1.2 release (eta would be January 2014 I'm afraid). In the meantime it's totally possible to use a pre-made physics engine (Box2DWeb, p2.js, etc) and over-ride the Sprite.body property to point to one of those instead. It's not trivial work, but it shouldn't be that insane either.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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