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 :
Code: Select all
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