diff --git a/examples/2048/2048/board.go b/examples/2048/2048/board.go index 395fc48dc..290965bbf 100644 --- a/examples/2048/2048/board.go +++ b/examples/2048/2048/board.go @@ -53,8 +53,7 @@ func (b *Board) Update(input *Input) error { } if 0 < len(b.tasks) { t := b.tasks[0] - err := t() - if err == taskTerminated { + if err := t(); err == taskTerminated { b.tasks = b.tasks[1:] } else if err != nil { return err @@ -103,7 +102,7 @@ func (b *Board) Move(dir Dir) error { }) b.tasks = append(b.tasks, func() error { for t := range b.tiles { - if t.isPopping() { + if t.isAnimating() { return nil } } diff --git a/examples/2048/2048/tile.go b/examples/2048/2048/tile.go index de86327d6..fcab366c0 100644 --- a/examples/2048/2048/tile.go +++ b/examples/2048/2048/tile.go @@ -70,8 +70,8 @@ func (t *Tile) IsMoving() bool { return 0 < t.movingCount } -func (t *Tile) isPopping() bool { - return 0 < t.poppingCount +func (t *Tile) isAnimating() bool { + return 0 < t.movingCount || 0 < t.startPoppingCount || 0 < t.poppingCount } func tileAt(tiles map[*Tile]struct{}, x, y int) *Tile {