Beispiel #1
0
 /// <summary>
 /// This method starts the generation and paint process of the new maze.
 /// </summary>
 public void GenerateMazeLetsGo()
 {
     maze = new Maze(GlobalVariables.Height, GlobalVariables.Width);
     maze.Generate();
     panel1.Invalidate();
     draw_output();
 }
Beispiel #2
0
 private void Button1_Click(object sender, EventArgs e)
 {
     maze = new Maze(Convert.ToInt32(nudRows.Value), Convert.ToInt32(nudCols.Value), Convert.ToInt32(nudWidth.Value), Convert.ToInt32(nudHeight.Value));
     maze.MazeComplete += (Image m) =>
     {
         Panel1.BackgroundImage       = m;
         Panel1.BackgroundImageLayout = ImageLayout.None;
         Panel1.Width  = m.Width;
         Panel1.Height = m.Height;
         //maze.PrintMaze()
     };
     maze.Generate();
 }
Beispiel #3
0
        public void StartMaze()
        {
            GlobalVariables.IsIntroString = false;
            GlobalVariables.Height        = 10;
            GlobalVariables.Width         = 10;
            GlobalVariables.DetectRange   = 3;
            maze = new Maze(GlobalVariables.Height, GlobalVariables.Width);
            maze.Generate();

            currentPos.X = maze.Start.X;
            currentPos.Y = maze.Start.Y;

            refreshGrid();
            setGameBoard();
            updatePosition();

            IntroString.Visible = false;
            MainPanel.Visible   = true;
        }