예제 #1
0
파일: main.go 프로젝트: kirbywarp/rogue
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}
}
예제 #2
0
파일: main.go 프로젝트: kirbywarp/rogue
/*
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
}