コード例 #1
0
        public void CreateMaze(Vector3 positionMaze, float sizeMaze, params int[] args)
        {
            switch (_tessellation)
            {
            case TessellationType.Orthigonal:
                _mazeSpawner = new OrthogonalMazeSpawner(sizeMaze, positionMaze);
                break;

            case TessellationType.Theta:
                _mazeSpawner = new ThetaMazeSpawner(sizeMaze, positionMaze);
                break;
            }

            _maze = _mazeGenerator.GenerateMaze(_tessellation, args);

            _mazeSpawner.SpawnMazeOnScene(_maze);
        }
コード例 #2
0
 public MazeWindow(Mode mode)
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.None;
     gameMode             = mode;
     maze = new Label[WIDTH, HEIGHT];
     MazeGenerator.GenerateMaze();
     createGrid();
     if (gameMode == Mode.Mouse)
     {
         Point startingPoint = maze[1, 1].Location;
         startingPoint.Offset(10, 10);
         Cursor.Position = PointToScreen(startingPoint);
         checkPoint      = PointToScreen(startingPoint);
         timer1.Start();
     }
     else
     {
         this.Text = "The Maze Game - Keyboard Mode";
     }
     this.KeyUp += keyboardControl;
 }