Module collision

Source
Expand description

Simple collision resolution logic.

Enums§

BounceDirection
The direction in which an object colliding with something should bounce.

Functions§

collide_with_boundary
A function to check collision between some moving object with a bounding box and the edges of some boundary. If the boundary rectangle does not fully contain the bounding box, return the direction the object must bounce to stay within the boundary.
collide_with_rect
A function to check collision between an object moving in self_direction with a bounding box self_bounding_box, and some other bounding box. If bounding boxes intersect, return the direction the moving object should bounce, otherwise, return None.