barodapride Posted January 15, 2014 Share Posted January 15, 2014 Hi all, I'm very new to phaser and I have a couple questions before I continue with my project: 1. Is there a way to make circular objects and check collisions with them? If not, can I create a larger rectangular sprite (with a circular display of the image) with a smaller hitbox to provide the illusion of accurate hit detection? 2. Is there a way to provide accurate jumping based on time holding the jump key? In the examples, a simple initial y velocity is applied to the player upon jump. In Mario, and just about any platformer ever made, the velocity is constant or changes slightly over the first couple seconds of jumping depending on how long the jump button is pressed. Thanks for any insight you can add. Link to comment Share on other sites More sharing options...
XekeDeath Posted January 15, 2014 Share Posted January 15, 2014 1) Not yet... Rich mentioned something about the new physics system that is not yet implemented being able to do more than the current AABB only. 2) Perhaps:When jump is pressed, remove gravity from player, set velocity.When jump is released, or if it is held down for a period of time, gravity is reapplied.Just thought this up, haven't implemented it at all, but I have seen others post a similar question, if they happen along, perhaps they can share what they ended up with... Link to comment Share on other sites More sharing options...
jpdev Posted January 15, 2014 Share Posted January 15, 2014 Jumping: http://www.html5gamedevs.com/topic/3050-how-to-make-the-player-do-small-medium-long-jumps/ (But read on after the accepted answer, because the next answer has improved timing (using game.time.time instead of counting update() calls.) Link to comment Share on other sites More sharing options...
rich Posted January 15, 2014 Share Posted January 15, 2014 You can change the size of the hit area (the Sprite.body), it doesn't have to match the parent sprite dimensions. It can't be a circle though. Look at the offset body examples to see how. Link to comment Share on other sites More sharing options...
DWboutin Posted January 20, 2014 Share Posted January 20, 2014 For the Precise jumping you can check my tests on http://badassgames.net/mygames/basic/I check if the character is touching the ground and the key is pressed, than i set the velocity y to -350.If the key is released, i set the velocity to 0. Link to comment Share on other sites More sharing options...
Recommended Posts