Ejemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            string scoreInText = null;

            string highScoreTemp = highScore.Read(scoreInText, filePathOfScore);

            string nameInText = null;

            label_name.Text = highScore.Read(nameInText, filePathOfName);

            if (myForm.timer1.Enabled == false)
            {
                if (int.Parse(highScoreTemp) > int.Parse(lb_highscore.Text) && myForm.timer1.Enabled == false)
                {
                    myForm.pictureBox1.Visible     = true;
                    myForm.button1.Visible         = true;
                    pipe.picBoxPipeAbove1.Visible  = false;
                    pipe.picBoxPipeAbove2.Visible  = false;
                    pipe.picBoxPipeBottom1.Visible = false;

                    pipe.picBoxPipeBottom2.Visible = false;
                    lb_highscore.Text = highScoreTemp;
                    label_name.Text   = tB_playerName.Text;
                    highScore.Write(label_name.Text, filePathOfName);

                    pB_playerHighSorce.Image = pB_Player.Image;

                    byte[] imageArray = System.IO.File.ReadAllBytes(defaultLinkOfImage);
                    string base64ImageRepresentation = Convert.ToBase64String(imageArray);
                    Pic = base64ImageRepresentation;
                    highScore.Write(base64ImageRepresentation, filePathOfImage);
                }
            }
        }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            string scoreInText = null;

            string highScoreTemp = highScore.Read(scoreInText, filePathOfScore);

            string nameInText = null;

            label_name.Text = highScore.Read(nameInText, filePathOfName);

            if (myForm.buttonOriWasClicked == true)
            {
                myForm.buttonOriWasClicked = false;
                //  myForm.buttonHaloWasClicked = false;
                //   myForm.buttonChristWasClicked = false;

                cur = new Cursor(Properties.Resources.cursorOrigin.Handle);
                ctr.ChooseBgGameForm1(1, this);
                pictureBox1.BackgroundImage = Properties.Resources.ori_logo;
                panel1.BackgroundImage      = Properties.Resources.ori_fame;
            }

            //  myForm.buttonHaloWasClicked = true;
            // myForm.buttonChristWasClicked = false;

            else if (myForm.buttonChristWasClicked == true)
            {
                myForm.buttonChristWasClicked = false;
                //  myForm.buttonOriWasClicked = false;
                //   myForm.buttonHaloWasClicked = false;
                cur = new Cursor(Properties.Resources.cursorChristmas.Handle);
                ctr.ChooseBgGameForm1(2, this);
                pictureBox1.BackgroundImage = Properties.Resources.christt_logo;
                panel1.BackgroundImage      = Properties.Resources.christ_frame;
            }

            else if (myForm.buttonHaloWasClicked == true)
            {
                myForm.buttonHaloWasClicked = false;
                //  myForm.buttonOriWasClicked = false;
                //  myForm.buttonChristWasClicked = false;
                cur = new Cursor(Properties.Resources.cursorHallo.Handle);
                ctr.ChooseBgGameForm1(3, this);
                pictureBox1.BackgroundImage = Properties.Resources.halo_logo;
                panel1.BackgroundImage      = Properties.Resources.halo_frame;
            }

            if (myForm.timer1.Enabled == false)
            {
                if (int.Parse(highScoreTemp) > int.Parse(lb_highscore.Text) && myForm.timer1.Enabled == false)
                {
                    myForm.ga.Visible     = false;
                    myForm.label1.Visible = false;
                    myForm.gif.Visible    = true;


                    //pipe.picBoxPipeAbove1.Visible = false;
                    //pipe.picBoxPipeAbove2.Visible = false;
                    //pipe.picBoxPipeBottom1.Visible = false;

                    //pipe.picBoxPipeBottom2.Visible = false;

                    pipe.pipe_Above1_Appearance  = false;
                    pipe.pipe_Bottom2_Appearance = false;
                    pipe.pipe_Above1_Appearance  = false;
                    pipe.pipe_Bottom2_Appearance = false;

                    lb_highscore.Text = highScoreTemp;
                    label_name.Text   = tB_playerName.Text;
                    highScore.Write(label_name.Text, filePathOfName);

                    pB_playerHighSorce.Image = pB_Player.Image;

                    byte[] imageArray = System.IO.File.ReadAllBytes(defaultLinkOfImage);
                    string base64ImageRepresentation = Convert.ToBase64String(imageArray);
                    Pic = base64ImageRepresentation;
                    highScore.Write(base64ImageRepresentation, filePathOfImage);
                }
            }
        }