Пример #1
0
 public void generateShoot()
 {
     if (!isDead())
     {
         Pather p = new Pather(grid, xPos, yPos);
         p.step();
         shoots.Add(p);
     }
 }
Пример #2
0
        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
        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);
        }