コード例 #1
0
ファイル: Form1.cs プロジェクト: Bozijanov/CatchTheThing
 public Form1()
 {
     InitializeComponent();
     kocki = new Kocki(randomKocki);
     brojac = 0;
     lblPause.Visible = false;
     timer1.Enabled = false;
     timer2.Enabled = false;
     lvl1 = true;
     sound = true;
     player = new SoundPlayer(Resources.kapka1);
     soundToolStripMenuItem.Checked = true;
     dropToolStripMenuItem.Checked = true;
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Bozijanov/CatchTheThing
 public void Restart()
 {
     kocki = new Kocki(randomKocki);
     brojac = 0;
     label2.Text = "0";
     timer1.Start();
     timer2.Start();
     lvl1 = true;
     HowToPlayToolStripMenuItem.Checked = false;
     helpToolStripMenuItem.Checked = false;
     txtHowToPlay.Visible = false;
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Bozijanov/CatchTheThing
 private void HowToPlayToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (aboutUsToolStripMenuItem.Checked == true)
     {
         aboutUsToolStripMenuItem.Checked = false;
     }
     HowToPlayToolStripMenuItem.Checked = true;
     kocki = new Kocki(randomKocki);
     txtHowToPlay.Visible = true;
     timer1.Stop();
     timer2.Stop();
     txtHowToPlay.Text = "For starter we have three menu options to choose: File,Skins and Help.\n To start a new game you either press ctrl+n, p or File->New Game.\n In the menu File there are also three more optons: High Score,Sound and Exit. If you want to close the game you should press exit,\n if you want to see who has the higher scores in the game you press high score and you get the top five high scores.\n If you want a sound effects you turn on the option Sound. \n You also have a posibility to pause the game by pressing the key p on the keyboard. \n In the second menu Skins ,you have the option to choose one of the three skins Drop,Fruit and Candy.\n And finaly in the last menu Help there are two possibilities: How to play(this text itself) and About us(info about the developers of this aplication)\n\n\nPress Escape to close this!";
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Bozijanov/CatchTheThing
        private void timer1_Tick(object sender, EventArgs e)
        {
            PoeniForma poeniforma = new PoeniForma();
            Dvizenje();
            for (int i = 0; i < kocki.KockiRec.Length; i++)
            {
                if (kocki.KockiRec[i].IntersectsWith(pad.PadRec))
                {
                    if (sound == true)
                        player.Play();
                    brojac++;
                    kocki.KockiRec[i].Y = 500;
                    label2.Text = Convert.ToString(brojac);
                }

                if (kocki.KockiRec[i].Y > 330 && kocki.KockiRec[i].Y < 370)
                {
                    timer1.Stop();
                    timer2.Stop();
                    lvl1 = true;
                    lvl2 = lvl3 = lvl4 = lvl5 = false;
                    if (MessageBox.Show("Do you want to save the points?", "Save points?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        poeniforma.poeni = brojac;
                        poeniforma.ShowDialog();
                        ime = poeniforma.ime;
                    }
                    kocki = new Kocki(randomKocki);
                }

                if (brojac == kocki.KockiRec.Length)
                {
                    timer1.Stop();
                    if (MessageBox.Show("Do you want to save the points?", "Save points?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        poeniforma.poeni = brojac;
                        poeniforma.ShowDialog();
                        ime = poeniforma.ime;
                    }
                }
            }
            this.Invalidate();
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: Bozijanov/CatchTheThing
 private void aboutUsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (HowToPlayToolStripMenuItem.Checked == true)
     {
         HowToPlayToolStripMenuItem.Checked = false;
     }
     aboutUsToolStripMenuItem.Checked = true;
     kocki = new Kocki(randomKocki);
     txtHowToPlay.Visible = true;
     timer1.Stop();
     timer2.Stop();
     txtHowToPlay.Text = "We hope you will enjoy playing our game. \n The developers of these aplications are:\n\n Bozijanov Hristijan\n Minova Gurgica \n Jovanovic Aleksandra \n \n E-mails for contacts: \n  [email protected] \n [email protected] \n [email protected]\n\n\nPress Escape to close this!";
 }