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.
36 lines
746 B
36 lines
746 B
1 day ago
|
--- 03_pathing_enemies/main.go 2025-10-06 11:53:48.238068700 -0400
|
||
|
+++ 04_combat/main.go 2025-10-06 11:53:46.781950000 -0400
|
||
|
@@ -7,15 +7,22 @@
|
||
|
game.InitScreen()
|
||
|
|
||
|
- game.NewMap()
|
||
|
- dead_ends := game.NewMaze()
|
||
|
- game.PlaceEnemies(dead_ends)
|
||
|
- game.Render()
|
||
|
-
|
||
|
- for game.HandleEvents() {
|
||
|
- game.CalculatePaths()
|
||
|
- game.EnemyPathing()
|
||
|
+ for {
|
||
|
+ game.NewMap()
|
||
|
+ dead_ends := game.NewMaze()
|
||
|
+ game.PlaceEnemies(dead_ends)
|
||
|
game.Render()
|
||
|
- }
|
||
|
|
||
|
- game.Exit()
|
||
|
+ for game.HandleEvents() && game.Player.HP > 0 {
|
||
|
+ game.EnemyDeath()
|
||
|
+ game.CalculatePaths()
|
||
|
+ game.EnemyPathing()
|
||
|
+ game.Render()
|
||
|
+ }
|
||
|
+
|
||
|
+ if game.Player.HP <= 0 {
|
||
|
+ game.Restart()
|
||
|
+ } else {
|
||
|
+ game.Exit()
|
||
|
+ }
|
||
|
+ }
|
||
|
}
|