Jump to content

Non-Rectangle hitboxes and different physics engines


Puzz3l
 Share

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.

Link to comment
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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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