Citrus-Engine icon indicating copy to clipboard operation
Citrus-Engine copied to clipboard

Changing jump behavior

Open elsassph opened this issue 12 years ago • 4 comments

By default, when pressing jump key and as soon as a direction key is pressed (even very quickly) it jumps very strongly in the direction. This is undesirable, can this be modified?

elsassph avatar Dec 03 '12 16:12 elsassph

Hi Philippe, it's nice to see you there!

I suppose that you're using Nape's hero, right? The correct behaviors are with box2d prebuilt objects. Using Nape, I've tried to replicate this behavior. However I've encountered a problem :

  • in Box2D and Nape, a strong gravity prevent bodies to sleep which is a disaster on mobile devices concerning performances.
  • Box2D allows a heavier gravity than Nape. Therefore it was hard to have the same feeling between both, and I think that Box2D objects feeling are very good (it was set up before Nape addition).

Finally, I agree that Nape's hero jump behavior is bad, I will change it ASAP. It isn't always easy to find the good friction, elasticity, acceleration... ;)

alamboley avatar Dec 03 '12 16:12 alamboley

I'd time to make some test : maybe Nape had an update, now I'm able to have exactly the same gravity between Box2D & Nape, and Nape's objects are able to sleep which is very cool.

I've also updated NapePhysicsObject default material, and change acceleration of the Hero. We're more close than Box2D now, which is very cool.

alamboley avatar Dec 03 '12 21:12 alamboley

Just to be more specific: what's annoying is the strong 45° jump even if the left Arrow is pressed very shortly.

elsassph avatar Dec 03 '12 21:12 elsassph

Ok indeed, it could be better. On the todo list ;)

alamboley avatar Dec 03 '12 21:12 alamboley