Reputation: 1
heyo!
I'm trying to get input from my keyboard in LOVE2D but no input is being registered. getting no errors.
here's the code:
ESCdown=love.keyboard.isDown('escape')
function love.update()
if ESCdown then
love.event.quit()
end
end
Upvotes: 0
Views: 504
Reputation: 28954
love.update
is called every frame.
ESCdown
is assigned a value once and then never changes.
Consider using keyboard events:
https://love2d.org/wiki/love.keypressed
It even gives an example for what you want to do:
function love.keypressed(key, scancode, isrepeat)
if key == "escape" then
love.event.quit()
end
end
Upvotes: 1