context is great again, fixes to connectors

This commit is contained in:
2019-11-14 22:42:03 +03:00
parent 6a37870bd2
commit 98aa197578
5 changed files with 33 additions and 17 deletions

View File

@ -5,13 +5,12 @@ import (
"lab.zaar.be/thefish/alchemyst-go/engine/gamemap"
"lab.zaar.be/thefish/alchemyst-go/engine/types"
"lab.zaar.be/thefish/alchemyst-go/util"
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
)
//fixme move to config
var minRoomSize = 5
var maxRoomSize = 15
var maxrooms = 200
var minRoomSize = 8
var maxRoomSize = 22
var maxrooms = 100
var fges = map[int]types.RectFill{
1: types.RectFill{

View File

@ -91,10 +91,10 @@ func NewRandomRectRoom(rng *util.RNG, w, h int, fillage types.RectFill) Room {
//add connectors
newRoom.Connectors = append(
newRoom.Connectors,
types.Coords{rng.Range(1, w - 2), 0},
types.Coords{rng.Range(1, w - 2), h -1},
types.Coords{0, rng.Range(1, h - 1)},
types.Coords{w - 1, rng.Range(1, h - 1)},
types.Coords{rng.Range(1, w - 2), 1},
types.Coords{rng.Range(1, w - 2), h -2},
types.Coords{1, rng.Range(1, h - 2)},
types.Coords{w - 2, rng.Range(1, h - 2)},
)
return newRoom
}