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.
 
 
 

13 lines
382 B

--- 02_mazes_and_enemies/movement.go 2025-10-06 10:48:12.166620400 -0400
+++ 03_pathing_enemies/movement.go 2025-10-06 12:00:47.091211600 -0400
@@ -11,2 +11,10 @@
}
}
+
+func (game *Game) MoveEnemy(from Position, to Position) {
+ enemy, ok := game.Enemies[from]
+ if !ok { dbg.Fatal("no enemy at", from, "wtf") }
+
+ delete(game.Enemies, from)
+ game.Enemies[to] = enemy
+}