Ejemplo n.º 1
0
        public void AddPauseScreen()
        {
            var pauseScreen = new PauseScreen(Context);
            var sil1 = new SimpleGraphic(Assets.PlayerSilhouette, 250, 75, 480, 588);
            var sil2 = new SimpleGraphic(Assets.PlayerSilhouette, 650, 75, 480, 588);
            pauseScreen.AddEntity(sil1);
            pauseScreen.AddEntity(sil2);
            pauseScreen.WaitForPlayerCount(NeededPlayerCount);

            Manager.AddScreen(pauseScreen);
        }
Ejemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (!PlayerOne.IsReady || !PlayerTwo.IsReady) {
                AddPauseScreen();
            }

            if (!Ended) {
                if (MainClock.Value <= 0f) {
                    EndGame();
                }
            }

            if (paused) {
                var ps = new PauseScreen(Context);
                ps.Pause();

                Manager.AddScreen(ps);

                paused = false;
            }
        }