Remove
Introduction
Code Example
// Assuming polygonInstance is a valid Polygon:
ShapeManager.Remove(polygonInstance);
// Assuming circleInstance is a valid Circle:
ShapeManager.Remove(circle);
// you can remove all of the other shape types as wellRemoving a shape and calling collision methods
Circle firstCircle = ShapeManager.AddCircle();
Circle secondCircle = ShapeManager.AddCircle();
// Both circles will be in the same position, so they will collide
if(firstCircle.CollideAgainst(secondCircle))
{
// This will be true
}
// Now remove the circles from the ShapeManager:
ShapeManager.Remove(firstCircle);
ShapeManager.Remove(secondCircle);
if(firstCircle.CollideAgainst(secondCircle))
{
// This will still be true!
}So how do I remove a shape so it doesn't collide?
Shapes in a PositionedObjectList
Shapes in Entities
References to shapes
Last updated
Was this helpful?