/// <summary> /// Creates the UI elements and add them to the EntityManager. /// </summary> private void CreateUI() { var gameOver = EntitiesFactory.CreateGameOverText(); this.EntityManager.Add(gameOver); var currentScore = EntitiesFactory.CreateCurrentScore(275); currentScore.Text = this.gameScene.CurrentScore.ToString(); this.EntityManager.Add(currentScore); var bestScoreText = EntitiesFactory.CreateBestScore(395, this.gameStorage.BestScore); this.EntityManager.Add(bestScoreText); var button = EntitiesFactory.CreatePlayButton(423, 451); this.EntityManager.Add(button); button.Click += (o, e) => { var screenTransition = new CoverTransition(TimeSpan.FromSeconds(0.25), CoverTransition.EffectOptions.FromBotton) { EaseFunction = new CubicEase() { EasingMode = EasingMode.EaseInOut } }; WaveServices.ScreenContextManager.Pop(screenTransition); this.gameScene.SetState(GameScene.GameSceneStates.Gameplay); this.gameScene.Resume(); }; var background = EntitiesFactory.CreateGameOverBackground(); this.EntityManager.Add(background); }