From 7fe89b173b4cc43ba354f91eda5f8193c32b4fd8 Mon Sep 17 00:00:00 2001 From: David Poirier <1152277+david-poirier@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:27:35 +1000 Subject: [PATCH] examples/gamepad: bug fix: correct iteration start button in gamepad example (#2730) Start iterating at zero instead of gamepad id (which is usually 0). --- examples/gamepad/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gamepad/main.go b/examples/gamepad/main.go index e6af23351..fbf321e5c 100644 --- a/examples/gamepad/main.go +++ b/examples/gamepad/main.go @@ -67,7 +67,7 @@ func (g *Game) Update() error { } maxButton := ebiten.GamepadButton(ebiten.GamepadButtonCount(id)) - for b := ebiten.GamepadButton(id); b < maxButton; b++ { + for b := ebiten.GamepadButton(0); b < maxButton; b++ { if ebiten.IsGamepadButtonPressed(id, b) { g.pressedButtons[id] = append(g.pressedButtons[id], strconv.Itoa(int(b))) }