mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08: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,10 +182,12 @@ func jump() bool {
|
|||||||
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
|
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// TODO: Is it correct to use ID '0' here?
|
if len(ebiten.Touches()) > 0 {
|
||||||
if inpututil.IsJustTouched(0) {
|
id := ebiten.Touches()[0].ID()
|
||||||
|
if inpututil.IsJustTouched(id) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user