Joystick can be used in both X and Y
This commit is contained in:
parent
4eb0612c25
commit
3d2ddcbd62
2 changed files with 2 additions and 3 deletions
|
@ -464,9 +464,8 @@ Plane = Class{
|
|||
self.turningCcw = isTurning
|
||||
end;
|
||||
|
||||
analog = function(self, controlX, controlY, throttleX, throttleY, fire, brake)
|
||||
analog = function(self, controlY, throttleX, throttleY, fire, brake)
|
||||
if self.health > 0 then
|
||||
self.controlX = controlX
|
||||
self.controlY = controlY
|
||||
self.throttleX = throttleX
|
||||
self.throttleY = -throttleY
|
||||
|
|
|
@ -116,7 +116,7 @@ function level_state:update(dt)
|
|||
local x1, y1, x2, y2 = j:getAxes()
|
||||
if #buttons >= 8 and y2 ~= nil then
|
||||
-- button mapping suitable for XBox original controller
|
||||
players[player]:joystick(x2, y2, x1, y1, buttons[8], buttons[7])
|
||||
players[player]:joystick(y2 - x2, x1, y1, buttons[8], buttons[7])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue