keyboard.isDown multi key check not working?
Posted: Fri Sep 16, 2011 2:12 am
I'm new to the LOVE engine and only lightly experienced in LUA, but I have a small little problem I would like to get the some help with, preferebly with reasoning so I can learn and improve.
Basically, I want to check if none of the game's control keys are held down.
According to this page, this command should return true or false, but it returns nil and causes
the game to crash before starting.
My error states that on that line: bad argument #1 to 'isDown' (string expected, got nil)
This all takes place within love.update.
Is there something little I am missing?
Is that function broken/bugged?
Am I being stupid with a much better method in doing this?
Basically, I want to check if none of the game's control keys are held down.
Code: Select all
--slow down if no keys down
anyDown = love.keyboard.isDown( right, left, up, down )
if anyDown == false then
yspeed = 0
end
the game to crash before starting.
My error states that on that line: bad argument #1 to 'isDown' (string expected, got nil)
This all takes place within love.update.
Is there something little I am missing?
Is that function broken/bugged?
Am I being stupid with a much better method in doing this?