variables updated but not in love.graphics.rectangle
Posted: Fri Aug 05, 2022 8:37 am
I would like to stop the progression of the rectangle when it approach the border. My var have a good value but not the rectangle in the screen
Code: Select all
function love.load()
x, y, w, h = 20, 20, 60, 20
width, height = love.window.getMode( )
end
function love.update(dt)
if w < width-x then
w = w + 1
end
if h < height-y then
h = h + 1
end
end
function love.draw()
love.graphics.setColor(0, 0.4, 0.4)
love.graphics.rectangle("fill", x, y, w, h)
print(w,h)
end