examples/vibrate: bug fix: touches didn't work correctly

This commit is contained in:
Hajime Hoshi 2022-04-12 00:05:55 +09:00
parent 88213f5dd8
commit 55447679ee

View File

@ -39,7 +39,7 @@ type Game struct {
func (g *Game) Update() error {
g.touchIDs = g.touchIDs[:0]
g.touchIDs = inpututil.AppendJustPressedTouchIDs(g.touchIDs)
g.touchIDs = inpututil.AppendJustPressedTouchIDs(g.touchIDs[:0])
if len(g.touchIDs) > 0 {
g.touchCounter++
op := &ebiten.VibrateOptions{