Esempio n. 1
0
 public void level2()
 {
     timer1.Stop();
     timer2.Stop();
     level1doc.endGame();
     MessageBox.Show("You won Level1, you are now on Level2!");
     levelText.Text       = "Level 2";
     level1doc            = null;
     level2doc            = new Level2(ref hero, Width, Height, random);
     this.BackgroundImage = level2doc.img;
     timer1.Start();
     timer2.Start();
     Invalidate(true);
 }
Esempio n. 2
0
        public void newGame()
        {
            newGame1 = new NewGame();
            if (newGame1.ShowDialog() == DialogResult.OK)
            {
                hero   = new Hero(Width, Height, newGame1.name);
                random = new Random();

                level1doc            = new Level1(this.Width, this.Height, ref hero, random);
                this.BackgroundImage = level1doc.img;

                level2doc = null;

                timer1.Start();
                timer2.Start();
                player.controls.play();
            }
            else
            {
                this.Close();
            }
        }