Skip to content

Commit edcea8f

Browse files
committed
refixed overlapping drops bug
1 parent 927bde7 commit edcea8f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ window.onload = function () {
556556
}
557557
}
558558

559+
var newDrop = true;
559560
for (var j = 0; j < options.ui_rain_dropCount; j++) {
560561
var character = calculateCharacter(drops[i][j]);
561562
var lightness = audio_lightness;
@@ -579,11 +580,9 @@ window.onload = function () {
579580
drops[i][j][3] = character, drops[i][j][4] = lightness;
580581
neoMatrix.fillText(character, i * options.ui_font_size, drops[i][j][0] * options.ui_font_size);
581582

582-
if (drops[i][j][0] > rows && Math.random() > probability) {
583+
if (drops[i][j][0] > rows && Math.random() > probability && newDrop) {
583584
drops[i][j] = [0, 0, 0, "", 0];
584-
for (; j < options.ui_rain_dropCount; j++)
585-
drops[i][j][0]++;
586-
break;
585+
newDrop = false;
587586
}
588587

589588
drops[i][j][0]++;

0 commit comments

Comments
 (0)