29 lines
936 B
C#
29 lines
936 B
C#
using Microsoft.Xna.Framework;
|
|
|
|
using Apos.Shapes;
|
|
|
|
using Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
namespace Pong.Behaviours;
|
|
|
|
public class CircleBehaviour : Syntriax.Engine.Physics2D.Collider2DCircleBehaviour, IDisplayableShape
|
|
{
|
|
public CircleBehaviour(Circle circle) : base(circle) { }
|
|
public CircleBehaviour(Circle circle, float thickness) : base(circle) { Thickness = thickness; }
|
|
public CircleBehaviour(Circle circle, Color color) : base(circle) { Color = color; }
|
|
public CircleBehaviour(Circle circle, Color color, float thickness) : base(circle) { Thickness = thickness; Color = color; }
|
|
|
|
public Color Color { get; set; } = Color.White;
|
|
public float Thickness { get; set; } = .5f;
|
|
|
|
public void Draw(ShapeBatch shapeBatch)
|
|
{
|
|
if (!IsActive)
|
|
return;
|
|
|
|
Recalculate();
|
|
|
|
shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color);
|
|
}
|
|
}
|