Sign in to follow this  
Puzz3l

Non-Rectangle hitboxes and different physics engines

Recommended Posts

Is it possible to have a non rectangular hit box? I found these docs (oddly not from Phaser.io but look identical) which have a setCircle() and setPolygon() method for the Phaser.Physics.Arcade.Body, but the official Phaser docs do not. I see that the Ninja and P2 physics classes have a body element with some methods that look promising, but the rest of my project uses Arcade and there are some vague statements in the docs that make me think that there are some unimplemented features in the library. Can you have mixed physics? Can I implement arcade methods in Ninja or P2 (e.g. moveToObject(), angleToPointer(), etc.) easily?

 

A larger scale question I have; what are the different physics systems for? The docs sort of explain the differences but I'm still unclear.

Share this post


Link to post
Share on other sites

Before phaser 2.0 rich had started to add more features into the arcade physics (which is what you see in the 1.1.6 docs that you linked).

But this was abandoned in favor of different physics engines for phaser 2.0

Arcade is now again strictly rectangles. For polygone/circle collision and other advanced stuff you have to use the p2 engine.

 

The best place to start to check out the physic-engines is http://examples.phaser.io/

All physic-engines have their own area there, and you get to see most of the features directly in action, with the source-code directly below.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.