Example #1
0
        private void DestroyPlayer()
        {
            if (playerShip.ShieldActivated)
            {
                return;
            }

            if (playerShip.extraLives > 1)
            {
                playerShip.SetShipComponentActive(false);
                Invoke("DeActivateShield", Constants.Gameplay.PLAYER_REVIVE_SHIELD_DURATION);
                playerShip.extraLives--;
                GameActions.LivesUpdate(playerShip.extraLives);
                Invoke("RevivePlayer", Constants.Gameplay.PLAYER_REVIVE_DELAY);
            }
            else
            {
                CancelInvoke();
                Destroy(playerShip.gameObject);
                RemoveAllObjects();
                GameManager.Instance.GameCompleted();
            }
        }