Exemple #1
0
        /// <summary>
        /// После того, как рыцарь и скелет проивзаимодействовали, нужно обновить их здоровье и картинки
        /// </summary>
        public async void Update_All()
        {
            skeletonsHealth.Text = Skeleton.TellHealth().ToString();
            knightsHealth.Text   = Knight.TellHealth().ToString();

            if (Skeleton.IsDead() || Knight.IsDead())

            {
                button1.Enabled = false;
                if (Skeleton.IsDead())
                {
                    MessageBox.Show("Winner Knight ", "Game Over!");
                }
                else
                {
                    MessageBox.Show("Winner Skeleton", "Game Over!");
                }
                await Task.Delay(900);

                Skeleton                 = new Fighter(skeletonPictureBox, LongSworld);
                Knight                   = new Knight(knightPictureBox, ShortSworld);
                skeletonsHealth.Text     = Skeleton.TellHealth().ToString();
                knightsHealth.Text       = Knight.TellHealth().ToString();
                skeletonAttacks.Enabled  = true;
                button1.Enabled          = true;
                skeletonPictureBox.Image = Image.FromFile(@"E:\Anton Hacker\KnightVSSkeleton-master\KnightVSSkeleton-master\Assets\Skeleton_idle.gif");
                knightPictureBox.Image   = Image.FromFile(@"E:\Anton Hacker\KnightVSSkeleton-master\KnightVSSkeleton-master\Assets\Knight_idle.gif");
            }
        }