Hi,
This is my first post 
I’m tring to create a platform game and I want to use physics engine for jump. But I’m a little confused…
I have a “Hero” display object with added body. I use applyLinearImpulse() for jumping, triggered by “touch” event (with phase == “began” condition). A jump looks good and naturally.
But…
How can I know if a jump is finished? Cause I can’t let Hero make a “double jump” from air. Previous jump must be finished befor next Hero’s jump.
I need something like onComplete event…
So I tried to tracking Hero.y values in “enterFrame” event. My idea was: The jump is finished when Hero.y value is constant between two or three following frames.
But I’m completly surprised: Hero.y value is not an Integer, even after jump’s finish! For example: Hero.y before jump was 265 and after jump Hero.y = 265.05017089844. How is it possible?
There is a “solid” platform below the Hero of course.
And, a more important question: how can I prevent “double jump” from air?
Thank you for any help.
nosty [import]uid: 193524 topic_id: 33527 reply_id: 333527[/import]