summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-15 01:54:43 +0200
committerAki <nthirtyone@gmail.com>2016-08-15 01:54:43 +0200
commit39a93ec28fc375bbcec3599b9017bd26670faa85 (patch)
treea2adc9df9f3d4a994ec8523c697d0391fc7ec3a3
parentba2d5c2f30c5846220f1d1570d0d19dca0a61814 (diff)
downloadroflnauts-39a93ec28fc375bbcec3599b9017bd26670faa85.zip
roflnauts-39a93ec28fc375bbcec3599b9017bd26670faa85.tar.gz
roflnauts-39a93ec28fc375bbcec3599b9017bd26670faa85.tar.bz2
Seriously?
-rw-r--r--controller.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/controller.lua b/controller.lua
index 53b1db9..1ef3a1a 100644
--- a/controller.lua
+++ b/controller.lua
@@ -56,14 +56,14 @@ function Controller.testControl(set, key, joystick)
end
end
end
-
+--love.keyboard.isDown(set[action])
+--set.joystick:isGamepadDown(set[action])
-- Checks if given action of given set is down
function Controller.isDown(set, action)
- if set == nil then return end
- if set.joystick == nil then
- return love.keyboard.isDown(set[action])
- else
- return set.joystick:isGamepadDown(set[action])
+ if set ~= nil then
+ if set.joystick == nil then
+ return love.keyboard.isDown(set[action])
+ end
end
end