Exemple #1
0
        private void end()
        {
            Lock = true;
            if (p1score > p2score)
            {
                p1menang.Visible = true;
                p1kalah.Visible  = false;
                p2menang.Visible = false;
                p2kalah.Visible  = true;
            }
            else if (p1score < p2score)
            {
                p1menang.Visible = false;
                p1kalah.Visible  = true;
                p2menang.Visible = true;
                p2kalah.Visible  = false;
            }
            else
            {
                p1seri.Visible = true;
                p2seri.Visible = true;
            }
            timer1.Enabled = true;

            System.Threading.Thread.Sleep(400);
            Player.RecordScore(1, p1.Name, p2.Name, p1score, p2score);
            hs t = new hs(1);

            t.ShowDialog();
            t.BringToFront();
            t.center();
        }
Exemple #2
0
        private void end()
        {
            textBox1.Enabled = false;
            if (p1correct > p2correct)
            {
                p1menang.Visible = true;
                p2kalah.Visible  = true;
            }
            else if (p1correct < p2correct)
            {
                p1kalah.Visible  = true;
                p2menang.Visible = true;
            }
            else
            {
                p1seri.Visible = true;
                p2seri.Visible = true;
            }

            System.Threading.Thread.Sleep(400);
            Player.RecordScore(7, p1.Name, p2.Name, p1correct * 50, p2correct * 50);
            hs t = new hs(7);

            t.ShowDialog();
            t.BringToFront();
            t.center();
            timer2.Enabled = true;
        }
Exemple #3
0
        private void tmrG2_Tick(object sender, EventArgs e)
        {
            waktuMain++;
            lblSoal.Left = (this.Width / 2 - lblSoal.Width / 2);
            pp1.Text     = pointP1.ToString();
            pp2.Text     = pointP2.ToString();

            picTiraiKiri.Visible  = false;
            picTiraiKanan.Visible = false;

            if ((60 - waktuMain) >= 10)
            {
                lblDetik.Text = "00 : " + (60 - waktuMain).ToString();
            }
            else
            {
                lblDetik.Text = "00 : 0" + (60 - waktuMain).ToString();
            }

            if (waktuMain >= 60)
            {
                tmrG2.Enabled    = false;
                lblDetik.Text    = "00 : 00";
                lblSoal.Visible  = false;
                lblHasil.Visible = true;

                gambarVisible();

                if (pointP1 > pointP2)
                {
                    lblHasil.Text = "Pemain 1 Menang !";
                }
                else if (pointP2 > pointP1)
                {
                    lblHasil.Text = "Pemain 2 Menang !";
                }
                else
                {
                    lblHasil.Text = "Permainan Seri !";
                }

                System.Threading.Thread.Sleep(400);
                Player.RecordScore(2, _p1.Name, _p2.Name, pointP1, pointP2);
                hs t = new hs(2);
                t.ShowDialog();
                t.BringToFront();
                t.center();
                timer1.Enabled = true;
            }

            if (check == 0 || (jawabP1 == false && jawabP2 == false))
            {
                //System.Threading.Thread.Sleep(1000);
                tmrWait.Enabled = true;
            }
        }
Exemple #4
0
        private void tmrG5_Tick(object sender, EventArgs e)
        {
            waktuMain++;
            pp1.Text = pointP1.ToString();
            pp2.Text = pointP2.ToString();

            if ((60 - waktuMain) >= 10)
            {
                lblDetik.Text = "00 : " + (60 - waktuMain).ToString();
            }
            else
            {
                lblDetik.Text = "00 : 0" + (60 - waktuMain).ToString();
            }

            if (waktuMain >= 60 || jumlahBenarP1 >= 5 || jumlahBenarP2 >= 5)
            {
                tmrG5.Enabled    = false;
                lblDetik.Text    = "00 : 00";
                lblHasil.Visible = true;

                if (pointP1 > pointP2)
                {
                    lblHasil.Text = "Pemenang 1 Menang !";
                }
                else if (pointP2 > pointP1)
                {
                    lblHasil.Text = "Pemenang 2 Menang !";
                }
                else
                {
                    lblHasil.Text = "Permainan Seri !";
                }
                System.Threading.Thread.Sleep(4000);
                Player.RecordScore(5, p1.Name, p2.Name, pointP1, pointP2);
                hs t = new hs(5);
                t.ShowDialog();
                t.BringToFront();
                t.center();
                timer1.Enabled = true;
            }
        }
