This commit is contained in:
2019-10-27 02:51:35 +03:00
parent 0da505b01b
commit 184ac149ee
7 changed files with 139 additions and 63 deletions

3
engine/gamemap/TODO Normal file
View File

@ -0,0 +1,3 @@
- load prefabs
- compose from gens and prefabs
- editor for prefabs

View File

@ -1,20 +0,0 @@
package gamemap
type mapGen interface {
generate(l *Level) *Level
}
type defaultGen struct{}
func (d defaultGen) generate(l *Level) *Level {
l.Tiles, rooms = addRooms(l)
l.Tiles = connectRooms(rooms)
l.Objects = populate(rooms)
return l
}
func addRooms(l *Level) {
}

View File

@ -10,6 +10,7 @@ var minRoomSize = 3
var maxRoomSize = 11
var maxrooms = 100
//fixme make closure to stack them
func DefaultGen(l *gamemap.Level) *gamemap.Level {
rng := util.NewRNG()

View File

@ -40,6 +40,7 @@ type Tile struct {
BlocksSight bool
Explored bool
MustDraw bool
Colordance bool
}
func NewWall() *Tile {
@ -91,6 +92,7 @@ func NewWaterTile() *Tile {
BlocksSight: false,
Explored: false,
MustDraw: true, //fixme debug
Colordance: true,
Appearance: &Appearance{
Char: ".",
ColorSet: &TileColorSet{
@ -120,6 +122,7 @@ func NewDeepWaterTile() *Tile {
BlocksSight: false,
Explored: false,
MustDraw: true, //fixme debug
Colordance: true,
Appearance: &Appearance{
Char: " ",
ColorSet: &TileColorSet{