Skip to content

Commit

Permalink
don't attack while gameover
Browse files Browse the repository at this point in the history
  • Loading branch information
pankona committed Jun 25, 2024
1 parent 5c51286 commit 2a724c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wavectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func (w *waveController) Update() {
w.game.clickHandler.Add(gover)
w.game.drawHandler.Add(gover)

// 建物の Update() が呼ばれないようにする
// ゲームオーバー画面で攻撃を続けないようにするため
for _, b := range w.game.buildings {
w.game.updateHandler.Remove(b)
}

// ウェーブ終了みたいなものなので自分を削除する
w.game.updateHandler.Remove(w)
} else if len(w.game.enemies) == 0 {
Expand Down

0 comments on commit 2a724c7

Please sign in to comment.