/// <summary> /// Creates the UI elements and add them to the EntityManager. /// </summary> private void CreateUI() { var currentScore = EntitiesFactory.CreateCurrentScore(275, (int)this.VirtualScreenManager.VirtualWidth); currentScore.Text = this.finalScore.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); }; }
/// <summary> /// Creates the UI elements. /// </summary> private void CreateUI() { var button = EntitiesFactory.CreatePlayButton(404, 384); button.Click += (o, e) => { WaveServices.ScreenContextManager.Pop(); }; this.EntityManager.Add(button); var bestScoreText = EntitiesFactory.CreateBestScore(620, this.gameStorage.BestScore); this.EntityManager.Add(bestScoreText); }
/// <summary> /// Creates the UI elements. /// </summary> private void CreateUI() { var logo = EntitiesFactory.CreateLogo(); this.EntityManager.Add(logo); var button = EntitiesFactory.CreatePlayButton(404, 384); button.Click += (o, e) => { WaveServices.ScreenContextManager.Pop(); var scene = WaveServices.ScreenContextManager.FindContextByName("GameBackContext").FindScene <GameScene>(); scene.SetState(GameScene.GameSceneStates.Gameplay); }; this.EntityManager.Add(button); var bestScoreText = EntitiesFactory.CreateBestScore(620, this.gameStorage.BestScore); this.EntityManager.Add(bestScoreText); }
/// <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); }