Пример #1
0
        private void BeginGame(GameState gameState)
        {
            var gameScene = bbxFactory.CreateGameScene(gameState);

            scenes.Clear();
            scenes.Add(gameScene);

            gameScene.Pause         += Pause;
            gameScene.StageComplete += () => StageComplete(gameState, gameScene);
            gameScene.SceneEnd      += (_, __) =>
            {
                if (highscores.IsNewHighscore(gameState.Score))
                {
                    NewHighscoreScene newHighscoreScene = bbxFactory.CreateNewHighscoreScene();

                    newHighscoreScene.NewScore = gameState.Score;

                    scenes.Add(newHighscoreScene);

                    newHighscoreScene.SceneEnd += (sender, e) => Reset();
                }
                else
                {
                    Reset();
                }
            };
        }