mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
examples/flappy: Bug fix: first touch ID might not be 0 on iPhone Safari (#576)
This commit is contained in:
parent
35557e845d
commit
f2e2f602c5
@ -182,9 +182,11 @@ func jump() bool {
|
||||
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
|
||||
return true
|
||||
}
|
||||
// TODO: Is it correct to use ID '0' here?
|
||||
if inpututil.IsJustTouched(0) {
|
||||
return true
|
||||
if len(ebiten.Touches()) > 0 {
|
||||
id := ebiten.Touches()[0].ID()
|
||||
if inpututil.IsJustTouched(id) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user