コード例 #1
0
        private void timer_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < WORLD_HEIGHT; i++)
            {
                for (int j = 0; j < WORLD_WIDTH; j++)
                {
                    if (pacman.X == j * Pacman.Radius * 2 && pacman.Y == i * Pacman.Radius * 2)
                    {
                        if (foodWorld[i][j] == true)
                        {
                            textBox1.Text = Poeni++.ToString();
                            PB1.PerformStep();
                            if (Poeni == 149)
                            {
                                DialogResult rez = MessageBox.Show("Nova igra?", "Kraj", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                                if (rez == DialogResult.No)
                                {
                                    this.Close();
                                }
                                else
                                {
                                    newGame();
                                    Poeni     = 0;
                                    PB1.Value = 0;
                                }
                            }
                        }
                        foodWorld[i][j] = false;
                    }
                }
            }

            pacman.Move(this.Width, this.Height);
            Invalidate();
        }
コード例 #2
0
 //Timer Coding end...
 private void Btn1_Click(object sender, EventArgs e)
 {
     TimerCode1();
     PB1.BringToFront();
     LblTarget.Text      = "Full body";
     LblDiscription.Text = "Stand with feet hip-width apart. Jump feet open as you raise arms to form an X shape.\nJump feet back together as you lower arms to your sides.";
     LblLink.Text        = "https://www.youtube.com/watch?v=c4DAnQ6DtF8";
     pictureBox1.Visible = false;
     //Thread.Sleep(500);
     //Btn2.PerformClick();
 }
コード例 #3
0
ファイル: FormPic.cs プロジェクト: swalder44/AVGK
 private void Draw()
 {
     if (PB1.Image != null)
     {
         using (Graphics Gr = Graphics.FromImage(PB1.Image))
         {
             Gr.Clear(Color.Black);
             Gr.DrawImage(PB2.Image, X0, Y0, PB2.Image.Width * Scl, PB2.Image.Height * Scl);
             PB1.Refresh();
         }
     }
 }
コード例 #4
0
ファイル: FormPic.cs プロジェクト: swalder44/AVGK
        public FormPic(Image data)
        {
            InitializeComponent();
            PB1.MouseWheel += new System.Windows.Forms.MouseEventHandler(PB1_MouseWheel);
            PB1.Image       = data; //.Width, FormDetals.SelfRef.bin.Height) ;
            PB2.Image       = data; //.Width, FormDetals.SelfRef.bin.Height);
            PB1.Refresh();

            //this.button1.Click += new System.EventHandler(this.button_Click);
            //this.button2.Click += new System.EventHandler(this.button_Click);
            //this.FormClosing += new FormClosingEventHandler(Form2Closing);
        }
コード例 #5
0
ファイル: NiblackForm.cs プロジェクト: Sje-csapat/Nib
 private void OpenBut_Click(object sender, EventArgs e)
 {
     using (OpenFileDialog openFileDialog = new OpenFileDialog())
     {
         openFileDialog.Filter           = "Csak képfájlok: (*.bmp, *.jpeg, *.png)|*.bmp;*.jpeg;*.png";
         openFileDialog.FilterIndex      = 2;
         openFileDialog.RestoreDirectory = true;
         if (openFileDialog.ShowDialog() == DialogResult.OK)
         {
             VerifiedImage = new Bitmap(openFileDialog.FileName);
             PoB1.Maximum  = VerifiedImage.Width;
             PoB1.Value    = 0;
             PB1.Size      = VerifiedImage.Size;
             PB1.Image     = VerifiedImage;
             PB1.Show();
             fLP1.AutoScroll = true;
         }
     }
 }
コード例 #6
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Stop();

            PB1.Hide();
            PB2.Hide();
            PB3.Hide();
            PB4.Hide();
            PB5.Hide();
            PB6.Hide();
            PB7.Hide();
            PB8.Hide();
            PB9.Hide();
            PB10.Hide();
            PB11.Hide();
            PB12.Hide();

            ALbl.Hide();
            BLbl.Hide();
            CLbl.Hide();
            DLbl.Hide();
            ELbl.Hide();
            FLbl.Hide();
            GLbl.Hide();
            HLbl.Hide();
            ILbl.Hide();
            JLbl.Hide();
            KLbl.Hide();
            LLbl.Hide();

            consigneRep_Lbl.Show();
            lettre1Lbl.Show();
            lettre1TB.Show();
            lettre2Lbl.Show();
            lettre2TB.Show();
            lettre3Lbl.Show();
            lettre3TB.Show();
            ValiderBtn.Show();
        }
