You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understand, LOVE games will freeze on Windows if you drag/move the game window. Once the user stops dragging the window, the game resumes. None of this is a problem. However, an issue occurs if the user is holding down a keyboard key, starts dragging the window, and then releases the key while dragging the window. When the game resumes after freezing, it incorrectly believes the key is still held down once the game resumes. This leads to my character continuing to run in a direction, and the only way to stop it is to press and release the key that's stuck. Not a big problem, but it is something I encounter a lot when playing my own game. Here's a short main.lua that I was using to demonstrate - the love.keyboard.isDown calls are true after releasing while dragging.
function love.load()
player = {}
player.x = 400
player.y = 200
player.speed = 2
message = ""
end
function love.update(dt)
message = ""
if love.keyboard.isDown("right") then
message = message .. "Right "
player.x = player.x + player.speed
end
if love.keyboard.isDown("left") then
message = message .. "Left "
player.x = player.x - player.speed
end
if love.keyboard.isDown("down") then
message = message .. "Down "
player.y = player.y + player.speed
end
if love.keyboard.isDown("up") then
message = message .. "Up "
player.y = player.y - player.speed
end
end
function love.draw()
love.graphics.circle("fill", player.x, player.y, 40)
love.graphics.print(message, 0, 0)
end
The text was updated successfully, but these errors were encountered:
From what I understand, LOVE games will freeze on Windows if you drag/move the game window. Once the user stops dragging the window, the game resumes. None of this is a problem. However, an issue occurs if the user is holding down a keyboard key, starts dragging the window, and then releases the key while dragging the window. When the game resumes after freezing, it incorrectly believes the key is still held down once the game resumes. This leads to my character continuing to run in a direction, and the only way to stop it is to press and release the key that's stuck. Not a big problem, but it is something I encounter a lot when playing my own game. Here's a short main.lua that I was using to demonstrate - the love.keyboard.isDown calls are true after releasing while dragging.
The text was updated successfully, but these errors were encountered: