diff --git a/game.go b/game.go index bd2bbb6..b57d515 100644 --- a/game.go +++ b/game.go @@ -87,7 +87,7 @@ func (game *Game) gameDirector() { game.drawScore() game.drawPlayer() //game.drawCoords() - //game.drawDebug() + game.drawDebug() // Draw robots?? if len(game.robots) == 0 { @@ -169,21 +169,27 @@ func quit(game *Game) { } func (game *Game) randPos() Position { - var safe bool = false + //var safe bool = false var pos Position - for !safe { - x := rand.Intn(80) - y := rand.Intn(24) + // for !safe { + // x := rand.Intn(80) + // y := rand.Intn(24) - if x == 0 || x == 79 || y == 0 || y == 23 { - safe = false - } else { - pos.x = x - pos.y = y - safe = true - } - } + // if x == 0 || x == 79 || y == 0 || y == 23 { + // safe = false + // } else { + // pos.x = x + // pos.y = y + // safe = true + // } + // } + + x := 1 + rand.Intn(77) + y := 1 + rand.Intn(22) + + pos.x = x + pos.y = y return pos } diff --git a/render.go b/render.go index 4155e68..98db0c9 100644 --- a/render.go +++ b/render.go @@ -52,7 +52,7 @@ func (game *Game) drawCoords() { func (game *Game) drawDebug() { var x, y int = 40, 24 - for _, r := range []rune("[ NumGoRoutine: " + strconv.FormatInt(int64(runtime.NumGoroutine()), 10) + " ]") { + for _, r := range []rune("[ NumGoRoutine: " + strconv.FormatInt(int64(runtime.NumGoroutine()), 10) + " Bots: " + strconv.FormatInt(int64(len(game.robots)), 10) + " ]") { game.screen.SetContent(x, y-1, r, nil, game.style) x++ }