2024-01-25 18:52:47 +03:00
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
using Apos.Shapes;
|
|
|
|
|
2024-01-31 12:32:16 +03:00
|
|
|
using Syntriax.Engine.Core.Abstract;
|
2024-01-25 18:52:47 +03:00
|
|
|
using Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
|
|
|
|
namespace Pong.Behaviours;
|
|
|
|
|
|
|
|
public class CircleBehaviour : Syntriax.Engine.Physics2D.Collider2DCircleBehaviour, IDisplayableShape
|
|
|
|
{
|
2024-01-27 22:45:49 +03:00
|
|
|
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; }
|
2024-01-25 18:52:47 +03:00
|
|
|
|
|
|
|
public Color Color { get; set; } = Color.White;
|
|
|
|
public float Thickness { get; set; } = .5f;
|
|
|
|
|
|
|
|
public void Draw(ShapeBatch shapeBatch)
|
|
|
|
{
|
2024-01-28 15:33:15 +03:00
|
|
|
if (!IsActive)
|
|
|
|
return;
|
|
|
|
|
2024-01-27 21:50:28 +03:00
|
|
|
Recalculate();
|
|
|
|
|
2024-01-25 18:52:47 +03:00
|
|
|
shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color);
|
|
|
|
}
|
|
|
|
}
|