Why my code doesn't work ?
Posted: Sun Apr 27, 2014 3:57 pm
http://pastebin.com/vuDRxJXB
(I'm begginer on LÖVE)
(I'm begginer on LÖVE)
Code: Select all
function love.load()
p = {}
p.x = 300
p.y = 400
love.graphics.setBackgroundColor(182, 100, 0)
love.graphics.setColor(0, 0, 225)
end
function love.draw()
love.graphics.rectangle("fill", p.x, p.y, 100, 100)
end
function love.update(dt)
if love.keyboard.isDown('d') then
p.x = p.x + 1 * dt
elseif love.keyboard.isDown('a') then
p.x = p.x - 1 * dt
end
end
Code: Select all
p.x = p.x - 1 * dt