Mothback/data/scripts/keybind.lua
bizcochito 58b4e16251 redone controls
you can have any ammount of keys assigned to an acction, only mouse and 
keyboard supported for now
2022-01-18 16:49:49 +01:00

22 lines
497 B
Lua

keybind = {}
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}