SimplePhysicsTests KillSpriteAfterTimeout Method Delta Engine Documentation

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

public void KillSpriteAfterTimeout()
Examples

[Test]
public void KillSpriteAfterTimeout()
{
    var enemyMovingOutOfScreen =
        new Sprite(new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogo"),
            new Rectangle(Vector2D.Half, new Size(0.1f)));
    var data = new SimplePhysics.Data { Velocity = new Vector2D(0.5f, 0), Duration = 1 };
    enemyMovingOutOfScreen.Add(data);
    enemyMovingOutOfScreen.Start<SimplePhysics.Move>();
    enemyMovingOutOfScreen.Start<SimplePhysics.KillAfterDurationReached>();
    if (IsMockResolver)
        AdvanceTimeAndUpdateEntities(1.1f);
}
See Also