function explo(x)
if x*x <=30 then
return ((x*x)*1.1)/(x*1.01)
else
return x
end
end
function border(y)
if y <= 10 then
return 10
else
return y
end
end
function love.load()
_G.paddle1 = {
x = 20,y=200,speed
}
_G.paddle2 = {
x = 460,y=200,speed
}
end
function love.update(dt)
if love.keyboard.isDown("up") then
paddle2.y = paddle2.y - paddle2.speed
paddle2.speed = explo(paddle2.speed)
paddle2.y = border(y)
i created border function to check to make borders for the game but when i try to move the player "up" it says
main.lua:11: attempt to compare nil with number
Traceback
[love "callbacks.lua"]:228: in function 'handler'
main.lua:11: in function 'border'
main.lua:31: in function 'update'
[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'