Create a Grid
No grid created yet
Overview
UGrid.create(cols, rows, options) → Grid
Creates a new grid with specified dimensions and topology
grid.get(x, y) → Cell
Retrieves cell at coordinates
Grid Methods
each(callback) → void
Iterate over all cells
eachNeighborOf(cell, callback) → void
Get adjacent cells
mapDistance(cell1, cell2) → number
Calculate distance between cells
Examples
// Create square grid let grid = UGrid.create(8, 6, { type: UGrid.square, cellSize: 30 }); // Access cells let cell = grid.get(3, 2); cell.value = 42;