예제 #1
0
        private int IncreaseSpeedCount; // промежуточная переменная для хранения счетчика увеличения скорости

        #endregion Fields

        #region Constructors

        // конструктор класса - действия, которые осуществляются при его создании (инициализации)
        public Player(GameProcess importGameProcess)
        {
            // координаты создания - в левой части экрана
            X = 50;
            Y = 200;
            Lives = 5;
            Direction = 1; // направление движения устанавливаем "вправо"
            Angle = 0; // начальный угол равен 0 градусов
            Speed = 160f; // начальная скорость (потом можно изменить)
            GameProcess = importGameProcess; // установка обратной связи с игровым процессом
        }
예제 #2
0
 private int IncreaseSpeedCount; // промежуточная переменная для хранения счетчика увеличения скорости
 // конструктор класса - действия, которые осуществляются при его создании (инициализации)
 public Player(GameProcess importGameProcess)
 {
     // координаты создания - в левой части экрана
     X           = 50;
     Y           = 200;
     Lives       = 5;
     Direction   = 1;                 // направление движения устанавливаем "вправо"
     Angle       = 0;                 // начальный угол равен 0 градусов
     Speed       = 160f;              // начальная скорость (потом можно изменить)
     GameProcess = importGameProcess; // установка обратной связи с игровым процессом
 }
