Exemplo n.º 1
0
        /// <summary>
        /// Releases a spindash.
        /// </summary>
        private void ReleaseSpindash()
        {
            if (!_chargingSpindash)
            {
                return;
            }

            if (_spindashDust != null)
            {
                _entityService.KillEntity(_spindashDust);
                _spindashDust = null;
            }

            _moveController.GroundSpeed = 8 + (Math.Floor(_spindashCharge) / 2.0);

            if (_screenDirection == Direction.Left)
            {
                _moveController.GroundSpeed *= -1;
            }

            _moveController.RollSound = 0; // small hack to cancel out the roll sound when we release the spindash
            _moveController.Roll();
            _moveController.RollSound = _rollSoundId;

            _chargingSpindash = false;
            _audioService.PlaySoundEffect(_spindashReleaseSoundId);
        }