Circle

Introduction The Circle object is commonly used for collision and as a placeholder graphic in game development. Circles can be added to entities which implement the ICollidable interface to act as the entity’s collision shape. Adding a Circle To add a circle to an existing entity: Expand the entity Right-click on the entity’s Objects folder[…]

FlatRedBall.Math.Geometry.Circle.CollideAgainst

Introduction The CollideAgainst function is a function which returns whether one shape/ShapeCollection is touching another shape/ShapeCollection. CollideAgainst does not modify the positions or velocities of either of the callers, it simply returns true/false. Common Usage CollideAgainst is often used in the following situations: Damage-dealing collision such as a player entity vs. a bullet entity. Game[…]

FlatRedBall.Math.Geometry.Circle.Visible

Introduction The Visible property on a Circle controls whether the Circle is rendered or not. Invisible Circles will still perform collision properly, so this property does not need to be set if using Circles purely for collision. Rendered circles will render their outline using their Color property. Circles cannot be filled-in, only their outline will[…]

FlatRedBall.Math.Geometry.Circle.IsPointInside

Introduction The IsPointInside method returns whether the argument X,Y are inside the Circle. The X and Y values are absolute values. Code Example The following shows how to check if the Cursor is inside a Circle instance:

FlatRedBall.Math.MathFunctions.GetPointInCircle

Introduction The GetPointInCircle method returns a random point inside a circle with the argument radius, centered at 0,0. This method returns an even distribution, as opposed to a “random radius, random angle” approach which returns a higher concentration of points at the center of the circle. Code example Add the following using statements:

Use[…]

FlatRedBall.Math.Geometry.Circle.LastMoveCollisionReposition

Introduction The LastMoveCollisionReposition is a property that exists for all Shapes. This property is set whenever a shape calls CollideAgainstBounce or CollideAgainstMove and the method test results in an actual collision. The LastMoveCollisionReposition property can then be tested to obtain information about collision. Code Example When two AxisAlignedRectangles collide the collision side can be determined[…]

FlatRedBall.Math.Geometry.Circle.ProjectParentVelocityOnLastMoveCollisionTangent

Introduction The ProjectParentVelocityOnLastMoveCollisionTangent method can be used to create realistic collisions between a Circle and any other Shape. The Circle’s version of ProjectParentVelocityOnLastMoveCollisionTangent behaves the same as the Polygon‘s version. For more information, see the Polygon’s ProjectParentVelocityOnLastMoveCollisionTangent article.

FlatRedBall.Math.Geometry.Circle

Introduction The Circle represents a PositionedObject which can be used to draw circles or conduct circular collision which is very efficient. Circles are created and removed through the ShapeManager. Creating a Circle in Glue Glue supports the creation of Circles in Screens and Entities. To create a Circle in Glue: Expand a Screen or Entity[…]