I have created a simple 2d scene in Love2D with a square that falls until it reaches a certain point and then stops. The problem is that the square stops at a slightly different point every time with no user input or modified code.
Here is my lua
function love.load()
playY = 0
playX = 10
grav = 200
speed = 100
end
function love.draw()
--floor
love.graphics.setColor(0,255,0,255)
love.graphics.rectangle("fill", 0,465,800,150)
--player
love.graphics.setColor(255,255,0,255)
love.graphics.rectangle("fill", playX,playY,10,10)
--debug
love.graphics.print(playY, 100, 5)
love.graphics.print(playX, 100, 15)
end
function love.update(dt)
if playY < 454 then
playY = playY + grav * dt
end
if playY == 456 then
if love.keybord.isDown("right") then
playX = playX + speed * dt
end
end
end
The variable playY shows the player height but it stops at different values every time.

Why is this?
love.keybord.isDown("right")seems to suggest otherwise.