Discretize movement.

This commit is contained in:
Luke Meyers 2020-02-05 08:43:02 -08:00
parent 015375bbc3
commit cad36f97a7
2 changed files with 6 additions and 4 deletions

View File

@ -85,7 +85,7 @@ func gameOver(s state) bool {
} }
const ( const (
steps = 500 steps = 40
numBots = 10 numBots = 10
numTeams = 4 numTeams = 4
) )

View File

@ -26,9 +26,11 @@ func run() {
start := time.Now() start := time.Now()
for !w.Closed() && !s.gameOver { for !w.Closed() && !s.gameOver {
w.Clear(colornames.Peru) if w.JustPressed(pixelgl.KeySpace) {
s = updateState(s) w.Clear(colornames.Peru)
render(s, w, time.Since(start), colors) s = updateState(s)
render(s, w, time.Since(start), colors)
}
w.Update() w.Update()
} }
} }