Object Jumps Like Crazy

Im trying to create a Doodle Jump “style” app but the character keeps jumping like
crazy every time it jumps on the platform. For example instead of having a stable
jump every time character lands on the platform it jumps higher and higher until
eventually it leaves the screen. I tried basing the jump with gravity / bounce physics
I also tried applying linear damping and I messed around a bit with apply linear impulse
and force but nothing seems to get it done right. What I want is a stable jump just like
Doodle Jump, Any help is appreciated Thank You! [import]uid: 30314 topic_id: 15289 reply_id: 315289[/import]

Linear impulse is a good way of doing jumps in my experience, although sometimes I’ve found transition.to is better.

Applying force will make the object jump like crazy because it stacks.

Peach :slight_smile: [import]uid: 52491 topic_id: 15289 reply_id: 56487[/import]

Also you can do this to reset the velocity after initial collision with each platform.

--Reset the objects linear velocity  
myObject:setLinearVelocity(0, 0)  
  
--Apply impulse  
myObject:applyLinearImpusle(0, -100, myObject.x, myObject.y)  

That way by resetting it each time a collision occurs with a platform the jump height will always be consistent and not constantly stacked up against the previous velocity [import]uid: 84637 topic_id: 15289 reply_id: 56525[/import]

Thanks for the reply both of you, I tried both methods and a bunch of
other ways and none seem to give me the proper results, always the object
will jump higher and higher each time it lands. Do you think you can provide
a sample code to try out that will limit the character to only jump at a certain
hight each time it lands? >< thank you [import]uid: 30314 topic_id: 15289 reply_id: 56598[/import]