Esempio n. 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            //Alleen vast zetten in frame 0
            if (animationFrame == 0)
            {
                vast[0] = checkBox1.Checked; vast[1] = checkBox2.Checked;
                vast[2] = checkBox5.Checked; vast[3] = checkBox4.Checked;
                vast[4] = checkBox3.Checked;
            }

            //End of animation
            if (animationFrame > animatieLengte * (1000 / DobbelsteenTimer.Interval))
            {
                animationFrame = 0;
                rolling        = false;
                if (Dice.Count.Contains(5) && !players[curPlayer].buttons[12])
                {
                    bonus[curPlayer] += 100;
                }
                DobbelsteenTimer.Stop();
            }
            else
            {
                animationFrame++; //Increase frame
                Dice.Randomize(); //Randomize
            }
        }
Esempio n. 2
0
 private void button39_Click(object sender, EventArgs e) //Roll Dice
 {
     if (throwCount >= maximaalAantalGooien)
     {
         MessageBox.Show($"Je mag maar {maximaalAantalGooien} keer gooien", "oops"); return;
     }
     if (!rolling)
     {
         thrown       = true; throwCount++;
         rolling      = true;
         label13.Text = (maximaalAantalGooien - throwCount).ToString();
         DobbelsteenTimer.Start();
     }
 }