Documentation
¶
Overview ¶
rect is a subpackage for generating labyrinth walls of type []image.Rectangle
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawWallsToImage ¶
DrawWallsToImage draws the wall rectangles onto an RGBA image
Types ¶
type MazeGenerator ¶
type MazeGenerator struct {
WallThickness int
Width, Height int
CellSize int
Grid [][]Cell
// contains filtered or unexported fields
}
MazeGenerator holds the maze state
func NewMazeGenerator ¶
func NewMazeGenerator(width, height, cellSize, wallThickness int) *MazeGenerator
NewMazeGenerator creates a new maze generator
func (*MazeGenerator) GenerateMaze ¶
func (mg *MazeGenerator) GenerateMaze() []image.Rectangle
GenerateMaze creates a maze using depth-first search algorithm
func (*MazeGenerator) Size ¶ added in v1.1.0
func (mg *MazeGenerator) Size() image.Point
Size returns the size of the maze in pixels.
The size is calculated as the number of cells multiplied by the cell size, plus the wall thickness to account for the walls around the maze.
Click to show internal directories.
Click to hide internal directories.