Documentation
¶
Overview ¶
Package worldgen provides a dynamic world generation library for 2D games. It offers configurable, deterministic terrain generation with support for difficulty scaling and seamless chunk transitions.
Index ¶
Constants ¶
const ( TileTypeEmpty = worldgen.TileTypeEmpty TileTypeGrass = worldgen.TileTypeGrass TileTypeWater = worldgen.TileTypeWater TileTypeForest = worldgen.TileTypeForest TileTypeMountain = worldgen.TileTypeMountain TileTypeDesert = worldgen.TileTypeDesert TileTypeLava = worldgen.TileTypeLava ChunkSize = worldgen.ChunkSize DefaultDifficulty = worldgen.DefaultDifficulty DefaultSimilarity = worldgen.DefaultSimilarity )
Constants for tile types and default values.
Variables ¶
This section is empty.
Functions ¶
func TileTypeString ¶
TileTypeString returns a human-readable representation of the TileType.
Types ¶
type ChunkCoord ¶
type ChunkCoord = worldgen.ChunkCoord
ChunkCoord represents the unique coordinates of a map chunk.
type Generator ¶
Generator is the core interface for world generation algorithms.
func NewNoiseGenerator ¶
NewNoiseGenerator creates a new noise-based world generator with the given seed.
type NeighborProvider ¶
type NeighborProvider = worldgen.NeighborProvider
NeighborProvider is a function type for querying neighboring chunk data.
type NoiseGenerator ¶
type NoiseGenerator struct {
// contains filtered or unexported fields
}
NoiseGenerator implements worldgen.Generator using Perlin noise.
func (*NoiseGenerator) GenerateChunk ¶
func (g *NoiseGenerator) GenerateChunk(coord ChunkCoord, difficulty, similarity float64, neighbors map[ChunkCoord]ChunkData) (ChunkData, error)
GenerateChunk generates a chunk of terrain using Perlin noise.
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
basic
command
Example program demonstrating the world generation library.
|
Example program demonstrating the world generation library. |
|
difficulty
command
Example demonstrating difficulty-based terrain generation.
|
Example demonstrating difficulty-based terrain generation. |
|
similarity
command
Example demonstrating similarity-based edge blending.
|
Example demonstrating similarity-based edge blending. |
|
internal
|
|
|
worldgen
Package worldgen provides core types and interfaces for dynamic world generation.
|
Package worldgen provides core types and interfaces for dynamic world generation. |