Skip to content

Commit

Permalink
examples/gamepad: Bug fix: Misuse of indices and gamepad IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Oct 7, 2020
1 parent 176e383 commit 57eab0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/gamepad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
ids = append(ids, id)
}
sort.Ints(ids)
for id := range ids {
for _, id := range ids {
str += fmt.Sprintf("Gamepad (ID: %d, SDL ID: %s):\n", id, ebiten.GamepadSDLID(id))
str += fmt.Sprintf(" Axes: %s\n", strings.Join(g.axes[id], ", "))
str += fmt.Sprintf(" Buttons: %s\n", strings.Join(g.pressedButtons[id], ", "))
Expand Down

0 comments on commit 57eab0f

Please sign in to comment.