BallTests PaddleCollision Method Delta Engine Documentation

Namespace: Breakout.Tests
Assembly: Breakout.Tests (in Breakout.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void PaddleCollision()
Examples

[Test, CloseAfterFirstFrame]
public void PaddleCollision()
{
    var ball = Resolve<TestBall>();
    var paddle = Resolve<Paddle>();
    AdvanceTimeAndUpdateEntities(0.01f);
    ball.CurrentVelocity = new Vector2D(0f, 0.1f);
    ball.SetPosition(paddle.Position);
    Assert.IsFalse(ball.IsCurrentlyOnPaddle);
    AdvanceTimeAndUpdateEntities(0.01f);
    Assert.LessOrEqual(ball.CurrentVelocity.Y, 0.1f);
}
See Also