Exemple #5
0
 private void timer3_Tick(object sender, EventArgs e)
 {
     if (winner.Top > label3.Top)
     {
         winner.Top -= movefactor;
     }
     else if (winner.Left < label3.Left)
     {
         winner.Left += movefactor;
     }
     else
     {
         panel1.Visible = true;
         label1.Text    = winn.Name + " menang!";
         label1.Visible = true;
         label1.Left    = this.Width / 2 - label1.Width / 2;
         Player.RecordScore(8, p1.Name, p2.Name, p1.Score, p2.Score);
         hs d = new hs(8);
         d.ShowDialog();
         d.center();
         d.BringToFront();
         timer3.Enabled = false;
     }
 }
Exemple #6
0
        private void end()
        {
            textBox1.Enabled = false;
            timer1.Enabled   = false;
            if (p1score < p2score)
            {
                p1kalah.Visible  = true;
                p2menang.Visible = true;
                p1score         += 200;
            }
            else if (p1score > p2score)
            {
                p1menang.Visible = true;
                p2kalah.Visible  = true;
                p2score         += 100;
            }
            else
            {
                p2seri.Visible = true;
                p1seri.Visible = true;
                p1score       += 50;
                p2score       += 50;
            }

            label7.Text = "Skor: " + p1score.ToString();
            label8.Text = "Skor: " + p2score.ToString();

            System.Threading.Thread.Sleep(400);
            Player.RecordScore(4, p1.Name, p2.Name, p1score, p2score);
            hs t = new hs(4);

            t.ShowDialog();
            t.BringToFront();
            t.center();
            timer2.Enabled = true;
        }
        private void tmrG6_Tick(object sender, EventArgs e)
        {
            waktuMain++;
            pp1.Text = pointP1.ToString();
            pp2.Text = pointP2.ToString();

            if ((60 - waktuMain) >= 10)
            {
                lblDetik.Text = "00 : " + (60 - waktuMain).ToString();
            }
            else
            {
                lblDetik.Text = "00 : 0" + (60 - waktuMain).ToString();
            }

            if (waktuMain >= 60 || jumlahTotalBenarP1 == 5 || jumlahTotalBenarP2 == 5)
            {
                tmrG6.Enabled = false;
                lblDetik.Text = "00 : 00";

                lblSoal1.Visible = false;
                label1.Visible   = false;

                lblSoal2.Visible = false;
                label8.Visible   = false;

                /*
                 * label3.Parent = picTirai1Ke2;
                 * label7.Parent = picTirai2Ke2;
                 * label2.Parent = picTirai2Ke2;
                 * lblDetik.Parent = picTirai2Ke2;
                 */
                picP1Angka1.Visible  = false;
                picP1Angka2.Visible  = false;
                picP1Angka3.Visible  = false;
                picP1Angka4.Visible  = false;
                picTirai1Ke2.Visible = false;

                picP2Angka1.Visible  = false;
                picP2Angka2.Visible  = false;
                picP2Angka3.Visible  = false;
                picP2Angka4.Visible  = false;
                picTirai2Ke2.Visible = false;

                lblHasil.Visible = true;

                if (pointP1 > pointP2)
                {
                    lblHasil.Text = "Pemain 1 Menang !";
                }
                else if (pointP2 > pointP1)
                {
                    lblHasil.Text = "Pemain 2 Menang !";
                }
                else
                {
                    lblHasil.Text = "Permainan Seri !";
                }

                System.Threading.Thread.Sleep(400);
                Player.RecordScore(6, p1.Name, p2.Name, pointP1, pointP2);
                hs t = new hs(6);
                t.ShowDialog();
                t.BringToFront();
                t.center();
                timer1.Enabled = true;
            }
        }