Make number of rooms depend on the size the map.

master
Zed A. Shaw 6 days ago
parent 6d3d7b1c3f
commit b32c69cd7e
  1. 9
      main.go

@ -305,8 +305,12 @@ func (game *Game) AddRooms(dead_ends []Position, size int) {
func (game *Game) MakeMap() []Position {
game.ClearMap()
dead_ends := game.HuntAndKill()
game.Status("FIRST MAZE")
game.ClearMap()
game.AddRooms(dead_ends, 3)
game.AddRooms(dead_ends, game.height / 8)
game.Status("SECOND MAZE")
dead_ends = game.HuntAndKill()
game.Status("FINISHED")
@ -321,13 +325,12 @@ func (game *Game) PlaceEnemies(places []Position) {
}
}
// This program just prints "Hello, World!". Press ESC to exit.
func main() {
out, err := os.Create("debug.log")
if err != nil { log.Fatal(err) }
dbg = log.New(out, "", log.LstdFlags)
game := MakeGame(43, 27)
game := MakeGame(27, 17)
dead_ends := game.MakeMap()
game.PlaceEnemies(dead_ends)
game.Render()

Loading…
Cancel
Save