コード例 #7
0
        private void Perception_Load(object sender, EventArgs e)
        {
            //exo.deserialiserPerception();
            string message = "Le but de cet exercice est de mémoriser des formes colorées dans un ensemble de formes ainsi que les chiffres qu'elles contiennent afin de les retranscrire. Le temps d'affichage des formes est limité, mais pas le temps de réponse.";

            MessageBox.Show(message, "Consigne de l'exercice");


            if (exo.difficulte == 0)
            {
                timer1.Interval = 4000;
            }
            else if (exo.difficulte == 1)
            {
                timer1.Interval = 2000;
            }

            //Sélection de la consigne
            c = rnd.Next(0, 3);
            EnonceLbl.ResetText();
            EnonceLbl.Visible = false;
            EnonceLbl.Text    = consigne[c];
            EnonceLbl.Visible = true;

            //Affichage des images
            fig = rnd.Next(0, 9);
            PB1.ImageLocation = imagesExo[3][fig];
            PB1.Show();
            reponses[0] = fig;

            fig = rnd.Next(0, 9);
            PB2.ImageLocation = imagesExo[0][fig];
            PB2.Show();
            reponses[1] = fig;

            fig = rnd.Next(0, 9);
            PB3.ImageLocation = imagesExo[2][fig];
            PB3.Show();
            reponses[2] = fig;

            fig = rnd.Next(0, 9);
            PB4.ImageLocation = imagesExo[1][fig];
            PB4.Show();
            reponses[3] = fig;

            fig = rnd.Next(0, 9);
            PB5.ImageLocation = imagesExo[3][fig];
            PB5.Show();
            reponses[4] = fig;

            fig = rnd.Next(0, 9);
            PB6.ImageLocation = imagesExo[1][fig];
            PB6.Show();
            reponses[5] = fig;

            fig = rnd.Next(0, 9);
            PB7.ImageLocation = imagesExo[2][fig];
            PB7.Show();
            reponses[6] = fig;

            fig = rnd.Next(0, 9);
            PB8.ImageLocation = imagesExo[0][fig];
            PB8.Show();
            reponses[7] = fig;

            fig = rnd.Next(0, 9);
            PB9.ImageLocation = imagesExo[3][fig];
            PB9.Show();
            reponses[8] = fig;

            fig = rnd.Next(0, 9);
            PB10.ImageLocation = imagesExo[2][fig];
            PB10.Show();
            reponses[9] = fig;

            fig = rnd.Next(0, 9);
            PB11.ImageLocation = imagesExo[1][fig];
            PB11.Show();
            reponses[10] = fig;

            fig = rnd.Next(0, 9);
            PB12.ImageLocation = imagesExo[0][fig];
            PB12.Show();
            reponses[11] = fig;


            if (c == 0)
            {
                lettre1Lbl.Text = alphabet[1];
                lettre2Lbl.Text = alphabet[7];
                lettre3Lbl.Text = alphabet[11];
                bonneRep[0]     = reponses[1];
                bonneRep[1]     = reponses[7];
                bonneRep[2]     = reponses[11];
            }
            if (c == 1)
            {
                lettre1Lbl.Text = alphabet[3];
                lettre2Lbl.Text = alphabet[5];
                lettre3Lbl.Text = alphabet[10];
                bonneRep[0]     = reponses[3];
                bonneRep[1]     = reponses[5];
                bonneRep[2]     = reponses[10];
            }
            if (c == 2)
            {
                lettre1Lbl.Text = alphabet[2];
                lettre2Lbl.Text = alphabet[6];
                lettre3Lbl.Text = alphabet[9];
                bonneRep[0]     = reponses[2];
                bonneRep[1]     = reponses[6];
                bonneRep[2]     = reponses[9];
            }
            if (c == 3)
            {
                lettre1Lbl.Text = alphabet[0];
                lettre2Lbl.Text = alphabet[4];
                lettre3Lbl.Text = alphabet[8];
                bonneRep[0]     = reponses[0];
                bonneRep[1]     = reponses[4];
                bonneRep[2]     = reponses[8];
            }
            timer1.Start();
        }
