How do i make a repeat look in LOVE2D so i can make a character moves?
I've tried
function love.keypressed(key)
if key=='left' then
repeat
imgx=imgx+1
timer.after(1,function() end)
until not love.keyboard.isDown('left')
end
end
but it didn't worked.Please help me!
It sounds like you're trying to move an image when a key is held down. Using a 3rd party library timer is overly complicated for this.
You want to associate some X and Y variables with the image and draw the image using those variables. You can change them by using the love.keypressed callback or by checking for key presses in love.update if you want continuous movement.
Example: