Re: PS3 Controller joysticks sticks
Posted: Sun May 13, 2012 7:04 pm
I think I might be too new to lua and love to understand it correctly, but I'll give it a shot
correct me here if i'm not right:
you made a table called state.
you then assigned that to j
where you assign the values such as .getNumAxes
what I don't get is what this does:
I'm not getting how that gives you each axis.
and most importantly I still don't get how I would refer to each axis if I wanted to use it in joystick.isDown.
Sorry dude I understand this must be very annoying to watch from your perspective, but keep in mind due to my noobness I've clearly got hung up on some ideas that are probably wrong for using the joysticks. Once I see it you way it'll all click I'm sure.
Thanks for you continued input It's helping a lot (second day using love / lua and doing any serious scripting)
Code: Select all
local j = state[joy]
if not j then
state[joy] = {}
j = state[joy]
j.name = love.joystick.getName(joy)
j.axes = {}
j.numAxes = love.joystick.getNumAxes(joy)
for axis = 1, j.numAxes do
j.axes[axis] = 0
end
you made a table called state.
you then assigned that to j
where you assign the values such as .getNumAxes
what I don't get is what this does:
Code: Select all
for axis = 1, j.numAxes do
j.axes[axis] = 0
and most importantly I still don't get how I would refer to each axis if I wanted to use it in joystick.isDown.
Sorry dude I understand this must be very annoying to watch from your perspective, but keep in mind due to my noobness I've clearly got hung up on some ideas that are probably wrong for using the joysticks. Once I see it you way it'll all click I'm sure.
Thanks for you continued input It's helping a lot (second day using love / lua and doing any serious scripting)