def collide(sprite1, sprite2, collision_objects=None, original_pos=None):
"""
solves a simple spatial collision problem for two Sprites (that have a rect property)
- defaults to SAT collision between two objects
- thanks to doc's at: http://www.sevenson.com.au/actionscript/sat/
- TODO: handle angles on objects
- TODO: handle velocities of sprites prior to collision to calculate correct normals
:param Sprite sprite1: sprite 1
:param Sprite sprite2: sprite 2 (the other sprite)
:param Union[None,Tuple[Collision]] collision_objects: the two always-recycled returnable Collision instances (aside from None); if None,
use our default ones
:param Union[Tuple[int],None] original_pos: the position of sprite1 before doing the move that lead to this collision-detection call
:return: a Collision object with all details of the collision between the two Sprites (None if there is no collision)
:rtype: Union[None,Collision]
"""
pass
评论列表
文章目录