love.keyboard.isDown() Function
Posted: Thu Jan 03, 2013 8:16 am
Why does all the controls work except the "down"? It fezze and skips.
Code: Select all
function love.load()
char1 = love.graphics.newImage("images/alpha.png")
char1x = 0
char1y = 0
end
function love.update()
if love.keyboard.isDown("right") then
char1x = char1x + 1
elseif love.keyboard.isDown("left") then
char1x = char1x - 1
elseif love.keyboard.isDown("up") then
char1y = char1y - 1
elseif love.keyboard.isDown("down") then
char1y = char1x + 1
end
end
function love.draw()
love.graphics.draw(char1, char1x, char1y)
end