function love.update(dt)
if not joystick then return end
if joystick:isGamepadDown("dpleft") then
position.x = position.x - speed * dt
elseif joystick:isGamepadDown("dpright") then
position.x = position.x + speed * dt
end
if joystick:isGamepadDown("dpup") then
position.y = position.y - speed * dt
elseif joystick:isGamepadDown("dpdown") then
position.y = position.y + speed * dt
end
end
"640K ought to be enough for anybody."
- Bill Gates
So I'm guessing just "a" "b" "x" "y" in the isGamepadDown method. Although I've never used the joystick module, neither do I have the means to test them. But take a look at that example there. (Although don't ask me why at the top of the example it says "Use getPosition to help draw a custom mouse image" )
Check with this guy
|
|
|
|
|
V
Last edited by Zilarrezko on Wed Oct 01, 2014 7:32 pm, edited 1 time in total.
schmavies wrote:Does anyone know the syntax for the x,y,a,b buttons, the thumb sticks, the shoulder buttons, and the start and back buttons?
The gamepad button names are listed here: [wiki]GamepadButton[/wiki] (which is linked from [wiki]love.gamepadpressed[/wiki] and [wiki]Joystick:isGamepadDown[/wiki]), and the gamepad axis names are listed here: [wiki]GamepadAxis[/wiki] (linked from [wiki]Joystick:getGamepadAxis[/wiki].)