Re: Is realistic jumping even possibru without love.physics
Posted: Sat Dec 10, 2011 9:06 pm
I think the problem is everybody has slightly different ways they like to handle this stuff. You could try directly setting player.velocity.y instead of player.v, I think that might do something.
A good way to start is just make the jump key push the player up, then put in checks like only allow it to happen for a fraction of a second and reset the timer when the player lands, etc until you get something that does roughly what you think it should.
love.physics (box2D) is actually really poor for creating "realistic" jumping. I use it for In The Dark and it takes a lot of tweaking just to make non exploitable jump code. One big problem with making jumps feel right is variation in speed. I do this:
Which I'll grant is a horrible mess, but what I do is define the maximum height the player can reach (jumpLocY), and apply increasing acceleration until the player gets about half way, then apply less and less force for the rest of the jump. It works reasonably well and allows for pretty decent "mario like" small jumps by quickly tapping the jump key.
A good way to start is just make the jump key push the player up, then put in checks like only allow it to happen for a fraction of a second and reset the timer when the player lands, etc until you get something that does roughly what you think it should.
love.physics (box2D) is actually really poor for creating "realistic" jumping. I use it for In The Dark and it takes a lot of tweaking just to make non exploitable jump code. One big problem with making jumps feel right is variation in speed. I do this:
Code: Select all
player.b:applyLinearImpulse(0,((-113 + math.abs((jumpLocY-90-bump.y)/3))) *physdt )