Hello,
im making a platform game with the integration of box2D, the lateral movements of my main character are working good with linear velocities.
but i got a problem on jumping method. since i need to disable jumping while its on the air, and re-enable jumping when he touches ground again, or any platform where he stands again. this is to prevent jumping again while on the air.
my first alpha solution was to re-enable jumping when linear velocity on y axis = 0, but as you imagine when he reaches maximum height Vel_y = 0 and it can jump again.
another solution was to enable jumping on the second time that vel_y reaches 0, to prevent air jumping.
but maybe i will have trouble on specific moments when floor inclination is not 0º.
any ideas how to solve this with a better method?
thanks
im making a platform game with the integration of box2D, the lateral movements of my main character are working good with linear velocities.
but i got a problem on jumping method. since i need to disable jumping while its on the air, and re-enable jumping when he touches ground again, or any platform where he stands again. this is to prevent jumping again while on the air.
my first alpha solution was to re-enable jumping when linear velocity on y axis = 0, but as you imagine when he reaches maximum height Vel_y = 0 and it can jump again.
another solution was to enable jumping on the second time that vel_y reaches 0, to prevent air jumping.
but maybe i will have trouble on specific moments when floor inclination is not 0º.
any ideas how to solve this with a better method?
thanks