Now to my problems.
I'm just testing out löve really, And what i'm trying to do is make a platform game with physics. I got some standard game mechanics down, But one thing i want to do is make a camera follow my character (just a white ball) when it's moved vertically(so the camera only moves up and down, not to the sides). On that i haven't even started, don't know where to start to be honest.
2nd problem is with jumping. Right now my character can actually jump, But the problem is you can jump as often as you want, so if you spam the jump key the character just keeps going up. I used objects.ball.body:applyImpulse for the jumping. I had an idea on how to deal with this earlier, but that doesn't work that well..it prevents double jumping, but you can still just spam the key. here's the idea i had:
Code: Select all
if key == "up" then
if jumps == 1 then
objects.ball.body:applyImpulse(0, -50)
jumps = 2
elseif jumps == 2 then
jumps = 1
end
end
-Veethree