EnemyPlane ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering2D Entity2D
        DeltaEngine.Rendering2D HierarchyEntity2D
          DeltaEngine.Rendering2D Sprite
            SideScroller Plane
              SideScroller EnemyPlane

Namespace: SideScroller
Assembly: SideScroller (in SideScroller.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public class EnemyPlane : Plane

The EnemyPlane type exposes the following members.

Constructors

  NameDescription
Public methodEnemyPlane
Initializes a new instance of the EnemyPlane class
Top
Methods

  NameDescription
Public methodAccelerateVertically (Inherited from Plane.)
Public methodAdd(HierarchyObject2D) (Inherited from HierarchyEntity2D.)
Public methodAdd T (T) (Inherited from Sprite.)
Public methodAddTag (Inherited from Entity.)
Public methodCheckIfHitAndReact
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity2D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodFireMgShotIfAllowed (Inherited from Plane.)
Public methodFireMissileIfAllowed (Inherited from Plane.)
Public methodGet T  (Inherited from Sprite.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Public methodGetComponentsForEditing (Inherited from Entity2D.)
Protected methodGetComponentsForSaving (Inherited from Sprite.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetFirstChildOfType T  (Inherited from HierarchyEntity2D.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodNextUpdateStarted (Inherited from Sprite.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnPositionChanged (Inherited from HierarchyEntity2D.)
Protected methodOnRotationChanged (Inherited from HierarchyEntity2D.)
Public methodReceiveAttack (Inherited from Plane.)
Public methodRemove(HierarchyObject2D) (Inherited from HierarchyEntity2D.)
Public methodRemove T   (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodReset (Inherited from Sprite.)
Public methodRotatedDrawAreaContains (Inherited from Entity2D.)
Public methodSet (Inherited from Sprite.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Sprite.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodStopVertically (Inherited from Plane.)
Public methodToggleVisibility (Inherited from DrawableEntity.)
Public methodToString (Inherited from Entity.)
Public methodUpdateGlobalsFromParent (Inherited from HierarchyEntity2D.)
Top
Extension Methods

  NameDescription
Public Extension MethodAffixToPhysics (Defined by Entity2DPhysicsExtensions.)
Public Extension MethodStartBouncingOffScreenEdges (Defined by Entity2DExtensions.)
Public Extension MethodStartFalling (Defined by Entity2DExtensions.)
Public Extension MethodStartMoving (Defined by Entity2DExtensions.)
Public Extension MethodStartMovingUV (Defined by Entity2DExtensions.)
Public Extension MethodStartRotating (Defined by Entity2DExtensions.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldelapsedSinceLastMGShot (Inherited from Plane.)
Protected fieldelapsedSinceLastMissile (Inherited from Plane.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Protected fieldmachineGunAndLauncher (Inherited from Plane.)
Protected fieldmgCadenceInverse (Inherited from Plane.)
Protected fieldmissileCadenceInverse (Inherited from Plane.)
Top
Properties

  NameDescription
Public propertyAlpha (Inherited from Entity2D.)
Public propertyBlendMode (Inherited from Sprite.)
Public propertyCenter (Inherited from Entity2D.)
Public propertyChildren (Inherited from HierarchyEntity2D.)
Public propertyColor (Inherited from Entity2D.)
Public propertyCurrentFrame (Inherited from Sprite.)
Public propertyDidFootprintChange (Inherited from Entity2D.)
Public propertyDrawArea (Inherited from Entity2D.)
Public propertyElapsed (Inherited from Sprite.)
Public propertyFlipMode (Inherited from Sprite.)
Public propertyHitpoints (Inherited from Plane.)
Public propertyIsActive (Inherited from Plane.)
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsPlaying (Inherited from Sprite.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyLastColor (Inherited from Entity2D.)
Public propertyLastDrawArea (Inherited from Entity2D.)
Public propertyLastUV (Inherited from Sprite.)
Public propertyMaterial (Inherited from Sprite.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyParent (Inherited from HierarchyEntity2D.)
Public propertyRelativePosition (Inherited from HierarchyEntity2D.)
Public propertyRelativeRotation (Inherited from HierarchyEntity2D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyRotation (Inherited from Entity2D.)
Public propertyRotationCenter (Inherited from Entity2D.)
Public propertySize (Inherited from Entity2D.)
Public propertyTopLeft (Inherited from Entity2D.)
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyUV (Inherited from Sprite.)
Public propertyYPosition (Inherited from Plane.)
Top
Events

  NameDescription
Public eventAnimationEnded (Inherited from Sprite.)
Public eventDestroyed (Inherited from Plane.)
Top
Remarks

Tests: SideScroller.Tests.EnemyPlaneTests
Examples

3 unit tests call SideScroller.EnemyPlane
[Test]
public void LowerLifeWhenHitByBullet()
{
    enemy = new EnemyPlane(new Vector2D(1.2f, 0.5f));
    Assert.AreEqual(5, enemy.Hitpoints);
    enemy.CheckIfHitAndReact(new Vector2D(1.2f, 0.5f));
    Assert.AreEqual(4, enemy.Hitpoints);
}
[Test]
public void DefeatEnemyPlane()
{
    enemy = new EnemyPlane(new Vector2D(1.2f, 0.9f));
    bool defeated = false;
    enemy.Destroyed += () => { defeated = true; };
    enemy.ReceiveAttack(5);
    Assert.LessOrEqual(enemy.Hitpoints, 0);
    Assert.IsTrue(defeated);
}
[Test]
public void EnemyDespawnsOutsideScreenArea()
{
    enemy = new EnemyPlane(new Vector2D(ScreenSpace.Current.Left - enemy.DrawArea.Width, 0.5f));
    AdvanceTimeAndUpdateEntities();
    Assert.IsFalse(enemy.IsActive);
}
See Also