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.
28 lines
450 B
28 lines
450 B
package main
|
|
|
|
func main() {
|
|
DebugInit()
|
|
|
|
game := NewGame(27, 17)
|
|
game.InitScreen()
|
|
|
|
for {
|
|
game.NewMap()
|
|
dead_ends := game.NewMaze()
|
|
game.PlaceEnemies(dead_ends)
|
|
game.Render()
|
|
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
|