Exemple #1
0
 public ICommand EnemyEffect(IEnemy enemy)
 {
     _sprite.Hide();
     _arrowStateMachine.ClearBounds();
     Halt();
     return(new SpawnableDamage(enemy, 2));
 }
Exemple #2
0
        public void Update()
        {
            if (_currentDistanceAway == ReturnDistance * 2)
            {
                _sprite.Hide();
            }
            UpdateFlippedDirection();

            switch (_direction)
            {
            case Direction.Up:
                _location.Y -= DistancePerFrame;
                break;

            case Direction.Down:
                _location.Y += DistancePerFrame;
                break;

            case Direction.Left:
                _location.X -= DistancePerFrame;
                break;

            case Direction.Right:
                _location.X += DistancePerFrame;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            _currentDistanceAway += DistancePerFrame;
            Bounds = new Rectangle(_location.ToPoint(), Bounds.Size);

            _sprite.Update();
        }
Exemple #3
0
        public void Update()
        {
            _framesDelayed++;
            _invincibilityTimer++;

            if (_health > 0 && _framesDelayed != FramesToDisappear)
            {
                return;
            }
            Halted = true;
            _sprite.Hide();
        }
 public void Update()
 {
     if (_framesDelayed++ == FramesToDisappear || _collisions >= CollisionsToDisappear)
     {
         _sprite.Hide();
         _inventory.AddCoin();
         Halted = true;
     }
     _location.X += _velocityX;
     _location.Y += _velocityY;
     _sprite.Update();
 }
        public void Update()
        {
            _sprite.Update();
            _framesDelayed++;

            if (_framesDelayed < FramesToDisappear)
            {
                SetExplosionSpriteLocations();
            }
            else if (_framesDelayed == FramesToDisappear)
            {
                Halted = true;
                _sprite.Hide();
            }
        }
Exemple #6
0
        public void Update()
        {
            if (_framesDelayed++ == FramesToDisappear)
            {
                _startSprite.Hide();
                _middleSprite.Hide();
                _endSprite.Hide();
                Halted = true;
            }
            _startSprite.Update();
            _middleSprite.Update();
            _endSprite.Update();

            switch (_direction)
            {
            case Direction.Up when Bounds.Height <= 80:
                Bounds          = new Rectangle(Bounds.X, Bounds.Y - LaserBeamSpeed, Bounds.Width, Bounds.Height + LaserBeamSpeed);
                _endLocation.Y -= LaserBeamSpeed;
                break;

            case Direction.Down when Bounds.Height <= 80:
                Bounds          = new Rectangle(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height + LaserBeamSpeed);
                _endLocation.Y += LaserBeamSpeed;
                break;

            case Direction.Left when Bounds.Width <= 120:
                Bounds          = new Rectangle(Bounds.X - LaserBeamSpeed, Bounds.Y, Bounds.Width + LaserBeamSpeed, Bounds.Height);
                _endLocation.X -= LaserBeamSpeed;
                break;

            case Direction.Right when Bounds.Width <= 120:
                Bounds          = new Rectangle(Bounds.X, Bounds.Y, Bounds.Width + LaserBeamSpeed, Bounds.Height);
                _endLocation.X += LaserBeamSpeed;
                break;

            case Direction.Up:
            case Direction.Down:
            case Direction.Left:
            case Direction.Right:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #7
0
        public void Update()
        {
            _sprite.Update();
            _framesDelayed++;

            if (_framesDelayed == FramesToExplosion)
            {
                SoundEffectManager.Instance.PlayBombExplode();
                _sprite = ProjectileSpriteFactory.Instance.CreateBombExplosion();
                SetExplosionSpriteLocations();
                Bounds = new Rectangle((int)_location.X - 16, (int)_location.Y - 16, 48, 48);
            }
            else if (_framesDelayed > FramesToExplosion && _framesDelayed < FramesToDisappear)
            {
                SetExplosionSpriteLocations();
            }
            else if (_framesDelayed == FramesToDisappear)
            {
                Halted = true;
                _sprite.Hide();
            }
        }
        public void PostSpin()
        {
            if (_spinCycles < MaxSpinCycles)
            {
                return;
            }
            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (_transitionFrames++)
            {
            case GrayFrame:
                Sprite = LinkSpriteFactory.Instance.CreateDeadLink();
                break;

            case GrayToSparklesFrame:
                Sprite = LinkSpriteFactory.Instance.CreateLinkDeathSparkle();
                break;

            case SparkleToHideFrame:
                Sprite.Hide();
                break;
            }
        }
Exemple #9
0
 public ICommand PlayerEffect(IPlayer player)
 {
     Halt();
     _sprite.Hide();
     return(new SpawnableDamage(player, 1));
 }
 public ICommand EnemyEffect(IEnemy enemy)
 {
     _sprite.Hide();
     _launchedBombStateMachine.ClearBounds();
     return(new SpawnableDamage(enemy, 4));
 }
Exemple #11
0
 public ICommand EnemyEffect(IEnemy enemy)
 {
     _sprite.Hide();
     _swordBeamStateMachine.ClearBounds();
     return(new SpawnableDamage(enemy, _damage));
 }
Exemple #12
0
 public ICommand EnemyEffect(IEnemy enemy)
 {
     Halt();
     _sprite.Hide();
     return(new SpawnableDamage(enemy, 1));
 }