Engine-Pong/Game/Behaviours/CircleBehaviour.cs

30 lines
973 B
C#
Raw Normal View History

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
{
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)
{
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);
}
}