-- A simple enlarging rectangle that stays in the middle of the screen -- Made with the LOVE 2D framework in Lua data = { x = 300, y = 250, width = 200, height = 100, speed = 50 } function love.draw() love.graphics.rectangle("line", data.x, data.y, data.width, data.height) end function love.update(dt) if data.width > data.height then data.x = data.x - ((data.speed / 2) * dt) data.width = data.width + (data.speed * dt) data.y = data.y - ((data.speed / 2) * dt) data.height = data.height + (data.speed * dt) else data.x = data.x - ((data.speed / 2) * dt) data.width = data.width + (data.speed * dt) data.y = data.y - ((data.speed / 2) * dt) data.height = data.height + (data.speed * dt) end if love.keyboard.isDown("up") then data.speed = data.speed * 1.1 elseif love.keyboard.isDown("down") then data.speed = data.speed / 1.1 end end