Discretize movement.
This commit is contained in:
parent
015375bbc3
commit
cad36f97a7
2
game.go
2
game.go
|
@ -85,7 +85,7 @@ func gameOver(s state) bool {
|
|||
}
|
||||
|
||||
const (
|
||||
steps = 500
|
||||
steps = 40
|
||||
numBots = 10
|
||||
numTeams = 4
|
||||
)
|
||||
|
|
8
main.go
8
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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue