tweaks
This commit is contained in:
parent
10ffba1cdf
commit
73bceedf56
|
@ -1,9 +1,5 @@
|
||||||
package game
|
package game
|
||||||
|
|
||||||
import (
|
|
||||||
"math/rand"
|
|
||||||
)
|
|
||||||
|
|
||||||
type command int
|
type command int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -15,7 +11,7 @@ const (
|
||||||
|
|
||||||
func doCommand(cmd command, s State, teamID int) State {
|
func doCommand(cmd command, s State, teamID int) State {
|
||||||
da := 1
|
da := 1
|
||||||
da += rand.Intn(3) - 1
|
//da += rand.Intn(3) - 1
|
||||||
|
|
||||||
b := activeBot(s.Teams[teamID])
|
b := activeBot(s.Teams[teamID])
|
||||||
if b == nil {
|
if b == nil {
|
||||||
|
|
|
@ -25,6 +25,7 @@ func moveBot(s State, teamID int, b Bot) State {
|
||||||
for i := 0; i < b.v; i++ {
|
for i := 0; i < b.v; i++ {
|
||||||
if o := collide(b.Pos+1, b.Lane, s); o != nil {
|
if o := collide(b.Pos+1, b.Lane, s); o != nil {
|
||||||
log.Printf("bot %d crashed into %#v!", b.ID, o)
|
log.Printf("bot %d crashed into %#v!", b.ID, o)
|
||||||
|
break
|
||||||
} else {
|
} else {
|
||||||
b.Pos++
|
b.Pos++
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,6 @@ func teamColors(ts []game.Team) map[*game.Team]pixel.RGBA {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
botWidth float64 = 20
|
botWidth float64 = 17
|
||||||
batonWidth float64 = 12
|
batonWidth float64 = 12
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue