Tag Info

New answers tagged


You were right about checking it before it collides but the handling collision algorithm you code will not solve it. As it doesn't handle all the case that can occur. Lets say that the player comes and grounded on the top of the platform. Yes the case of: if(Position.Y < OtherObject.Position.Y){verticalPoint = OtherObject.Position.Y - BoundRect.Height;} ...


I have looked into your code and I could see some wrong procedures ( I think , I might be wrong though ) but I will try to look more into it to see what are its problems . However , since your main goal is to stop the rectangles from intersecting each other , I have another way that works well ( mostly ) and I think is more efficient than your algorithm . ( ...


BoundingBox provides several Contains (MSDN) methods that return ContainmentType (MSDN). To test if an object is outside your bounding box, test for ContainmentType.Disjoint.


You need to invert the logic of the test not the box itself. The bounding box can only describe a box. Whether that is a rectangular solid in space or a rectangular hole in infinite space is up to the test performed.

Top 50 recent answers are included