예제 #1
0
파일: Form1.cs 프로젝트: Raman227/FireGame
        private void Button4_Click(object sender, EventArgs e)
        {
            // count the clik and then generate the sound of the bulllet
            clk++;
            instance_obj.frstchance();


            instance.fire(pictureBox1);

            if (rd == clk)
            {
                MessageBox.Show("Shooted: You are dead ");
                Application.Restart();
            }
            else
            {
                MessageBox.Show("Shoot missed: you are alive  ");
            }

            // when we click four times then the trigger is automatically disabled
            if (clk == 4)
            {
                MessageBox.Show("your chance is over now ");
                btnFire.Enabled = false;
            }

            if (clk == 4 && clk2 == 2)
            {
                Application.Restart();
            }
        }
예제 #2
0
        private void Button4_Click(object sender, EventArgs e)
        {
            // count the clik and then generate the sound of the bulllet
            clk++;
            sht++;

            instance_obj.frstchance();


            instance.fire(pictureBox1);

            if (rd == sht)
            {
                MessageBox.Show("Shooted: You are dead ");
                Application.Restart();
            }
            else
            {
                MessageBox.Show("Shoot missed: you are alive  ");
            }



            // when we click six times then the trigger is automatically disabled
            if (sht == 6)
            {
                MessageBox.Show("you survived ");
                Application.Restart();
            }
        }