Has anyone implemented jump physics into their Box2D game?
I tried the simple approach of using ApplyImpulse. Instead of the quick jump & land I'd hoped for, the character seems too 'floaty'.
So far, it looks like I'll need to implement something using force, impulse, and timer. Ideally someone else already has a solution they can share?
I tried the simple approach of using ApplyImpulse. Instead of the quick jump & land I'd hoped for, the character seems too 'floaty'.
Code:
-(void) jump {
boxBody->ApplyImpulse(b2Vec2(0.0,kJumpImpulse), boxBody->GetWorldCenter());
}
-(void) jumpHigh {
boxBody->ApplyImpulse(b2Vec2(0.0,1.5*kJumpImpulse), boxBody->GetWorldCenter());
}
boxBody->ApplyImpulse(b2Vec2(0.0,kJumpImpulse), boxBody->GetWorldCenter());
}
-(void) jumpHigh {
boxBody->ApplyImpulse(b2Vec2(0.0,1.5*kJumpImpulse), boxBody->GetWorldCenter());
}
So far, it looks like I'll need to implement something using force, impulse, and timer. Ideally someone else already has a solution they can share?