redone controls
you can have any ammount of keys assigned to an acction, only mouse and keyboard supported for now
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
keybind = {}
|
||||
|
||||
keybind.moveLeft = "left"
|
||||
keybind.moveRight = "right"
|
||||
keybind.moveUp = "up"
|
||||
keybind.moveDown = "down"
|
||||
keybind.moveJump = "z"
|
||||
keybind.moveAttack = "x"
|
||||
keybind.moveDash = "c"
|
||||
function keybind:Check(key)
|
||||
for _, keyname in pairs(key) do
|
||||
if type(keyname) == "string" then
|
||||
if love.keyboard.isDown(keyname) then return true end
|
||||
else
|
||||
if love.mouse.isDown(keyname) then return true end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
keybind.moveLeft = {"left", "a"}
|
||||
keybind.moveRight = {"right", "d"}
|
||||
keybind.moveUp = {"up", "w"}
|
||||
keybind.moveDown = {"down", "s"}
|
||||
keybind.moveJump = {"z", "space"}
|
||||
keybind.moveAttack = {"x", 1}
|
||||
keybind.moveDash = {"c", 2}
|
||||
|
||||
Reference in New Issue
Block a user