Example #1
0
 public static void GameOver(int score)
 {
     PauseMenu.PAUSED = true;
     gameover         = true;
     gameOverScreen.Show();
     gameOverScreen.scoreLabel.text = "  " + score;
 }
 private void GameOver()
 {
     gameOverScreen.Show();
     topBar.Hide();
     Sound.Instance.PlayMusicClip(MusicEnum.GameOverLoop, true);
     EventManager.Instance.StartPause();
 }
    public void ShowGameOver(bool victory, int timeTaken, bool controlledByOrchestrator)
    {
        var method = MethodBase.GetCurrentMethod();
        var attr   = (ServerAccess)method.GetCustomAttributes(typeof(ServerAccess), true)[0];

        if (!attr.HasAccess)
        {
            return;
        }
        GameOver = true;
        if (!SP_Manager.Instance.IsSinglePlayer())
        {
            RpcShowGameOver(victory, timeTaken, controlledByOrchestrator);
            GameOverScreen.Show();
        }
        else
        {
            ClientShowGameOver(victory, timeTaken, false);
        }
    }
Example #4
0
 public static void EndLevel()
 {
     if (CurrentMode != PlayMode.Finished)
     {
         Score += Mathf.CeilToInt(LevelTimer) * TimeBonusMultiplier;
     }
     CurrentMode = PlayMode.Finished;
     SoundBoard.StopMusic();
     SoundBoard.PlayFinish();
     GameOverScreen.Show();
 }
        public void StateEnter()
        {
            Continue       = false;
            Time.timeScale = 0;

            _gameOverScreen.Show();
            _gameOverScreen.SetScore(ScoreManager.Instance.Score);
            _gameOverTimeline.Play();

            GameOverStateEnter?.Invoke();
        }
    private IEnumerator GameOverCoroutine(GameOverScreen.GameOver gameOverCause, float seconds)
    {
        GameController.gameOver = true;
        yield return(new WaitForSeconds(seconds));

        IngameSounds = false;
        gameOverScreen.Show(gameOverCause, ore, gameTime);
        if (GameOverEvent != null)
        {
            GameOverEvent();
        }
    }
Example #7
0
    void onGameOver()
    {
        _gameOverScreen.Show();
        _gameScreen.Hide();

        _spawnPoint.enabled = false;

        _flippers.RotateDown();
        _flippers.enabled = false;

        _gameOverScreen.SetFinalScore(_score);
        _score = 0;

        //Inform subscribers
        onScoreChanged?.Invoke(_score);
    }
Example #8
0
        /*
         * Método: private void GameIsOver()
         *
         * Función: finalizar juego
         *
         * Descripción: Verifica si el juego ha terminado, ya sea con una victoria
         * o con una derrota. Si el juego ha terminado, guarda la puntuación final
         * del jugador y detiene el reloj de actualizaciones del juego.
         */
        private void GameIsOver()
        {
            if (GameData.gameOver)
            {
                GameData.gameStart = false;
                //el jugador ha ganado
                if (GameData.victory)
                {
                    /*Aplicar multiplier basado en el tiempo que tomo para completar
                     * el juego y las vidas restantes del jugador.*/
                    score        += (score * 10 / time) * hp;
                    txtScore.Text = "SCORE: " + score;

                    VictoryScreen.BackgroundImage       = Resources.VictoryImg;
                    VictoryScreen.BackgroundImageLayout = ImageLayout.Stretch;
                    VictoryScreen.Height = (int)(Height * 0.65);
                    VictoryScreen.Width  = (int)(Width * 0.80);
                    VictoryScreen.Top    = (int)(Height * 0.20);
                    VictoryScreen.Left   = (int)(Width * 0.08);
                    VictoryScreen.Show();
                }
                //el jugador ha perdido
                else
                {
                    GameOverScreen.BackgroundImage       = Resources.GameOverImg;
                    GameOverScreen.BackgroundImageLayout = ImageLayout.Stretch;
                    GameOverScreen.Height = (int)(Height * 0.5);
                    GameOverScreen.Width  = (int)(Width * 0.8);
                    GameOverScreen.Top    = (int)(Height * 0.25);
                    GameOverScreen.Left   = (int)(Width * 0.08);
                    GameOverScreen.Show();
                }

                //detener relojes
                secondsTimer.Stop();
                gameTimer.Stop();

                //guardar puntuación
                Score s = new Score(score, playahata.username);
                ScoreDAO.AddScore(s);
            }
        }
        protected override void OnUpdate()
        {
            var time = Time.deltaTime;

            for (int i = 0; i < _group.Length; i++)
            {
                var timeLeft = _group.TimeLeft[i];
                timeLeft.Seconds  -= time;
                _group.TimeLeft[i] = timeLeft;

                _timeLeft.text = ((int)timeLeft.Seconds).ToString();

                if (timeLeft.Seconds < 0)
                {
                    PostUpdateCommands.AddComponent(_group.Entities[i], new Pause());
                    PostUpdateCommands.AddComponent(_group.Entities[i], new TimeOver());
                    _gameOverScreen.Show(true);
                }
            }
        }
Example #10
0
    public void SetState(UiState state)
    {
        HideAllScreens();
        currentState = state;
        switch (currentState)
        {
        case UiState.Intro:
            introScreen.Show();
            break;

        case UiState.Session:
            hudScreen.Reset(sessionPlayer.TopScore, sessionPlayer.CurrentHealth);
            hudScreen.Show();
            break;

        case UiState.GameOver:
            gameOverScreen.SetHighscore(sessionPlayer.LastScore);
            gameOverScreen.Show();
            break;
        }
    }
Example #11
0
 public void GameOver()
 {
     if (!m_gameOver)
     {
         m_gameOver = true;
         GameSlowMo = false;
         SoundManager.Instance.BellRing(AudioSource);
         gameHUD.Hide();
         CancelInvoke();
         gameOverScreen.SetPlayerScore(scoreCounter.Points);
         if (scoreCounter.Points > GameDataManager.Instance.HighScore)
         {
             Instantiate(ResourceManager.Instance.HighScoreConfetti,
                         new Vector3(player.transform.position.x,
                                     35,
                                     0),
                         Quaternion.Euler(-90, 0, 0));
             GameDataManager.Instance.SetHighScore(scoreCounter.Points);
             SoundManager.Instance.CrowdCheer(AudioSource);
         }
         gameOverScreen.SetHighScore(GameDataManager.Instance.HighScore);
         gameOverScreen.Show();
     }
 }
Example #12
0
 void OnPlayerKilled(Player sender, int newHealth)
 {
     gameOverScreen.Show(HorderManager.Instance.CurrentWave, sender.Score);
 }
Example #13
0
 public Coroutine GameOver()
 {
     return(gameOverScreen.Show());
 }
Example #14
0
 public static void GameOver()
 {
     Toast.Show("Game Over!\nYou have lost!", Mathf.Infinity);
     GameOverScreen.Show();
     IsGameOver = true;
 }
Example #15
0
 public static void Victory()
 {
     Toast.Show("Congratulations!\nYou are victorious!", Mathf.Infinity);
     GameOverScreen.Show();
     IsGameOver = true;
 }