Static Properties

PropertyTypeDescription
cellSizefloatWorld-unit size of one grid cell, auto-detected from tile sprites at startup. Use this to calculate movement offsets.
startTilePathTileThe tile the player starts on at the beginning of each run.
endTilePathTileThe goal tile. The runner checks whether the player is here to determine level success.

Static Methods

MethodReturnsDescription
GetTile(Vector3 position)PathTileReturns the PathTile at the given world position, or null if no tile exists there.
CellPosition(Vector3 position)Vector2Snaps a world position to the nearest grid cell center.

Common Patterns

// Move one cell in the instruction's direction
Vector2 target = ctx.player.position
               + direction.AsVector2() * MapManager.cellSize;

// Move two cells (e.g. Jump)
Vector2 target = ctx.player.position
               + direction.AsVector2() * MapManager.cellSize * 2;

// Check if the tile at a position exists
PathTile tile = MapManager.GetTile(target);
if (tile == null) { /* no tile there */ }

// Check if a position is walkable (tile + no obstacles)
if (!ctx.player.ValidatePosition(target)) { /* blocked */ }