示例#1
0
    private void Update()
    {
        if (gameInProgress)  //statsSidebar

        {
            UpdateSidebar();
        }
        else
        {
            statsSidebar.gameObject.SetActive(false);
        }

        if (currentDialogInProgress == null && dialogQueue.Count >= 1)  //play next dialog

        {
            currentDialogInProgress = dialogQueue.Dequeue();

            if (currentDialogInProgress is ReadyDialog)  //TODO: Fix this shit with inheritance
            {
                ReadyDialog dialog = currentDialogInProgress as ReadyDialog;
                dialog.DoDialog();
            }
            else
            {
                GameOverDialog dialog = currentDialogInProgress as GameOverDialog;
                dialog.DoDialog();
            }
        }
    }
示例#2
0
 public GameWindowController(GameWindowView view, GameOverDialog gameOverView, GameProgressLadder gameProgressView)
 {
     _gameProgressView = gameProgressView;
     _gameOverView     = gameOverView;
     _gameView         = view;
     RandomizeQuestions();
     SubscribeToViewEvents();
 }
示例#3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
示例#4
0
        public void SendGameOver(GameState state)
        {
            RefreshGame(state);
            ClientProxyManager.Instance.RemoveGame();

            GameOverDialog dialog = new GameOverDialog(Window.GetWindow(View), state.Players);

            dialog.ShowDialog();

            NavigationService.GetNavigationService(View).Navigate(new MainMenu());
        }
    public void GameOver(bool quit = false)
    {
        EndGame();

        UserProfile.Instance.SetHighScore(level, mode);

        UserProfile.Instance.AddDiamond(level * 10);

        if (this.level > 3)
        {
            AdManager.Instance.ShowVideo();
        }

        GameOverDialog gameOverDialog = GUIManager.Instance.OnShowDialog <GameOverDialog>("Over");
    }
示例#6
0
    private void NextTurn()
    {
        Debug.Log("Next Turn");

        foreach (EnemyBehaviour enemy in FindObjectsOfType <EnemyBehaviour>())
        {
            enemy.ResetBehaviour();
        }
        PlayerController player = FindObjectOfType <PlayerController>();

        player.transform.position = player.StartPosition;

        if (playerOneLives <= 0 || playerTwoLives <= 0)
        {
            currentDialogInProgress = new GameOverDialog(4f, this);            //There shouldn't be a dialog playing already, so do an immediate game over dialog. I would dialogQueue.enqueue here but the turn changes and by the time it's dequeued it will say the wrong player has game overed... This queue system could use some polish tbh
            GameOverDialog dialog = currentDialogInProgress as GameOverDialog; //TODO change dialogs to actual classes with inheritance to avoid this bs (interface prob)
            dialog.DoDialog();
        }

        if (currentGameMode == GameMode.OnePlayer)
        {
            PlayerOneTurn = true;
        }
        else
        {
            if (PlayerOneTurn)  //switch turns
            {
                if (playerTwoLives >= 1)
                {
                    PlayerOneTurn = false;
                }
            }
            else
            {
                if (playerOneLives >= 1)
                {
                    PlayerOneTurn = true;
                }
            }
        }

        if (!HasGameEnded)
        {
            dialogQueue.Enqueue(new ReadyDialog(3f, this));
        }
    }
示例#7
0
 private void EffectOutOfMove()
 {
     SoundManager.Instance.PlaySfx(SFX.Over);
     this.panelOutOfMove.gameObject.SetActive(true);
     this.panelOutOfMove.transform.position = new Vector3(this.panelOutOfMove.transform.position.x, this.panelOutOfMove.transform.position.y + 3);
     this.panelOutOfMove.color = new Color(1f, 1f, 1f, 0f);
     this.panelOutOfMove.DOFade(1f, 0.75f);
     this.panelOutOfMove.transform.DOLocalMoveY(0, 1.5f, false);
     this.panelOutOfMove.DOFade(0f, 0.75f).SetDelay(1.5f).OnComplete(delegate
     {
         this.panelOutOfMove.gameObject.SetActive(false);
         GameOverDialog dialog = GameManager.Instance.OnShowDialog <GameOverDialog>("Over", _nScore);
         if (dialog != null)
         {
             dialog.setCallbackReplay(OnReplay);
         }
     });
 }
示例#8
0
 public void GameOver()
 {
     StopTimer();
     RemoveAllBlocks();
     CalculateWordPoint();
     if (Point > Database.Current.Player.Score.PlayerScore)
     {
         Database.Current.Player.Score.PlayerScore = Point;
         ScoreboardDialog.Update();
         NewScoreDialog.Create();
         GamePanel.Current.ShowDialog(NewScoreDialog.Current);
     }
     else
     {
         GameOverDialog.Create();
         GamePanel.Current.ShowDialog(GameOverDialog.Current);
     }
 }