Table of Contents

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

paddle1 Rectangle2D
paddle2 Rectangle2D

Properties

Direction

The direction of the ball

public Vector2 Direction { get; set; }

Property Value

Vector2

Speed

The speed of the ball

public double Speed { get; set; }

Property Value

double

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

box1 Rectangle2D
box2 Rectangle2D

Returns

bool

Tick(double)

Apply's a time based changes

public override void Tick(double delta)

Parameters

delta double

The amount of time in seconds that has passed