コード例 #8
0
        private void ValiderBtn_Click(object sender, EventArgs e)
        {
            if (cpt < 9)
            {
                if (lettre1TB.Text != "")
                {
                    if (lettre2TB.Text != "")
                    {
                        if (lettre3TB.Text != "")
                        {
                            cpt++;
                            repUser[0] = int.Parse(lettre1TB.Text);
                            repUser[1] = int.Parse(lettre2TB.Text);
                            repUser[2] = int.Parse(lettre3TB.Text);
                            score      = exo.calculeScore(repUser, bonneRep);

                            consigneRep_Lbl.Hide();
                            lettre1Lbl.Hide();
                            lettre1TB.Hide();
                            lettre2Lbl.Hide();
                            lettre2TB.Hide();
                            lettre3Lbl.Hide();
                            lettre3TB.Hide();
                            ValiderBtn.Hide();

                            lettre1Lbl.Text = "";
                            lettre2Lbl.Text = "";
                            lettre3Lbl.Text = "";
                            lettre1TB.Text  = "";
                            lettre2TB.Text  = "";
                            lettre3TB.Text  = "";

                            c = rnd.Next(0, 3);
                            EnonceLbl.ResetText();
                            EnonceLbl.Visible = false;
                            EnonceLbl.Text    = consigne[c];
                            EnonceLbl.Visible = true;

                            fig = rnd.Next(0, 9);
                            PB1.ImageLocation = imagesExo[3][fig];
                            PB1.Show();
                            reponses[0] = fig;

                            fig = rnd.Next(0, 9);
                            PB2.ImageLocation = imagesExo[0][fig];
                            PB2.Show();
                            reponses[1] = fig;

                            fig = rnd.Next(0, 9);
                            PB3.ImageLocation = imagesExo[2][fig];
                            PB3.Show();
                            reponses[2] = fig;

                            fig = rnd.Next(0, 9);
                            PB4.ImageLocation = imagesExo[1][fig];
                            PB4.Show();
                            reponses[3] = fig;

                            fig = rnd.Next(0, 9);
                            PB5.ImageLocation = imagesExo[3][fig];
                            PB5.Show();
                            reponses[4] = fig;

                            fig = rnd.Next(0, 9);
                            PB6.ImageLocation = imagesExo[1][fig];
                            PB6.Show();
                            reponses[5] = fig;

                            fig = rnd.Next(0, 9);
                            PB7.ImageLocation = imagesExo[2][fig];
                            PB7.Show();
                            reponses[6] = fig;

                            fig = rnd.Next(0, 9);
                            PB8.ImageLocation = imagesExo[0][fig];
                            PB8.Show();
                            reponses[7] = fig;

                            fig = rnd.Next(0, 9);
                            PB9.ImageLocation = imagesExo[3][fig];
                            PB9.Show();
                            reponses[8] = fig;

                            fig = rnd.Next(0, 9);
                            PB10.ImageLocation = imagesExo[2][fig];
                            PB10.Show();
                            reponses[9] = fig;

                            fig = rnd.Next(0, 9);
                            PB11.ImageLocation = imagesExo[1][fig];
                            PB11.Show();
                            reponses[10] = fig;

                            fig = rnd.Next(0, 9);
                            PB12.ImageLocation = imagesExo[0][fig];
                            PB12.Show();
                            reponses[11] = fig;


                            if (c == 0)
                            {
                                lettre1Lbl.Text = alphabet[1];
                                lettre2Lbl.Text = alphabet[7];
                                lettre3Lbl.Text = alphabet[11];
                                bonneRep[0]     = reponses[1];
                                bonneRep[1]     = reponses[7];
                                bonneRep[2]     = reponses[11];
                            }
                            if (c == 1)
                            {
                                lettre1Lbl.Text = alphabet[3];
                                lettre2Lbl.Text = alphabet[5];
                                lettre3Lbl.Text = alphabet[10];
                                bonneRep[0]     = reponses[3];
                                bonneRep[1]     = reponses[5];
                                bonneRep[2]     = reponses[10];
                            }
                            if (c == 2)
                            {
                                lettre1Lbl.Text = alphabet[2];
                                lettre2Lbl.Text = alphabet[6];
                                lettre3Lbl.Text = alphabet[9];
                                bonneRep[0]     = reponses[2];
                                bonneRep[1]     = reponses[6];
                                bonneRep[2]     = reponses[9];
                            }
                            if (c == 3)
                            {
                                lettre1Lbl.Text = alphabet[0];
                                lettre2Lbl.Text = alphabet[4];
                                lettre3Lbl.Text = alphabet[8];
                                bonneRep[0]     = reponses[0];
                                bonneRep[1]     = reponses[4];
                                bonneRep[2]     = reponses[8];
                            }


                            PB1.Show();
                            PB2.Show();
                            PB3.Show();
                            PB4.Show();
                            PB5.Show();
                            PB6.Show();
                            PB7.Show();
                            PB8.Show();
                            PB9.Show();
                            PB10.Show();
                            PB11.Show();
                            PB12.Show();

                            ALbl.Show();
                            BLbl.Show();
                            CLbl.Show();
                            DLbl.Show();
                            ELbl.Show();
                            FLbl.Show();
                            GLbl.Show();
                            HLbl.Show();
                            ILbl.Show();
                            JLbl.Show();
                            KLbl.Show();
                            LLbl.Show();

                            timer1.Start();
                        }
                        else
                        {
                            string message = "Veuillez remplir tous les champs !";
                            MessageBox.Show(message, "Erreur");
                        }
                    }
                    else
                    {
                        string message = "Veuillez remplir tous les champs !";
                        MessageBox.Show(message, "Erreur");
                    }
                }
                else
                {
                    string message = "Veuillez remplir tous les champs !";
                    MessageBox.Show(message, "Erreur");
                }
            }
            else
            {
                score = (score / 30) * 100;
                string message = "Vous avez " + score + "% de bonnes réponses !";
                MessageBox.Show(message, "Score");
                this.Close();
            }
        }
コード例 #9
0
ファイル: FormPic.cs プロジェクト: swalder44/AVGK
 private void PB1_MouseEnter_1(object sender, EventArgs e)
 {
     PB1.Focus();
 }