Intermediate • Lesson 6

2.5D Isometric & A* Pathfinding

Isometric ("2.5D") games tilt a flat grid into diamonds to look 3D. Maverick handles the projection math and A* ("A-star") obstacle routing for you.

1. Isometric Diamond Centers & A* Routing

Every isometric tile in Maverick is anchored by its top vertex at worldToIso(col, row), so its exact visual center is (pos.x, pos.y + tileHeight / 2). Clicking anywhere on the grid converts back to (col, row) with map.worldToTile(), and GridPathfinder.findPath() routes around stone blocks.

const cell = map.worldToTile(worldX, worldY);
const path = GridPathfinder.findPath(startCell, cell, {
  columns: 8, rows: 8, allowDiagonal: false,
  isWalkable: (x, y) => map.isWalkable('ground', x, y, [2]),
});
PoC — Click Any Green Diamond to Walk Center-to-Center
Click any green diamond tile—the hero walks cleanly through the center of each tile!