examples/gamepad: bug fix: correct iteration start button in gamepad example (#2730)

Start iterating at zero instead of gamepad id (which is usually 0).
This commit is contained in:
David Poirier 2023-08-24 17:27:35 +10:00 committed by GitHub
parent a9b2f5f9ca
commit 7fe89b173b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)))
}