Martiny Posted December 10, 2013 Share Posted December 10, 2013 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? 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 More sharing options...
Mike Posted December 10, 2013 Share Posted December 10, 2013 For the moment there isn't such a feature and the arcade collision is trough rectangles only, also no rotation. Link to comment Share on other sites More sharing options...
Martiny Posted December 10, 2013 Author Share Posted December 10, 2013 That's sad ): I could try to do something without Phaser to handle this type of collisions, but I guess I'll lose cool stuff like game.physics.collide() in the process. Link to comment Share on other sites More sharing options...
rich Posted December 10, 2013 Share Posted December 10, 2013 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 More sharing options...
Martiny Posted December 10, 2013 Author Share Posted December 10, 2013 Thanks for the response! Link to comment Share on other sites More sharing options...
LuckieLordie Posted December 11, 2013 Share Posted December 11, 2013 I've managed to get Chipmunk JS working at the minute so It's perfectly doable! https://github.com/josephg/Chipmunk-js git link for you.Lookout though, you're going to be trying to use documentation written in C to use it xD Link to comment Share on other sites More sharing options...
Recommended Posts