示例#1
0
 public void EndGame()
 {
     Console.WriteLine($"Game has ended, {Turn} Won");
     isGameEnded = true;
     ShowCustomPanelEvent?.Invoke(R.end_game_title, Turn ? App.pathToCustomImageEndBlue : App.pathToCustomImageEndRed, R.end_game_legend, R.end_game_bottom_title);
     EndGameEvent?.Invoke();
 }
示例#2
0
 private void OnEndGame(EndGameEvent e)
 {
     this.endGameContainer.SetActive(true);
     this.pointsEndGameTxt.text          = string.Format("Points {0}", GameManager.Instance.GetPoints());
     this.highScorePointsEndGameTxt.text = string.Format("HighScore {0}", GameManager.Instance.GetHighScore());
     this.spaceShip.sprite = ResourceManager.Instance.GetShipSprite((Ship)StorageManager.Instance.GetInt(Env.CURRENT_SHIP_KEY, (int)Ship.green));
 }
 // Start is called before the first frame update
 void Start()
 {
     _boxSelection    = FindObjectOfType <BoxSelection>();
     _resourceManager = FindObjectOfType <ResourceManager>();
     _endGameEvent    = FindObjectOfType <EndGameEvent>();
     _sender          = GetComponent <PubSubSender>();
 }
示例#4
0
 public void OnHealthChangeEvent(int damage)
 {
     _baseHealth -= damage;
     if (_baseHealth <= 0)
     {
         EndGameEvent?.Invoke();
     }
     HealthChangeEvent?.Invoke(_baseHealth);
 }
示例#5
0
        private void OnEndGameEvent(EndGameEvent @event)
        {
            var teamScoreEvent = new TeamScoreEvent()
            {
                Score = GetTeamScore()
            };

            _eventSystem.Publish(teamScoreEvent);
        }
示例#6
0
        public void EndGameListener(EndGameEvent endGameEvent)
        {
            var wrappedEvent = new
            {
                Fraction = endGameEvent.Winner.GetComponent <Army>().Fraction,
            };

            RedirectLike(endGameEvent, wrappedEvent);
        }
示例#7
0
 private void OnEndGame(EndGameEvent e)
 {
     this.speedX        = 100;
     this.speedY        = -100;
     this.speedMultiply = 1;
     if (this.gameObject.activeInHierarchy)
     {
         this.DestroyEnemy();
     }
 }
示例#8
0
 public void TakeDamage(int damage)
 {
     TakeHeatPointEvent?.Invoke(damage);
     DamageSoundEvent?.Invoke();
     if (_health.hp <= 0)
     {
         Death();
         EndGameEvent?.Invoke();
     }
     Twinkle();
 }
示例#9
0
        public void OnEndGame()
        {
            if (_score > _best)
            {
                _best = _score;
            }

            _view?.StopGame();
            _view?.HudView.EndGameView?.Open(new EndGameController(this, _score, _best));
            EndGameEvent?.Invoke();
        }
示例#10
0
        private void OnKingTowerDead()
        {
            _view?.StopGame();

            foreach (var o in _objects.ToArray())
            {
                Destroy(o);
            }
            _objects.Clear();

            EndGameEvent?.Invoke();
        }
示例#11
0
 private void OnEndGameEvent(EndGameEvent @event)
 {
     foreach (var playerTuple in _playerMatcherGroup.MatchingEntities)
     {
         var playerScoreEvent = new PlayerScoreEvent()
         {
             PlayerEntityId     = playerTuple.Entity.Id,
             ResourceManagement = playerTuple.Component2.ResourceManagement,
             Systematicity      = playerTuple.Component2.Systematicity,
         };
         _eventSystem.Publish(playerScoreEvent);
     }
 }
示例#12
0
        private void OnPlayerDead()
        {
            _view?.StopGame();

            _view?.HudView.EndGameView?.Open(new EndGameController(this));

            foreach (var o in _objects.ToArray())
            {
                Destroy(o);
            }
            _objects.Clear();

            EndGameEvent?.Invoke();
        }
    // Start is called before the first frame update
    void Start()
    {
        PublishOilUpdate();
        PublishMoneyUpdate();
        PublishEquipmentUpdate();
        PublishEnvironmentHealthUpdate();
        PublishPublicSentimentUpdate();
        PublishOilStorageUpdate();

        PurchaseStartingOilSlick();

        _oilSlickManager = FindObjectOfType <OilSlickManager>();
        _endGameEvent    = FindObjectOfType <EndGameEvent>();
    }
示例#14
0
	private void OnEndGame(EndGameEvent endGame)
	{
		if (newHighScoreLabel != null && highScoreText != null)
		{
			newHighScoreLabel.SetActive (true);
			highScoreText.text = string.Format ("Final Score: {0}", endGame.Score);
		}

		if (newMaxHeightLabel != null && maxHeightText != null)
		{
			newMaxHeightLabel.SetActive (true);
			maxHeightText.text = string.Format ("Final Height: {0} Meters", (int)endGame.Height);
		}
	}
