TowerTargetFinderTests DirectShotTowerFiresAtNearestCreep Method Delta Engine Documentation

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

public void DirectShotTowerFiresAtNearestCreep()
Examples

[Test, CloseAfterFirstFrame]
public void DirectShotTowerFiresAtNearestCreep()
{
    var tower = new Tower(TowerType.Water, Vector2D.Zero);
    var creep = CreateCreepOfType(CreepType.Cloth, Vector3D.UnitY);
    tower.RenderModel();
    var furtherCreep = CreateCreepOfType(CreepType.Cloth, new Vector2D(2.75f, 2.75f));
    AdvanceTimeTillTowerAttacks(tower);
    AdvanceTimeAndUpdateEntities(1.0f);
    Assert.IsTrue(tower.IsOnCooldown);
    Assert.LessOrEqual(0, EntitiesRunner.Current.GetEntitiesOfType<ParticleEmitter>().Count);
    Assert.Less(creep.GetStatPercentage("Hp"), 1);
    Assert.AreEqual(1, furtherCreep.GetStatPercentage("Hp"));
}
See Also