Documentation ¶
Index ¶
Constants ¶
View Source
const MaxElevation = 19
MaxElevation is the number of distinct elevations, numbered 0..MaxElevation.
Variables ¶
View Source
var Terrain = []TerrainType{
'g': {"g", "Grass"},
'm': {"m", "Mountain"},
'w': {"w", "Water"},
'l': {"l", "Lava"},
'd': {"d", "Desert"},
'f': {"f", "Tree"},
'i': {"i", "Glacier"},
}
Terrain is an array with the canonical terrain representations, indexed by the terrain type's unique character.
View Source
var TileSize = geom.Pt(32, 32)
TileSize is the size of a world tile in pixels.
Functions ¶
This section is empty.
Types ¶
type Loc ¶
type Loc struct { // Terrain is the type of this locations terrain. Terrain *TerrainType // X and Y are the coordinates of this location X, Y int // Elevation is the elevation of the ground or the // surface of a body of water. Elevation int // Depth is the depth of water at this location. Depth int }
A Loc is a cell in the grid that represents the world
type TerrainType ¶
type TerrainType struct { // Char is the character representing this terrain type. Char string // Name is a human readable name of the terrain type. Name string }
TerrainType holds information on a given type of terrain.
type World ¶
type World struct { // Pixels is a Torus in the dimension of the world in pixels. Pixels geom.Torus // W and H are the width and height of the world's // location grid. W, H int // X0 and Y0 are the start location. X0, Y0 int // contains filtered or unexported fields }
World is the main container for the world representation of minima.
func (*World) LocsWithType ¶
LocsWithType returns a slice of pointers to all of the locations with any of the given types.
Click to show internal directories.
Click to hide internal directories.