Mothback/data/scripts/keybind.lua

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}