예제 #1
0
 private void Retract()
 {
     movementTimer  = new Timer(RETRACT_DURATION, EndRetract, false);
     stateTimer     = new Timer(RETRACTED_DURATION, PartiallyExtend, false);
     extensionState = ExtensionStates.RETRACT;
     Active         = false;
 }
예제 #2
0
        public RetractableSpikes(Platform platform) :
            base(HazardTypes.RETRACTABLE_SPIKES)
        {
            BoundingBox2D platformBox = platform.BoundingBox;

            numSpikes              = (int)platformBox.Width / textureWidth;
            platformTop            = (int)platformBox.Top;
            partialExtensionTarget = platformTop - PARTIAL_EXTENSION_LENGTH;
            fullExtensionTarget    = platformTop - texture.Height;

            position       = new Vector2(platformBox.Left, platformTop);
            BoundingBox    = new BoundingBox2D(platformBox);
            stateTimer     = new Timer(RETRACTED_DURATION, PartiallyExtend, false);
            extensionState = ExtensionStates.NONE;
        }
예제 #3
0
 public StatusChangedEventArgs(ExtensionInfo ext, ExtensionStates status)
 {
     ExtensionValue = ext;
     StatusValue = status;
 }
예제 #4
0
 private void EndRetract()
 {
     position.Y     = platformTop;
     extensionState = ExtensionStates.NONE;
 }
예제 #5
0
 private void EndFullExtension()
 {
     position.Y     = fullExtensionTarget;
     extensionState = ExtensionStates.NONE;
     Active         = true;
 }
예제 #6
0
 private void EndPartialExtension()
 {
     position.Y     = partialExtensionTarget;
     extensionState = ExtensionStates.NONE;
 }
예제 #7
0
 private void FullyExtend()
 {
     movementTimer  = new Timer(FULL_EXTENSION_DURATION, EndFullExtension, false);
     stateTimer     = new Timer(EXTENDED_DURATION, Retract, false);
     extensionState = ExtensionStates.FULL;
 }
예제 #8
0
 private void PartiallyExtend()
 {
     movementTimer  = new Timer(PARTIAL_EXTENSION_DURATION, EndPartialExtension, false);
     stateTimer     = new Timer(PARTIALLY_EXTENDED_DURATION, FullyExtend, false);
     extensionState = ExtensionStates.PARTIAL;
 }