Beispiel #1
0
 public void TestMenuExit()
 {
     MenuForm myform = new MenuForm();
     myform.Show();
     Assert.IsTrue(myform.Visible, "Checks if form is visible");
     myform.Close();
     Assert.IsFalse(myform.Visible, "Checks if form is visible");
 }
Beispiel #2
0
        public void TestExit()
        {
            MenuForm form = new MenuForm();
            form.Show();

            Assert.IsTrue(form.Visible, "Test if menu is running");
            form.Close();
            Assert.IsFalse(form.Visible, "Checks if form is running");
        }
Beispiel #3
0
 public void TestMenuSettings()
 {
     MenuForm myform = new MenuForm();
     myform.Show();
     Assert.IsTrue(myform.Visible, "Checks if form is visible");
     myform.c = true;
     myform.a = true;
     myform.StartGame();
     Assert.IsTrue(myform.changed, "Checks if settings changed");
 }
Beispiel #4
0
 public void TestMenuBackground()
 {
     MenuForm form = new MenuForm ();
     form.Show ();
     Assert.AreNotSame (System.Drawing.Image.FromFile(@"../../Resources/snakestartscreenfinal.png"), form.BackgroundImage);
 }
Beispiel #5
0
 /// <summary>
 /// When back to menu tool strip button is clicked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void toolStripBackToMenu_Click(object sender, EventArgs e)
 {
     Settings.GameOver = true;
     this.Close();
     MenuForm menu = new MenuForm();
     menu.Show();
 }
Beispiel #6
0
        public void UpdateScreen(object sender, EventArgs e)
        {
            MovePlayer();
            if (Settings.GameOver)
            {
                gameTimer.Stop();
                MenuForm form = new MenuForm();
                this.Hide();
                form.Show();
            }
            if (snake[0].X == ((pbCanvas.Width /16)/2))
            {
                Settings.direction = Direction.Up;
            }

            if (snake[0].Y == ((pbCanvas.Height / 16) / 4))
            {
                Settings.direction = Direction.Right;
            }
            pbCanvas.Invalidate();
        }