|
|
@@ -1,7 +1,6 @@
|
|
|
package robots
|
|
|
|
|
|
import (
|
|
|
- "runtime"
|
|
|
"strconv"
|
|
|
)
|
|
|
|
|
|
@@ -42,26 +41,28 @@ func (game *Game) drawBox() {
|
|
|
}
|
|
|
|
|
|
// drawCoords Print the coordinates of the player
|
|
|
-func (game *Game) drawCoords() {
|
|
|
- var x, y int = 25, 24
|
|
|
- for _, r := range []rune("[ x:" + strconv.FormatInt(int64(game.player.position.x), 10) + " y:" + strconv.FormatInt(int64(game.player.position.y), 10) + " ]") {
|
|
|
- game.screen.SetContent(x, y-1, r, nil, game.style)
|
|
|
- x++
|
|
|
- }
|
|
|
-}
|
|
|
+// func (game *Game) drawCoords() {
|
|
|
+// var x, y int = 25, 24
|
|
|
+// for _, r := range []rune("[ x:" + strconv.FormatInt(int64(game.player.position.x), 10) + " y:" + strconv.FormatInt(int64(game.player.position.y), 10) + " ]") {
|
|
|
+// game.screen.SetContent(x, y-1, r, nil, game.style)
|
|
|
+// x++
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
-func (game *Game) drawDebug() {
|
|
|
- var x, y int = 40, 24
|
|
|
- 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++
|
|
|
- }
|
|
|
-}
|
|
|
+// func (game *Game) drawDebug() {
|
|
|
+// var x, y int = 40, 24
|
|
|
+// 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++
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
func (game *Game) drawScore() {
|
|
|
var x, y int = 5, 24
|
|
|
- for _, r := range []rune("[ Score: " + strconv.FormatInt(int64(game.player.score), 10) + " Level: " + strconv.FormatInt(int64(game.level), 10) + " ]") {
|
|
|
- game.screen.SetContent(x, y-1, r, nil, game.style)
|
|
|
+ content := "[ Score: " + strconv.FormatInt(int64(game.player.score), 10) + " Level: " + strconv.FormatInt(int64(game.level), 10) + " ]"
|
|
|
+
|
|
|
+ for i := 0; i < len(content); i++ {
|
|
|
+ game.screen.SetContent(x, y-1, rune(content[i]), nil, game.style)
|
|
|
x++
|
|
|
}
|
|
|
}
|