function love.draw()
local x = 10
local y = 10
love.graphics.point(x, y) -- This point is drawn at 10, 10
love.graphics.translate(20, 20)
love.graphics.point(x, y) -- This point is drawn at 30, 30 thanks to translation. We didn't change the x, y variables.
end
local ty = 0
function love.draw()
love.graphics.translate(0,ty)
... other draw stuff ...
end
function love.update(dt)
if love.keyboard.isDown('up') then
ty = ty + 0.2 -- this is framerate dependent! use ty = ty + 10 * dt to make it move 10 pixels per second
end
... other update stuff ...
end
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.