MrGravity.Level.Respawn C# (CSharp) Method

Respawn() public method

Respawn the player. Reset gravity direction and clear player velocity TODO - Reset all other objects as well
public Respawn ( ) : void
return void
        public void Respawn()
        {
            _mPlayer.Respawn();

            _mPlayer.StopRumble();
            _mHasRespawned = true;

            _mActiveAnimations.Clear();

            _mPhysicsEnvironment.GravityDirection = GravityDirections.Down;

            //Only play respawn noise when player is still alive
            if (_mPlayer.MNumLives > 0)
                GameSound.PlayerSoundRespawn.Play(GameSound.Volume * 0.8f, 0.0f, 0.0f);

            foreach (var gameObject in _mObjects)
                if(gameObject != _mPlayer)
                    gameObject.Respawn();
        }