This commit is contained in:
Marty Oehme 2018-07-08 19:05:11 +02:00
parent 4074f49228
commit 3676264444

View file

@ -32,7 +32,14 @@ class Grid {
void reset() { void reset() {
map.setAll(0, _buildGrid(w, h)); map.setAll(0, _buildGrid(w, h));
if(_startingSeed != null) addPattern(pattern: _pattern, dispersal: _dispersal,amount: _amount,seed: _startingSeed, x: _x, y: _y); if (_startingSeed != null)
addPattern(
pattern: _pattern,
dispersal: _dispersal,
amount: _amount,
seed: _startingSeed,
x: _x,
y: _y);
_dirty = true; _dirty = true;
} }
@ -81,7 +88,7 @@ class Grid {
? i-- ? i--
: setCellState(cx + rng.nextInt(_dispersal), : setCellState(cx + rng.nextInt(_dispersal),
cy + rng.nextInt(_dispersal), true); cy + rng.nextInt(_dispersal), true);
if (sanityCheck > 100 && sanityCheck > i*3) break; if (sanityCheck > 100 && sanityCheck > i * 3) break;
} }
break; break;
} }
@ -180,7 +187,7 @@ class Grid {
for (int y = 0; y < map.length; y++) { for (int y = 0; y < map.length; y++) {
for (int x = 0; x < map[y].length; x++) { for (int x = 0; x < map[y].length; x++) {
if(_renderEdges) { if (_renderEdges) {
ctx.setStrokeColorRgb(100, 100, 100); ctx.setStrokeColorRgb(100, 100, 100);
ctx.strokeRect(x * brickW, y * brickH, brickW, brickH); ctx.strokeRect(x * brickW, y * brickH, brickW, brickH);
} }