So basically the image moves left or right when the left or right side of the screen is clicked, but only while the mouse is down.
What I have right now is this:
Code: Select all
function love.mousepressed(x, y, button, istouch)
while love.mouse.isDown(1)==true do
if button == 1 then -- Versions prior to 0.10.0 use the MouseConstant 'l'
if x < 598 then
velocity = -2
elseif x > 598 then
velocity = 2
else
repeat
velocity = velocity - 1
until velocity <= 0
velocity = 0
end
end
end
end
Right now it won't do anything if you click anywhere in the window, not sure what I need to do to fix this.