Skip to content

PhysicsAPI reference

Namespace MicroEngine.World

Tile layers, collision grids, swept movement against tiles (TileMotion), autotiling and drawing tiles.

Guide: Tile maps and collision

Classes

Autotile

Helpers for picking tile sprites from their neighbours.

TileGrid

A collision grid backed by a TileLayer and a per-id flag table. Cells outside the map use OutsideFlags (solid by default, so levels are closed).

TileLayer

A rectangular grid of integer tile ids (0 conventionally means empty).

TileMotion

Moves an axis-aligned box through a tile grid (plus optional extra solid rectangles such as moving platforms or push blocks). X is resolved before Y, each as a swept test in sub-steps no larger than half a tile: the box stops flush against the first solid tile or rectangle in its way, however thin, so it never tunnels. One-way tiles only stop bodies falling onto their top edge.

TileRenderer

Draws the visible part of a layer, asking the game which sprite each tile uses.

Structs

TileMoveResult

What happened during a Move. A body of the physics contract reports its move in MoveResult instead.

Interfaces

ICollisionGrid

Answers collision queries for TileMotion.

Enums

TileFlags

Collision semantics of a tile. Games may use the Custom bits for their own meaning.