예제 #3
0
        // отрисовка визуальных объектов (выполняется в каждый конкретный момент времени)
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.AliceBlue); // заполнить фон
            SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); // установить последовательный порядок отрисовки объектов

            if (SplashShown)
            {
                if (SplashHide)
                {
                    LoadData(Language); // загрузка данных (текстур, звуков, шрифта)
                    SplashShown = false;
                    SplashHide = true;
                }
                else
                {
                    SplashHide = true;
                }
                SpriteBatch.Draw(Splash, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                 new Rectangle(0, 0, Splash.Width, Splash.Height),
                                 Color.White, 0,
                                 new Vector2(0, 0), Dx, SpriteEffects.None, 0);
            }
            else
            {
                if (GameProcess.IsGame)
                {
                    // если происходит игровой процесс - отрисовка игрового процесса
                    if (!GameProcess.IsPause)
                    {
                        // если пауза выключена
                        SpriteBatch.Draw(TextureBackground, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackground.Width, TextureBackground.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0); // отрисовка фона
                        foreach (var enemy in GameProcess.Enemies)
                        {
                            // отрисовка целей
                            SpriteBatch.Draw(TextureTarget,
                                             new Vector2(AbsoluteX(enemy.Screenpos.X), AbsoluteY(enemy.Screenpos.Y)),
                                             new Rectangle(0, 0, TextureTarget.Width, TextureTarget.Height), Color.White,
                                             0, new Vector2(TextureTarget.Width/2f, TextureTarget.Height/2f), 1*Dx,
                                             SpriteEffects.None, 0);

                        }
                        // отрисовка игрока
                        if (Player.Direction == 2)
                            SpriteBatch.Draw(TexturePlayerBack, new Vector2(AbsoluteX(Player.X), AbsoluteY(Player.Y)),
                                             new Rectangle(0, 0, TexturePlayerBack.Width, TexturePlayerBack.Height),
                                             Color.White,
                                             Player.Angle,
                                             new Vector2(TexturePlayerBack.Width/2f, TexturePlayerBack.Height/2f), 1*Dx,
                                             SpriteEffects.None, 0);
                            // отраженный вариант (движени влево)
                        else
                            SpriteBatch.Draw(TexturePlayer, new Vector2(AbsoluteX(Player.X), AbsoluteY(Player.Y)),
                                             new Rectangle(0, 0, TexturePlayer.Width, TexturePlayer.Height), Color.White,
                                             Player.Angle,
                                             new Vector2(TexturePlayerBack.Width/2f, TexturePlayerBack.Height/2f), 1*Dx,
                                             SpriteEffects.None, 0);
                        // обычный вариант (вправо/вверх/вниз)
                        foreach (var badenemy in GameProcess.BadEnemies)
                        {
                            SpriteBatch.Draw(TextureTargetBad,
                                             new Vector2(AbsoluteX(badenemy.Screenpos.X),
                                                         AbsoluteY(badenemy.Screenpos.Y)),
                                             new Rectangle(0, 0, TextureTargetBad.Width, TextureTargetBad.Height),
                                             Color.White,
                                             badenemy.Rotation, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        }
                        // отрисовка колючек по краям экрана
                        SpriteBatch.Draw(TextureBorder, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBorder.Width, TextureBorder.Height), Color.White,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        // отрисовка числа очков
                        SpriteBatch.DrawString(Font,
                                               strRecord + GameProcess.MaxScore.ToString(CultureInfo.InvariantCulture),
                                               new Vector2(20, 60),
                                               Color.White, 0, new Vector2(0, 0), 0.8f*Dx, SpriteEffects.None, 0);
                        SpriteBatch.DrawString(Font,
                                               strScoreAmount + GameProcess.Score.ToString(CultureInfo.InvariantCulture),
                                               new Vector2(20, 10),
                                               GameProcess.Score <= GameProcess.MaxScore
                                                   ? Color.White
                                                   : new Color(66, 160, 208), 0,
                                               new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        // отрисовка жизней
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(690), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 1 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(743), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 2 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(793), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 3 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(845), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 4 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(896), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 5 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);

                        // обработка действий целей ("false" означает, что ускорение выключено)
                        foreach (var enemy in GameProcess.Enemies)
                            enemy.Process(false, gameTime);
                        // обработка действий шестеренок ("true" означает, что включено ускорение)
                        foreach (var badenemy in GameProcess.BadEnemies)
                            badenemy.Process(true, gameTime);
                        Player.Process(gameTime); // обработка движения игрока
                        Player.WorkWithTarget(); // обработка работы с целями
                        // обработка управления движением
                        // вверх
                        ButtonUp.Process(SpriteBatch);
                        ButtonUp.Update(90, 205);
                        if (ButtonUp.IsEnabled)
                        {
                            ButtonUp.Reset();
                            Player.Direction = 3;
                        }
                        // вниз
                        ButtonDown.Process(SpriteBatch);
                        ButtonDown.Update(90, 430);
                        if (ButtonDown.IsEnabled)
                        {
                            ButtonDown.Reset();
                            Player.Direction = 4;
                        }
                        // влево
                        ButtonLeft.Process(SpriteBatch);
                        ButtonLeft.Update(18, 312);
                        if (ButtonLeft.IsEnabled)
                        {
                            ButtonLeft.Reset();
                            Player.Direction = 2;
                        }
                        // вправо
                        ButtonRight.Process(SpriteBatch);
                        ButtonRight.Update(175, 312);
                        if (ButtonRight.IsEnabled)
                        {
                            Player.Direction = 1;
                            ButtonRight.Reset();
                        }
                        // пауза
                        ButtonPause.Process(SpriteBatch);
                        ButtonPause.Update(830, 484);
                        if (ButtonPause.IsEnabled)
                        {
                            ButtonPause.Reset();
                            GameProcess.IsPause = true;
                        }
                    }
                    else
                    {
                        // если пауза включена
                        SpriteBatch.Draw(TextureBackgroundLoad, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackgroundLoad.Width, TextureBackgroundLoad.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);

                        SpriteBatch.DrawString(Font,
                                               "Пауза",
                                               new Vector2(AbsoluteX(420), AbsoluteY(1175)),
                                               Color.White, 0, new Vector2(0, 0), 1.5f*Dx, SpriteEffects.None, 0);
                        // продолжить
                        ButtonResumeGame.Process(SpriteBatch);
                        ButtonResumeGame.Update(328, 351);
                        if (ButtonResumeGame.IsEnabled)
                        {
                            ButtonResumeGame.Reset();
                            GameProcess.IsPause = false;
                        }
                        // начать новую игру
                        ButtonStartNewGame.Process(SpriteBatch);
                        ButtonStartNewGame.Update(320, 420);
                        if (ButtonStartNewGame.IsEnabled)
                        {
                            ButtonStartNewGame.Reset();
                            GameProcess = new GameProcess();
                            GameProcess.IsGame = true;
                            Player = new Player(GameProcess);
                        }
                        // выход
                        ButtonExit.Process(SpriteBatch);
                        ButtonExit.Update(320, 483);
                        if (ButtonExit.IsEnabled)
                        {
                            ButtonExit.Reset();
                            Exit();
                        }
                        // посетить сайт
                        ButtonVisitSite.Process(SpriteBatch);
                        ButtonVisitSite.Update(741, 475);
                        if (ButtonVisitSite.IsEnabled)
                        {
                            ButtonVisitSite.Reset();
                            var uri = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                            var intent = new Intent(Intent.ActionView, uri);
                            Activity.StartActivity(intent);
                        }
                    }
                }
                else
                {
                    if (GameProcess.IsLose)
                    {
                        // отрисовка меню поражения
                        SpriteBatch.Draw(TextureBackgroundLose, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackgroundLose.Width, TextureBackgroundLose.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        SpriteBatch.DrawString(Font,
                                               strRecordString +
                                               GameProcess.MaxScore.ToString(CultureInfo.InvariantCulture) +
                                               strRecordNotReached,
                                               new Vector2(AbsoluteX(350), AbsoluteY(252)),
                                               Color.White, 0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                        if (Player.Lives == 5)
                            SpriteBatch.DrawString(Font, strPacmanInjured,
                                                   new Vector2(AbsoluteX(258), AbsoluteY(278)),
                                                   Color.White, 0, new Vector2(0, 0), 1.2f*Dx, SpriteEffects.None, 0);
                        // сыграть заново
                        ButtonReplay.Process(SpriteBatch);
                        ButtonReplay.Update(330, 355);
                        if (ButtonReplay.IsEnabled)
                        {
                            ButtonReplay.Reset();
                            GameProcess = new GameProcess();
                            GameProcess.IsGame = true;
                            Player = new Player(GameProcess);
                        }
                    }
                    else
                    {
                        if (GameProcess.IsWin)
                        {
                            // отрисовка меню победы
                            SpriteBatch.Draw(TextureBackgroundWin, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                             new Rectangle(0, 0, TextureBackgroundWin.Width, TextureBackgroundWin.Height),
                                             Color.White,
                                             0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                            SpriteBatch.DrawString(Font,
                                                   strNewRecord +
                                                   GameProcess.Score.ToString(CultureInfo.InvariantCulture) + "!",
                                                   new Vector2(AbsoluteX(350), AbsoluteY(252)),
                                                   Color.White, 0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                            // начать новую игру
                            ButtonStartNewGame.Process(SpriteBatch);
                            ButtonStartNewGame.Update(320, 320);
                            if (ButtonStartNewGame.IsEnabled)
                            {
                                ButtonStartNewGame.Reset();
                                GameProcess = new GameProcess();
                                GameProcess.IsGame = true;
                                Player = new Player(GameProcess);
                            }
                            // выйти
                            ButtonExit.Process(SpriteBatch);
                            ButtonExit.Update(332, 395);
                            if (ButtonExit.IsEnabled)
                            {
                                ButtonExit.Reset();
                                Exit();
                            }
                            // посетить сайт
                            ButtonVisitSite.Process(SpriteBatch);
                            ButtonVisitSite.Update(380, 180);
                            if (ButtonVisitSite.IsEnabled)
                            {
                                ButtonVisitSite.Reset();
                                var uri = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                                var intent = new Intent(Intent.ActionView, uri);
                                Activity.StartActivity(intent);
                            }
                        }
                        else
                        {
                            // отрисовать стартовый экран игры
                            SpriteBatch.Draw(TextureBackgroundLoad, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                             new Rectangle(0, 0, TextureBackgroundLoad.Width,
                                                           TextureBackgroundLoad.Height),
                                             Color.White,
                                             0, new Vector2(0, 0), 1*Dx, SpriteEffects.None, 0);
                            // начать новую игру
                            ButtonNewGame.Process(SpriteBatch);
                            ButtonNewGame.Update(330, 455);
                            if (ButtonNewGame.IsEnabled)
                            {
                                ButtonNewGame.Reset();
                                GameProcess = new GameProcess();
                                GameProcess.IsGame = true;
                                Player = new Player(GameProcess);
                            }
                            // посетить сайт
                            ButtonVisitSite.Process(SpriteBatch);
                            ButtonVisitSite.Update(741, 475);
                            if (ButtonVisitSite.IsEnabled)
                            {
                                ButtonVisitSite.Reset();
                                var uri = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                                var intent = new Intent(Intent.ActionView, uri);
                                Activity.StartActivity(intent);
                            }
                        }
                    }
                }
                // отрисовать рамки
                DrawRectangle(
                    new Rectangle(-100, -100, CurrentWidth + 100 + 100, 100 + (int) deltaY),
                    Color.Black);
                DrawRectangle(
                    new Rectangle(-100, CurrentHeigth - (int) deltaY, CurrentWidth + 100 + 100,
                                  (int) deltaY + (int) deltaY_1 + 100), Color.Black);
            }
            SpriteBatch.End(); // прервать отрисовку на данном этапе
            base.Draw(gameTime); // обновить счетчик игрового времени
        }
예제 #4
0
        // отрисовка визуальных объектов (выполняется в каждый конкретный момент времени)
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.AliceBlue);                                   // заполнить фон
            SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); // установить последовательный порядок отрисовки объектов

            if (SplashShown)
            {
                if (SplashHide)
                {
                    LoadData(Language); // загрузка данных (текстур, звуков, шрифта)
                    SplashShown = false;
                    SplashHide  = true;
                }
                else
                {
                    SplashHide = true;
                }
                SpriteBatch.Draw(Splash, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                 new Rectangle(0, 0, Splash.Width, Splash.Height),
                                 Color.White, 0,
                                 new Vector2(0, 0), Dx, SpriteEffects.None, 0);
            }
            else
            {
                if (GameProcess.IsGame)
                {
                    // если происходит игровой процесс - отрисовка игрового процесса
                    if (!GameProcess.IsPause)
                    {
                        // если пауза выключена
                        SpriteBatch.Draw(TextureBackground, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackground.Width, TextureBackground.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0); // отрисовка фона
                        foreach (var enemy in GameProcess.Enemies)
                        {
                            // отрисовка целей
                            SpriteBatch.Draw(TextureTarget,
                                             new Vector2(AbsoluteX(enemy.Screenpos.X), AbsoluteY(enemy.Screenpos.Y)),
                                             new Rectangle(0, 0, TextureTarget.Width, TextureTarget.Height), Color.White,
                                             0, new Vector2(TextureTarget.Width / 2f, TextureTarget.Height / 2f), 1 * Dx,
                                             SpriteEffects.None, 0);
                        }
                        // отрисовка игрока
                        if (Player.Direction == 2)
                        {
                            SpriteBatch.Draw(TexturePlayerBack, new Vector2(AbsoluteX(Player.X), AbsoluteY(Player.Y)),
                                             new Rectangle(0, 0, TexturePlayerBack.Width, TexturePlayerBack.Height),
                                             Color.White,
                                             Player.Angle,
                                             new Vector2(TexturePlayerBack.Width / 2f, TexturePlayerBack.Height / 2f), 1 * Dx,
                                             SpriteEffects.None, 0);
                        }
                        // отраженный вариант (движени влево)
                        else
                        {
                            SpriteBatch.Draw(TexturePlayer, new Vector2(AbsoluteX(Player.X), AbsoluteY(Player.Y)),
                                             new Rectangle(0, 0, TexturePlayer.Width, TexturePlayer.Height), Color.White,
                                             Player.Angle,
                                             new Vector2(TexturePlayerBack.Width / 2f, TexturePlayerBack.Height / 2f), 1 * Dx,
                                             SpriteEffects.None, 0);
                        }
                        // обычный вариант (вправо/вверх/вниз)
                        foreach (var badenemy in GameProcess.BadEnemies)
                        {
                            SpriteBatch.Draw(TextureTargetBad,
                                             new Vector2(AbsoluteX(badenemy.Screenpos.X),
                                                         AbsoluteY(badenemy.Screenpos.Y)),
                                             new Rectangle(0, 0, TextureTargetBad.Width, TextureTargetBad.Height),
                                             Color.White,
                                             badenemy.Rotation, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        }
                        // отрисовка колючек по краям экрана
                        SpriteBatch.Draw(TextureBorder, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBorder.Width, TextureBorder.Height), Color.White,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        // отрисовка числа очков
                        SpriteBatch.DrawString(Font,
                                               strRecord + GameProcess.MaxScore.ToString(CultureInfo.InvariantCulture),
                                               new Vector2(20, 60),
                                               Color.White, 0, new Vector2(0, 0), 0.8f * Dx, SpriteEffects.None, 0);
                        SpriteBatch.DrawString(Font,
                                               strScoreAmount + GameProcess.Score.ToString(CultureInfo.InvariantCulture),
                                               new Vector2(20, 10),
                                               GameProcess.Score <= GameProcess.MaxScore
                                                   ? Color.White
                                                   : new Color(66, 160, 208), 0,
                                               new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        // отрисовка жизней
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(690), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 1 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(743), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 2 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(793), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 3 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(845), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 4 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        SpriteBatch.Draw(TextureCross, new Vector2(AbsoluteX(896), AbsoluteY(15)),
                                         new Rectangle(0, 0, TextureCross.Width, TextureCross.Height),
                                         Player.Lives >= 5 ? Color.White : Color.Red,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);

                        // обработка действий целей ("false" означает, что ускорение выключено)
                        foreach (var enemy in GameProcess.Enemies)
                        {
                            enemy.Process(false, gameTime);
                        }
                        // обработка действий шестеренок ("true" означает, что включено ускорение)
                        foreach (var badenemy in GameProcess.BadEnemies)
                        {
                            badenemy.Process(true, gameTime);
                        }
                        Player.Process(gameTime); // обработка движения игрока
                        Player.WorkWithTarget();  // обработка работы с целями
                        // обработка управления движением
                        // вверх
                        ButtonUp.Process(SpriteBatch);
                        ButtonUp.Update(90, 205);
                        if (ButtonUp.IsEnabled)
                        {
                            ButtonUp.Reset();
                            Player.Direction = 3;
                        }
                        // вниз
                        ButtonDown.Process(SpriteBatch);
                        ButtonDown.Update(90, 430);
                        if (ButtonDown.IsEnabled)
                        {
                            ButtonDown.Reset();
                            Player.Direction = 4;
                        }
                        // влево
                        ButtonLeft.Process(SpriteBatch);
                        ButtonLeft.Update(18, 312);
                        if (ButtonLeft.IsEnabled)
                        {
                            ButtonLeft.Reset();
                            Player.Direction = 2;
                        }
                        // вправо
                        ButtonRight.Process(SpriteBatch);
                        ButtonRight.Update(175, 312);
                        if (ButtonRight.IsEnabled)
                        {
                            Player.Direction = 1;
                            ButtonRight.Reset();
                        }
                        // пауза
                        ButtonPause.Process(SpriteBatch);
                        ButtonPause.Update(830, 484);
                        if (ButtonPause.IsEnabled)
                        {
                            ButtonPause.Reset();
                            GameProcess.IsPause = true;
                        }
                    }
                    else
                    {
                        // если пауза включена
                        SpriteBatch.Draw(TextureBackgroundLoad, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackgroundLoad.Width, TextureBackgroundLoad.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);

                        SpriteBatch.DrawString(Font,
                                               "Пауза",
                                               new Vector2(AbsoluteX(420), AbsoluteY(1175)),
                                               Color.White, 0, new Vector2(0, 0), 1.5f * Dx, SpriteEffects.None, 0);
                        // продолжить
                        ButtonResumeGame.Process(SpriteBatch);
                        ButtonResumeGame.Update(328, 351);
                        if (ButtonResumeGame.IsEnabled)
                        {
                            ButtonResumeGame.Reset();
                            GameProcess.IsPause = false;
                        }
                        // начать новую игру
                        ButtonStartNewGame.Process(SpriteBatch);
                        ButtonStartNewGame.Update(320, 420);
                        if (ButtonStartNewGame.IsEnabled)
                        {
                            ButtonStartNewGame.Reset();
                            GameProcess        = new GameProcess();
                            GameProcess.IsGame = true;
                            Player             = new Player(GameProcess);
                        }
                        // выход
                        ButtonExit.Process(SpriteBatch);
                        ButtonExit.Update(320, 483);
                        if (ButtonExit.IsEnabled)
                        {
                            ButtonExit.Reset();
                            Exit();
                        }
                        // посетить сайт
                        ButtonVisitSite.Process(SpriteBatch);
                        ButtonVisitSite.Update(741, 475);
                        if (ButtonVisitSite.IsEnabled)
                        {
                            ButtonVisitSite.Reset();
                            var uri    = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                            var intent = new Intent(Intent.ActionView, uri);
                            Activity.StartActivity(intent);
                        }
                    }
                }
                else
                {
                    if (GameProcess.IsLose)
                    {
                        // отрисовка меню поражения
                        SpriteBatch.Draw(TextureBackgroundLose, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                         new Rectangle(0, 0, TextureBackgroundLose.Width, TextureBackgroundLose.Height),
                                         Color.White,
                                         0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        SpriteBatch.DrawString(Font,
                                               strRecordString +
                                               GameProcess.MaxScore.ToString(CultureInfo.InvariantCulture) +
                                               strRecordNotReached,
                                               new Vector2(AbsoluteX(350), AbsoluteY(252)),
                                               Color.White, 0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                        if (Player.Lives == 5)
                        {
                            SpriteBatch.DrawString(Font, strPacmanInjured,
                                                   new Vector2(AbsoluteX(258), AbsoluteY(278)),
                                                   Color.White, 0, new Vector2(0, 0), 1.2f * Dx, SpriteEffects.None, 0);
                        }
                        // сыграть заново
                        ButtonReplay.Process(SpriteBatch);
                        ButtonReplay.Update(330, 355);
                        if (ButtonReplay.IsEnabled)
                        {
                            ButtonReplay.Reset();
                            GameProcess        = new GameProcess();
                            GameProcess.IsGame = true;
                            Player             = new Player(GameProcess);
                        }
                    }
                    else
                    {
                        if (GameProcess.IsWin)
                        {
                            // отрисовка меню победы
                            SpriteBatch.Draw(TextureBackgroundWin, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                             new Rectangle(0, 0, TextureBackgroundWin.Width, TextureBackgroundWin.Height),
                                             Color.White,
                                             0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                            SpriteBatch.DrawString(Font,
                                                   strNewRecord +
                                                   GameProcess.Score.ToString(CultureInfo.InvariantCulture) + "!",
                                                   new Vector2(AbsoluteX(350), AbsoluteY(252)),
                                                   Color.White, 0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                            // начать новую игру
                            ButtonStartNewGame.Process(SpriteBatch);
                            ButtonStartNewGame.Update(320, 320);
                            if (ButtonStartNewGame.IsEnabled)
                            {
                                ButtonStartNewGame.Reset();
                                GameProcess        = new GameProcess();
                                GameProcess.IsGame = true;
                                Player             = new Player(GameProcess);
                            }
                            // выйти
                            ButtonExit.Process(SpriteBatch);
                            ButtonExit.Update(332, 395);
                            if (ButtonExit.IsEnabled)
                            {
                                ButtonExit.Reset();
                                Exit();
                            }
                            // посетить сайт
                            ButtonVisitSite.Process(SpriteBatch);
                            ButtonVisitSite.Update(380, 180);
                            if (ButtonVisitSite.IsEnabled)
                            {
                                ButtonVisitSite.Reset();
                                var uri    = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                                var intent = new Intent(Intent.ActionView, uri);
                                Activity.StartActivity(intent);
                            }
                        }
                        else
                        {
                            // отрисовать стартовый экран игры
                            SpriteBatch.Draw(TextureBackgroundLoad, new Vector2(AbsoluteX(0), AbsoluteY(0)),
                                             new Rectangle(0, 0, TextureBackgroundLoad.Width,
                                                           TextureBackgroundLoad.Height),
                                             Color.White,
                                             0, new Vector2(0, 0), 1 * Dx, SpriteEffects.None, 0);
                            // начать новую игру
                            ButtonNewGame.Process(SpriteBatch);
                            ButtonNewGame.Update(330, 455);
                            if (ButtonNewGame.IsEnabled)
                            {
                                ButtonNewGame.Reset();
                                GameProcess        = new GameProcess();
                                GameProcess.IsGame = true;
                                Player             = new Player(GameProcess);
                            }
                            // посетить сайт
                            ButtonVisitSite.Process(SpriteBatch);
                            ButtonVisitSite.Update(741, 475);
                            if (ButtonVisitSite.IsEnabled)
                            {
                                ButtonVisitSite.Reset();
                                var uri    = Android.Net.Uri.Parse("http://www.dageron.com/?cat=146");
                                var intent = new Intent(Intent.ActionView, uri);
                                Activity.StartActivity(intent);
                            }
                        }
                    }
                }
                // отрисовать рамки
                DrawRectangle(
                    new Rectangle(-100, -100, CurrentWidth + 100 + 100, 100 + (int)deltaY),
                    Color.Black);
                DrawRectangle(
                    new Rectangle(-100, CurrentHeigth - (int)deltaY, CurrentWidth + 100 + 100,
                                  (int)deltaY + (int)deltaY_1 + 100), Color.Black);
            }
            SpriteBatch.End();   // прервать отрисовку на данном этапе
            base.Draw(gameTime); // обновить счетчик игрового времени
        }