From cad36f97a7515a9cf70fb11b2b8533647537f1ab Mon Sep 17 00:00:00 2001 From: Luke Meyers Date: Wed, 5 Feb 2020 08:43:02 -0800 Subject: [PATCH] Discretize movement. --- game.go | 2 +- main.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/game.go b/game.go index 46eaf7e..564475f 100644 --- a/game.go +++ b/game.go @@ -85,7 +85,7 @@ func gameOver(s state) bool { } const ( - steps = 500 + steps = 40 numBots = 10 numTeams = 4 ) diff --git a/main.go b/main.go index 2a7a671..4fc1ec4 100644 --- a/main.go +++ b/main.go @@ -26,9 +26,11 @@ func run() { start := time.Now() for !w.Closed() && !s.gameOver { - w.Clear(colornames.Peru) - s = updateState(s) - render(s, w, time.Since(start), colors) + if w.JustPressed(pixelgl.KeySpace) { + w.Clear(colornames.Peru) + s = updateState(s) + render(s, w, time.Since(start), colors) + } w.Update() } }