Skip to content

Commit

Permalink
refixed overlapping drops bug
Browse files Browse the repository at this point in the history
  • Loading branch information
IPdotSetAF committed May 3, 2024
1 parent 927bde7 commit edcea8f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ window.onload = function () {
}
}

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

if (drops[i][j][0] > rows && Math.random() > probability) {
if (drops[i][j][0] > rows && Math.random() > probability && newDrop) {
drops[i][j] = [0, 0, 0, "", 0];
for (; j < options.ui_rain_dropCount; j++)
drops[i][j][0]++;
break;
newDrop = false;
}

drops[i][j][0]++;
Expand Down

0 comments on commit edcea8f

Please sign in to comment.