public void SearchSpriteCollision(Sprite spriteOne,Sprite spriteTwo) { spriteOne.IsColliding = false; spriteTwo.IsColliding = false; if(AreBoxesColliding(spriteOne.BoundingBoxRect,spriteTwo.BoundingBoxRect)) { spriteOne.IsColliding = true; spriteTwo.IsColliding = true; } }
//TODO:Discover why List<Sprite> doesn't accept List<FallingObjectsSprite> both T are children of Sprite public void SearchSpriteCollision(List<FallingObjectsSprite> searchingSprites, Sprite comparingSprite) { comparingSprite.IsColliding = false; foreach (FallingObjectsSprite currentSprite in searchingSprites) { currentSprite.IsColliding = false; if (AreBoxesColliding(currentSprite.BoundingBoxRect, comparingSprite.BoundingBoxRect)){ currentSprite.IsColliding = true; comparingSprite.IsColliding = true; } } }