public void generateShoot() { if (!isDead()) { Pather p = new Pather(grid, xPos, yPos); p.step(); shoots.Add(p); } }
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); } }
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); }