Exemple #1
0
func NewStoneFieldGenerator(db *engine.EntityDB, fill float64) *StoneFieldGenerator {
	grass := db.New()
	db.Set(grass, "art", base.NewArt('.', 0, 1, 0, 0, 0, 0))
	stone := db.New()
	db.Set(stone, "art", base.NewArt('#', .7, .7, .7, 0, 0, 0))
	return &StoneFieldGenerator{stone: stone, grass: grass, fill: fill}
}
Exemple #2
0
/*
CreateMap creates a new map region entity and returns it
*/
func CreateMap(db *engine.EntityDB) engine.Entity {
	retval := db.New("map")

	// Register a chunk generator on the map
	emap := db.Get(retval, "map").(*base.EntityMap)
	emap.RegisterChunkGenerator(NewStoneFieldGenerator(db, .05))

	return retval
}