Class Ball
- Namespace
- AstraEngine.Examples.Pong
- Assembly
- AstraEngine.Examples.dll
public sealed class Ball : Component
- Inheritance
-
Ball
- Inherited Members
Constructors
Ball(Rectangle2D, Rectangle2D)
public Ball(Rectangle2D paddle1, Rectangle2D paddle2)
Parameters
paddle1Rectangle2Dpaddle2Rectangle2D
Properties
Direction
The direction of the ball
public Vector2 Direction { get; set; }
Property Value
Speed
The speed of the ball
public double Speed { get; set; }
Property Value
Methods
Initialize()
Executed when this Component is first active. Runs before Tick.
public override void Initialize()
IsColliding(Rectangle2D, Rectangle2D)
public bool IsColliding(Rectangle2D box1, Rectangle2D box2)
Parameters
box1Rectangle2Dbox2Rectangle2D
Returns
Tick(double)
Apply's a time based changes
public override void Tick(double delta)
Parameters
deltadoubleThe amount of time in seconds that has passed