C#C
C#11mo ago
4 replies
DDmax500

✅ Trying and learning WFO

Been messing around with toolbox and thought about making a cookie clicker type of game. Its still in the very early stages as im experimenting. But I got stuck here after multiplier does not add up.

    public partial class Form1: Form
    {
        private bool flag = false;
        private int count = 0;
        private int multiplier = 0;
        public Form1()
        {
            InitializeComponent();
        }

        public void Form1_Load(object sender, EventArgs e)
        {
            
                
        }

        public void button1_Click(object sender, EventArgs e)
        {
            if (flag == true)
            {
                count *= multiplier;
            }
            else
            { 
                count++;
            }
            label2.Text = "Count: " + count.ToString();
            label4.Text = "Multiplier: " + multiplier.ToString();
            
        }

        private void label2_Click(object sender, EventArgs e)
        {
            
        }

        private async Task button1_Click_1(object sender, EventArgs e)
        {
            if (count >= 10)
            {
                multiplier++;
                count = count - 10;
                flag = true;
            }
            else
            {
                label3.Text = "Not enough";
               
            }
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }
    }
}
Was this page helpful?