I' m on the " physics way" in love.
I want make a Body , Can jump and move ....
But in my code , if i jump my body dont conserve right or left move !
I had search in the LovelBigPlantet code but i m dont understand all
i read this : --get the velocity, process the input, and set it, preserves untouched velocity..
i try make but dont work
my code :
function update(dt)
local x,y=Circle:getVelocity()
Circle:setSleep( false )
if love.keyboard.isDown(love.key_right) then
x= 500
end
if love.keyboard.isDown(love.key_left) then
x= -500
end
if love.keyboard.isDown(love.key_space) then
y= -500
end
Circle:setVelocity(x,y)
World:update(dt)
end
Do you mean that you can turn around in mid-air?
Cause, if that's the problem, you would have to put in a check for whether you're in the air too before setting the x velocity.
Take off every Zigg for great rapist.
Now, outgay that!
My guess is, that, if you're making a platformer-type game and using the physics module that you found your guy sliding around on the floor like he was in a Super Mario Bros. 2 ice level; and perhaps you wrote some code to kill the X velocity when left and right where not being pressed... I'm guessing this because i've just started with Love and not 20 minuets ago did exactly the same thing
If this is the case, perhaps, check that the player sprite is not colliding with the floor (i.e is in the air) before killing your x velocity.