matrx.utils

Module Contents

get_distance(coord1, coord2)

Get distance between two x,y coordinates

get_room_locations(room_top_left, room_width, room_height)

Returns the locations within a room, excluding walls.

This is a helper function for adding objects to a room. It returns a list of all (x,y) coordinates that fall within the room excluding the walls.

Parameters
room_top_left: tuple, (x, y)

The top left coordinates of a room, as used to add that room with methods such as add_room.

room_width: int

The width of the room.

room_height: int

The height of the room.

Returns
list, [(x,y), …]

A list of (x, y) coordinates that are encapsulated in the rectangle, excluding walls.

See also

WorldBuilder.add_room