feat: Circle Behaviour
This commit is contained in:
26
Game/Behaviours/CircleBehaviour.cs
Normal file
26
Game/Behaviours/CircleBehaviour.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
using Apos.Shapes;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
using Syntriax.Engine.Physics2D.Primitives;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class CircleBehaviour : Syntriax.Engine.Physics2D.Collider2DCircleBehaviour, IDisplayableShape
|
||||
{
|
||||
public CircleBehaviour(Circle circle) { this.CircleLocal = circle; }
|
||||
public CircleBehaviour(Circle circle, float Thickness) { this.CircleLocal = circle; this.Thickness = Thickness; }
|
||||
public CircleBehaviour(Circle circle, Color color) { this.CircleLocal = circle; Color = color; }
|
||||
public CircleBehaviour(Circle circle, Color color, float Thickness) { this.CircleLocal = circle; this.Thickness = Thickness; Color = color; }
|
||||
|
||||
public Color Color { get; set; } = Color.White;
|
||||
public float Thickness { get; set; } = .5f;
|
||||
|
||||
public void Draw(ShapeBatch shapeBatch)
|
||||
{
|
||||
Recalculate();
|
||||
|
||||
shapeBatch.BorderCircle(CircleWorld.Center.ToDisplayVector2(), CircleWorld.Radius, Color);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user