Sprout basic command infrastructure
This commit is contained in:
parent
c8c9451e51
commit
894c487390
14
game/game.go
14
game/game.go
|
@ -70,7 +70,11 @@ func UpdateState(sOld State) State {
|
|||
s := sOld
|
||||
|
||||
for i, t := range s.Teams {
|
||||
switch chooseCommand(t, sOld) {
|
||||
case speedUp:
|
||||
accelerate(t.Baton.Holder)
|
||||
}
|
||||
|
||||
moveBot(t.Baton.Holder, sOld)
|
||||
maybePassBaton(&s.Teams[i])
|
||||
}
|
||||
|
@ -84,6 +88,16 @@ func UpdateState(sOld State) State {
|
|||
return s
|
||||
}
|
||||
|
||||
func chooseCommand(t Team, s State) command {
|
||||
return speedUp
|
||||
}
|
||||
|
||||
type command int
|
||||
|
||||
const (
|
||||
speedUp command = iota
|
||||
)
|
||||
|
||||
func maybePassBaton(t *Team) {
|
||||
for i, b := range t.Bots {
|
||||
h := t.Baton.Holder
|
||||
|
|
Loading…
Reference in New Issue