Basically I have up to 9 players all with individual keysets:
Code: Select all
player = {
{str = 1,
vel = 0,
spd = 100,
kck = 0,
bmb = 1,
control = {
"w", -- Up
"s", -- Down
"a", -- Left
"d", -- Right
"lctrl", -- Lay
"e", -- Use
},
graphics = 1,
anim = 1,
animTime = 0,
x = 0,
y = 0,
w = 63,
h = 63,
direction = 1,
},
{str = 1,
vel = 0,
spd = 100,
kck = 0,
bmb = 1,
control = {
"up", -- Up
"down", -- Down
"left", -- Left
"right", -- Right
"rctrl", -- Lay
"lshift", -- Use
},
graphics = 1,
anim = 1,
animTime = 0,
x = 0,
y = 0,
w = 63,
h = 63,
direction = 1,
},
}
I uploaded my main.lua, it's very short and don't mind that I passed all players into love.keypressed, I was attempting to pass their keysets into the function to not have to write for example the bomb laying function for every key related to bomb-laying.