diff --git a/game/commands.go b/game/commands.go index 6ff591f..e8b942a 100644 --- a/game/commands.go +++ b/game/commands.go @@ -35,7 +35,7 @@ func CommandLoop(w *pixelgl.Window, s State, stateCA chan<- State) { for i, cmd := range <-cmdC { s = doCommand(cmd, s, i) } - s = UpdateState(s, sOld) + s = checkWin(s, sOld) turn++ if s.GameOver { s = NewState() diff --git a/game/game.go b/game/game.go index 0a8edac..837e794 100644 --- a/game/game.go +++ b/game/game.go @@ -42,7 +42,7 @@ type Baton struct { HolderID int } -func UpdateState(s State, sOld State) State { +func checkWin(s State, sOld State) State { var winners []int for _, t := range s.Teams { if r := ActiveRacer(t); r != nil {