Salvatore Posted May 20, 2014 Share Posted May 20, 2014 Hi there!! How to rotate Physics.Arcade.body? I've tried set the Physics.Arcade.Body.rotation(after set the allowRotation to true) to be equal to te sprite angle, but, nothing happends... Link to comment Share on other sites More sharing options...
lewster32 Posted May 20, 2014 Share Posted May 20, 2014 You cannot rotate the body in Arcade physics. It uses a system called 'Axis Aligned Bounding Box', which is very fast but by definition does not allow the collision boxes to be rotated (the 'axis aligned' bit). If you need more accurate collision detection you may wish to try P2 instead. Salvatore 1 Link to comment Share on other sites More sharing options...
Salvatore Posted May 20, 2014 Author Share Posted May 20, 2014 I've try P2 but the movement that I planned to my sprites turn all fuzzy... I'm trying to apply this http://zofiakorcz.pl/planet-defender-circular-world-game-with-pixijs/ to phaser... P2 deoesn't have a pivot thing, so made my life dificult... Link to comment Share on other sites More sharing options...
lewster32 Posted May 20, 2014 Share Posted May 20, 2014 Ambitious! I like it! This kind of game may be difficult to replicate using the standard bundled physics libraries I'm afraid. I've not used P2 much but I assume the physics for the Planet Defender game were custom-built for this type of game, and P2 may not be entirely suitable, or at least will take some complicated wrangling to replicate this. Tilde and Salvatore 2 Link to comment Share on other sites More sharing options...
Salvatore Posted May 20, 2014 Author Share Posted May 20, 2014 Planet Defender was made in Pixis but the physics are simple. I found in P2 the Revolute Constraint, but is too hard to have it nicelly... http://docs.phaser.io/Phaser.Physics.P2.html#createRevoluteConstraint Link to comment Share on other sites More sharing options...
Recommended Posts