The scene view outlines a tilemap's collision only along its outer edges: where two pieces meet, their shared stretch runs once in each direction and is not drawn, so an autotile lake is one outline without cross strokes at the quarters, merged rectangles of plain tiles and one-way tiles follow the same rule, the bridges from splitting concave outlines disappear and a piece doubled on two layers is outlined once; fill and collision stay as they were, and the result is cached per tilemap and rebuilt only when its collision data changes (#173)
game-maker / gate (push) Successful in 1m56s
game-maker / suite (push) Successful in 6m54s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-19 12:54:53 +02:00
1 parent 6a31f5e0ad
commit d4ea04d4d6
7 files changed
+365 -10

No files matched your search

+17 -1
View File
@@ -24,7 +24,7 @@
import type { TileAsset, TilemapAsset } from './Asset';
import { tileQuadrants } from './autotile';
import { angleOf, apply, type Mat, scaleOf } from './matrix';
import { clipToRect, convexPieces, signedArea } from './polygon';
import { boundaryOf, type BoundaryLine, clipToRect, convexPieces, signedArea } from './polygon';
import type { PropertyBag, Vec2 } from './Properties';
import { findAssetOf, type Project } from './Project';
import { findFrame } from './texture';
@@ -375,6 +375,22 @@ export function solidRects(
return mergeCells(solidCells(project, props, asset, oneWay));
}
/**
* The outline of where the map blocks, in cells, as the scene view draws it (#173): only the outer
* edges of the rectangles and outlined cells together, so the quarters an autotile is pieced from
* and the rectangles of a merged wall do not show as strokes across what blocks. Drawing only –
* collision keeps the pieces.
*/
export function solidBoundary(rects: readonly CellRect[], polygons: readonly CellPolygon[]): BoundaryLine[] {
const rings = rects.map(({ x, y, w, h }) => [
{ x, y },
{ x: x + w, y },
{ x: x + w, y: y + h },
{ x, y: y + h },
]);
return boundaryOf([...rings, ...polygons.map((polygon) => polygon.outline)]);
}
/**
* One rectangle as it sits in the world: a box turning and growing with the placed map, the same
* shape a collider on it would have (see `properties/collider.ts`).