/// <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 fighter(knightPictureBox); 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; } }
public MainForm() { InitializeComponent(); knight = new fighter(knightPictureBox); skeleton = new fighter(skeletonPictureBox); }
public MainForm() { InitializeComponent(); knight = new Knight(knightPictureBox, shortSword); skeleton = new Skeleton(skeletonPictureBox, longSword); }