touch-ups
This commit is contained in:
parent
84aa1f8cbe
commit
ed6718bd0b
|
@ -4,7 +4,7 @@ func chooseCommand(s State, teamID int) command {
|
|||
t := s.Teams[teamID]
|
||||
h := t.BatonHolder()
|
||||
if collide(h.Pos+1, h.Lane, s) {
|
||||
if h.Lane <= t.Lane {
|
||||
if h.Lane <= t.Lane && h.Lane < NumLanes-1 {
|
||||
return left
|
||||
}
|
||||
return right
|
||||
|
|
|
@ -188,7 +188,7 @@ const (
|
|||
Steps = 60
|
||||
numBots = 5
|
||||
NumTeams = 4
|
||||
NumLanes = 6
|
||||
NumLanes = 4
|
||||
maxA = 2
|
||||
maxV = 8
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ func Render(rs RenderState, sOld, sNew game.State, w *pixelgl.Window, d time.Dur
|
|||
renderObstacles(sNew, w)
|
||||
|
||||
rs.Frame++
|
||||
if rs.Frame >= rs.Frames {
|
||||
if rs.Frame > rs.Frames {
|
||||
rs.Animating = false
|
||||
}
|
||||
return rs
|
||||
|
@ -40,8 +40,6 @@ func renderBots(sOld, sNew game.State, tween float64, w *pixelgl.Window, _ time.
|
|||
for i, t := range sNew.Teams {
|
||||
for j, bot := range t.Bots {
|
||||
c := colors[&sNew.Teams[i]]
|
||||
c.R += 0.2 * float64(j)
|
||||
c.G -= 0.1 * float64(j)
|
||||
im.Color = c
|
||||
|
||||
oldBot := sOld.Teams[i].Bots[j]
|
||||
|
@ -113,7 +111,7 @@ func teamColors(ts []game.Team) map[*game.Team]pixel.RGBA {
|
|||
case 2:
|
||||
c = colornames.Lavender
|
||||
case 3:
|
||||
c = colornames.Indigo
|
||||
c = colornames.Maroon
|
||||
}
|
||||
m[&ts[i]] = pixel.ToRGBA(c)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue