I use love2d version 0.10.1 and Lua version 5.2. I downloaded them some time ago, but started learning yesterday. But no more procrastination! With your help I'll become a game developer and I'll release a game before my death (did I mention I'm quite old?).
I've written some simple code and it doesn't work as I expected:
Code: Select all
local x, y, side
function love.load()
x = love.graphics.getWidth() / 2 - 10
y = love.graphics.getHeight() /2 - 10
side = 20
end
function love.update(dt)
if love.keyboard.isDown('up') then
y = y - 20 * dt
end
if love.keyboard.isDown('down') then
y = y + 20 * dt
end
if love.keyboard.isDown('left') then
x = x - 20 * dt
end
if love.keyboard.isDown('right') then
x = x + 20 * dt
end
if love.keyboard.isDown('space') then
side = side + 50 * dt
end
end
function love.draw()
love.graphics.rectangle('fill', x, y, side, side)
end
Any idea what's wrong? I'm not very bright, so I can't figure it out by myself. Help the old man, please.
EDIT: it's a ghosting issue (thing I have never heard of before). CHEERS for the answer!