A Go version of the https://lcthw.dev/learn-code-the-hard-way/curseyou-python-rogue that makes a tiny Rogue in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
723 B

--- 02_mazes_and_enemies/debug.go 2025-10-06 01:05:42.441647100 -0400
+++ 03_pathing_enemies/debug.go 2025-10-05 23:47:48.686143800 -0400
@@ -4,4 +4,6 @@
"log"
"os"
+ "fmt"
+ "github.com/gdamore/tcell/v2"
)
@@ -13,2 +15,19 @@
dbg = log.New(out, "", log.LstdFlags)
}
+
+func (game *Game) DrawPaths() {
+ for y, row := range game.Paths {
+ for x, path_num := range row {
+ if path_num == PATH_LIMIT { continue }
+
+ as_str := fmt.Sprintf("%x", path_num % 16)
+ style := tcell.StyleDefault.Foreground(tcell.ColorGray)
+
+ if path_num >= 0 && path_num <= 16 {
+ style = style.Reverse(true)
+ }
+
+ game.Screen.SetContent(x, y, rune(as_str[0]), nil, style)
+ }
+ }
+}