コード例 #1
0
        private void AnswerClicked(object sender, EventArgs e)
        {
            var button = (Button)sender;

            answer.Text += button.Text;

            if (answer.Text == example.Answer)
            {
                points    += (1 - progressBar.Progress) * 10 * levelType.PointCoefficient;
                score.Text = points.ToString("F0");
                step++;

                if (step == 5 && levelId < 50)
                {
                    levelId++;
                    step      = 0;
                    levelType = LevelType.Get(levelId);
                }

                example       = levelType.CreateExample();
                question.Text = example.Question;
                answer.Text   = string.Empty;
                progressBar.AbortAnimation("SetProgress");
                StartAnimate();
            }
        }
コード例 #2
0
 public GamePage()
 {
     InitializeComponent();
     r         = 112;
     g         = 144;
     b         = 160;
     color     = Color.FromRgb(r, g, b);
     levelType = LevelType.Get(levelId);
     StartGame();
 }