BallTests BounceOnBottomSideToLoseBall 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 BounceOnBottomSideToLoseBall()
Examples

[Test, CloseAfterFirstFrame]
public void BounceOnBottomSideToLoseBall()
{
    var paddle = Resolve<Paddle>();
    var ball = new TestBall(paddle) { CurrentVelocity = new Vector2D(-0.5f, 0.5f) };
    ball.SetPosition(new Vector2D(0.5f, 1.0f));
    Assert.IsFalse(ball.IsCurrentlyOnPaddle);
    AdvanceTimeAndUpdateEntities(0.01f);
    Assert.IsTrue(ball.IsCurrentlyOnPaddle);
    Assert.AreEqual(Vector2D.Zero, ball.CurrentVelocity);
}
See Also