escapy.types

Core type definitions used throughout the escapy library.

class escapy.types.Position(x, y)[source]

Bases: object

A 2D position expressed as normalised fractions of the game area.

Both x and y are expected to be in the range [0.0, 1.0], where (0.0, 0.0) is the top-left corner and (1.0, 1.0) is the bottom-right corner of the game area.

Parameters:
x: float

Horizontal fraction (0.0 = left edge, 1.0 = right edge).

y: float

Vertical fraction (0.0 = top edge, 1.0 = bottom edge).

type escapy.types.Room = dict[str, Position]

Mapping of object IDs to their positions within a room.