From 73bceedf56ec84683f3fd6c7bf7b7e4c3d0caa97 Mon Sep 17 00:00:00 2001 From: Luke Meyers Date: Fri, 7 Feb 2020 15:56:15 -0800 Subject: [PATCH] tweaks --- game/commands.go | 6 +----- game/physics.go | 1 + gfx/gfx.go | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/game/commands.go b/game/commands.go index e0318d0..55f0d68 100644 --- a/game/commands.go +++ b/game/commands.go @@ -1,9 +1,5 @@ package game -import ( - "math/rand" -) - type command int const ( @@ -15,7 +11,7 @@ const ( func doCommand(cmd command, s State, teamID int) State { da := 1 - da += rand.Intn(3) - 1 + //da += rand.Intn(3) - 1 b := activeBot(s.Teams[teamID]) if b == nil { diff --git a/game/physics.go b/game/physics.go index b775a9c..ade2d89 100644 --- a/game/physics.go +++ b/game/physics.go @@ -25,6 +25,7 @@ func moveBot(s State, teamID int, b Bot) State { for i := 0; i < b.v; i++ { if o := collide(b.Pos+1, b.Lane, s); o != nil { log.Printf("bot %d crashed into %#v!", b.ID, o) + break } else { b.Pos++ } diff --git a/gfx/gfx.go b/gfx/gfx.go index c9b537a..38a90ee 100644 --- a/gfx/gfx.go +++ b/gfx/gfx.go @@ -118,6 +118,6 @@ func teamColors(ts []game.Team) map[*game.Team]pixel.RGBA { } const ( - botWidth float64 = 20 + botWidth float64 = 17 batonWidth float64 = 12 )