Esempio n. 1
0
        private void Reset_button_Click(object sender, EventArgs e)
        {
            //Set images back to standing images
            SetStandingImage();

            //Set the health of the MetaHumans back to original, game on.
            Thanos.SetHealth(12);
            Captain.SetHealth(10);
            Captain.ZeroBattle();
            Thanos.ZeroBattle();

            //Update the health bars
            UpdateHealthBar();

            //Clear the attack label
            action_label.Text = "";

            //Swap buttons
            attack_button.Enabled = true;
            attack_button.Visible = true;
            reset_button.Enabled  = false;
            reset_button.Visible  = false;

            ///Change greeting label
            greeting_label.Text = "Who will win?";
        }
Esempio n. 2
0
        /// <summary>
        /// A method that starts a battle and sets the results
        /// </summary>
        public void StartBattle()
        {
            ///Calculater damage done
            Damage = Attack(Fighter1Attack, Fighter2Block);

            ///Fighter2 takes damage
            Fighter2.SetHealth(Fighter2.GetHealth() - Damage);

            ///Set the number of battles fought for fighter1
            Fighter1.SetBattlesFought();

            ///Store results of the attack
            Result = "\n" + Fighter1.Name + " does " + Damage.ToString() + " damage to " + Fighter2.Name + "\n";
        }