diff --git a/lib/src/Grid.dart b/lib/src/Grid.dart index f188ae9..5649c6b 100644 --- a/lib/src/Grid.dart +++ b/lib/src/Grid.dart @@ -25,7 +25,7 @@ class Grid { print("Grid creation finished"); } - void startingPattern({Pattern pattern, int x, int y}) { + void startingPattern({Pattern pattern, int x, int y, int amount, int dispersal}) { math.Random rng = new math.Random(); int cx = x ?? rng.nextInt(w~/3) + (w~/3); int cy = y ?? rng.nextInt(h~/3) + (h~/3); @@ -56,8 +56,8 @@ class Grid { setCellState(0 + cx, 2 + cy, true); break; default: - for (var i = 0; i < rng.nextInt(20); i++) { - setCellState(cx + rng.nextInt(10), cy + rng.nextInt(10), true); + for (var i = 0; i < amount ?? rng.nextInt(20); i++) { + setCellState(cx + dispersal ?? rng.nextInt(10), cy + dispersal ?? rng.nextInt(10), true); } break; }