#72374
Nacc
Participant

Voici mon code :

square={}
square.x = 0
square.y = 0
square.width = 20
square.height=20
square.speedX = 2
square.speedY = 2

function love.load()
end

function love.update(dt)
if square.x + square.width <= love.graphics.getWidth() then
square.x = square.x + square.speedX
elseif square.x + square.width > 0 then
square.x = square.x – square.speedX
end
end