コード例 #1
0
ファイル: MazeGen.cs プロジェクト: jetemperley/Maze-game-test
 public void generateShoot()
 {
     if (!isDead())
     {
         Pather p = new Pather(grid, xPos, yPos);
         p.step();
         shoots.Add(p);
     }
 }
コード例 #2
0
ファイル: MazeGen.cs プロジェクト: jetemperley/Maze-game-test
        public void randShoot()
        {
            int i = Rand.random(0, 100);

            if (!isDead() && i < 40)
            {
                Pather p = new Pather(grid, xPos, yPos);
                p.step();
                shoots.Add(p);
            }
        }
コード例 #3
0
ファイル: MazeGen.cs プロジェクト: jetemperley/Maze-game-test
        public static int[,] gen(int x, int y)
        {
            if (x < 5 || y < 5)
            {
                return(null);
            }
            int[,] grid = new int[y, x];

            x  = x / 2;
            x += x % 2 - 1;
            y  = y / 2;
            y += y % 2 - 1;

            Pather p = new Pather(grid, x, y);
            Pather q = new Pather(grid, x, y);

            while (!(p.complete && p.shootsComplete && q.complete && q.shootsComplete))
            {
                p.step();
                q.step();
            }

            return(grid);
        }