1
Vote

add collision detection and fluent methods to incorporate collision effects

description

Recognize when two objects are overlapping. Use a two-phased approach for efficiency: first determine if bounding rectangles overlap, and if they are, determine if painted regions overlap.
 
Add an extension method to modify the animation so that an animation stops early if a collision occurs with any object (or a specific object or set of objects).
 
Possible code examples:
GamePiece1.MoveBy(100, 0, 2.seconds()).UntilAnyCollision();
GamePiece1.MoveBy(100, 0, 2.seconds()).UntilCollision(GamePiece2, GamePiece3, GamePiece4); // params array
GamePiece1.MoveBy(100, 0, 2.seconds()).UntilCollision(a => GetPiecesThatCanCollide());
 
This should also work with resizing and rotations (especially those that rotate around a point outside their bounding boxes).

comments