Add quit command.

This commit is contained in:
Luke Meyers 2020-02-05 08:54:47 -08:00
parent cad36f97a7
commit 4ee2ed3222
1 changed files with 6 additions and 3 deletions

View File

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