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

            if (skeleton.isDead() || knight.isDead())
            {
                skeletonAttacks.Enabled = false;
                button1.Enabled         = false;
                await Task.Delay(900);

                if (skeleton.isDead())
                {
                    MessageBox.Show("Winner Knight", "game over!");
                }
                else
                {
                    MessageBox.Show("Winner Skeleton", "game over!");
                }
                skeleton                   = new Skeleton(skeletonPictureBox, shortSword);
                knight                     = new Knight(knightPictureBox, longSword);
                knightsHealth.Text         = knight.TellHealth().ToString();
                skeletonsHealth.Text       = skeleton.TellHealth().ToString();
                skeletonAttacks.Enabled    = true;
                button1.Enabled            = true;
                skeletonPictureBox.Image   = Image.FromFile(@"C:\Users\User\Desktop\Nikita C#\KnightVSSkeleton-master\Assets\Skeleton_Idle.gif");
                skeletonPictureBox.Enabled = true;
                knightPictureBox.Image     = Image.FromFile(@"C:\Users\User\Desktop\Nikita C#\KnightVSSkeleton-master\Assets\Knight_Idle.gif");
                knightPictureBox.Enabled   = true;
            }
        }
Esempio n. 2
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");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// После того, как рыцарь и скелет проивзаимодействовали, нужно обновить их здоровье и картинки
        /// </summary>
        public async void Update_All()
        {
            knightsHealth.Text   = knight.TellHealth().ToString();
            skeletonsHealth.Text = skeleton.TellHealth().ToString();

            if (skeleton.isDead() || knight.isDead())
            {
                skeletonAttacks.Enabled = false;
                button1.Enabled         = false;
                await Task.Delay(900);

                if (skeleton.isDead())
                {
                    MessageBox.Show("Winner Knight", "game over!");
                }
                else
                {
                    MessageBox.Show("Winner Skeleton", "game over!");
                }
                skeleton                   = new fighter(skeletonPictureBox);
                knight                     = new Knight(knightPictureBox);
                knightsHealth.Text         = knight.TellHealth().ToString();
                skeletonsHealth.Text       = skeleton.TellHealth().ToString();
                skeletonAttacks.Enabled    = true;
                button1.Enabled            = true;
                skeletonPictureBox.Image   = Image.FromFile(@"C:\Users\Mrxmen55\Skeleton-1\Assets\Skeleton_Idle.gif");
                skeletonPictureBox.Enabled = true;
                knightPictureBox.Image     = Image.FromFile(@"C:\Users\Mrxmen55\Skeleton-1\Assets\Knight_Idle.gif");
                knightPictureBox.Enabled   = true;
            }
        }