示例#15
0
    // Конец игры
    private static IEnumerator GameOver()
    {
        yield return(new WaitForSeconds(endGameDelayDuration));

        Instance.winPanel.SetActive(true);

        PlaySound(GetAlphabet().GameOverClip, true);

        while (Instance.audioSource.isPlaying)
        {
            yield return(null);
        }

        EndGameEvent?.Invoke();
    }
示例#16
0
    void endGame(EndGameEvent e)
    {
        Services.Audio.PlaySoundEffect(Services.Clips.GameWin, 0.6f);

        if (!isDropSpawner)
        {
            Destroy(gameObject);
        }
        else
        {
            timeBetweenSpawnsBase = .01f;
            //Debug.Log(e.gameLength+ " "+getNumEndJuiceBubbles(e.gameLength));
            StartCoroutine(resetGame(getNumEndJuiceBubbles(e.gameLength)));
        }
    }
示例#17
0
 private static void CheckWin()
 {
     if (deck.Count == 0 && (handList.Count == 0 || enemyList.Count == 0))
     {
         if (handList.Count == 0 && enemyList.Count == 0)
         {
             MessageBox.Show("Ничья", "Игра закончена", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         else if (handList.Count == 0 && enemyList.Count != 0)
         {
             MessageBox.Show("Вы выиграли", "Игра закончена", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         else if (handList.Count != 0 && enemyList.Count == 0)
         {
             MessageBox.Show("Вы проиграли", "Игра закончена", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         EndGameEvent?.Invoke();
     }
 }
示例#18
0
    private void GameEnded(EndGameEvent e)
    {
        switch (e.winner)
        {
        case Player.GhostPlayer:
            _endText.text = _ghostWinText;
            break;

        case Player.HunterPlayer:
            _endText.text = _hunterWinText;
            break;

        case Player.NoPlayer:
            _endText.text = _noPlayerWinText;
            break;
        }
        switch (e.rationale)
        {
        case EndReason.HunterCaughtGhost:
            _endTextReason.text = _hunterCaughtGhostText;
            break;

        case EndReason.GhostHauntedHouse:
            _endTextReason.text = _ghostHauntedHouseText;
            break;

        case EndReason.HunterCaughtGhostInSameBody:
            _endTextReason.text = _hunterCaughtGhostInSameBodyText;
            break;

        case EndReason.HunterCaughtInnocent:
            _endTextReason.text = _hunterCaughtInnocentText;
            break;
        }

        _gameOver = true;
        _restartMessageObject.SetActive(true);
    }
        public void StartTracking()
        {
            _isTracking = true;
            _task       = Task.Run(() =>
            {
                while (_isTracking)
                {
                    string strMessage = _bluetoothService.Bluetooth.Read();
                    if (strMessage != null && int.TryParse(strMessage, out int score))
                    {
                        int deltaScore    = score - _gameStats.Score;
                        _gameStats.Score += deltaScore;

                        _gameStats.AtomicIncrementCoins(deltaScore);
                    }
                    else if (strMessage != null && strMessage.Equals("e") && _isTracking)
                    {
                        //StopTracking();
                        EndGameEvent?.Invoke(this, false);
                    }
                }
                System.Diagnostics.Debug.Print("Score Tracking Ended");
            });
        }
示例#20
0
 public void OnEvent(EndGameEvent args)
 {
     _startWindowFactory.Create();
 }
示例#21
0
 private void onGameEndEvent(EndGameEvent e)
 {
     moving = false;
 }
示例#22
0
 public void EndGame(EndGameEvent endGameEvent)
 {
     _aIRepository.RemoveAI(Id);
 }
示例#23
0
 private void Death()
 {
     DeathEvent?.Invoke();
     EndGameEvent?.Invoke();
     _isMooving = false;
 }
示例#24
0
        public void EndGame()
        {
            Physics2D.autoSimulation = false;

            EndGameEvent?.Invoke();
        }
示例#25
0
 protected virtual void OnEndGameEvent(EndGameEventArgs e)
 {
     EndGameEvent?.Invoke(this, e);
 }
示例#26
0
 private void ReceiveEndGameUpdate(string update)
 {
     State.StatusMessage = update;
     State.GameStatus    = GameStatus.Ending;
     EndGameEvent?.Invoke(this, new EventArgs());
 }
示例#27
0
 public void EndGame()
 {
     EndGameEvent?.Invoke();
 }
示例#28
0
 void endGame(EndGameEvent e)
 {
     timeBetweenMoves.y       = .2f;
     difficultyIncreasesCount = 0;
 }
示例#29
0
 private void endGame(EndGameEvent.OnEndGame eventData)
 {
     Debug.Log("Ending the game");
     PlayerPrefs.SetInt("gameStatus", eventData.gameStatus ? 1 : 0);
     Application.LoadLevel("EndGameScene");
 }
示例#30
0
 public override void OnGameEnd(int turn, EndGameEvent ev, Player winner = null)
 {
     throw new System.NotImplementedException();
 }
示例#31
0
 void RevealRoleAtEnd(EndGameEvent e)
 {
     IsRevealed = true;
 }
示例#32
0
 public GameEvent GetEndGameEvent()
 {
     var endGameEvent = new EndGameEvent (_core.GetNewEventId(), _core);
     return endGameEvent;
 }