remove down-right bias when bouncing normally
This commit is contained in:
parent
81e41b9fd3
commit
5d44e2d93b
@ -131,10 +131,21 @@ function particles(){
|
||||
let size = (Math.random() * sizeMultiplier) + 1;
|
||||
// set X
|
||||
let x = (Math.random() * ((innerWidth - size * 2) - (size * 2)) + size * 2);
|
||||
directionX = Math.random() * 5;
|
||||
if (noBounceH){
|
||||
directionX = Math.random() * 5;
|
||||
}
|
||||
else{
|
||||
directionX = (Math.random() * 5) - 2.5;
|
||||
}
|
||||
// set Y
|
||||
let y = (Math.random() * ((innerHeight - size * 2) - (size * 2)) + size * 2);
|
||||
directionY = Math.random() * 5;
|
||||
if (noBounceV){
|
||||
directionY = Math.random() * 5;
|
||||
}
|
||||
else{
|
||||
directionY = (Math.random() * 5) -2.5;
|
||||
}
|
||||
|
||||
|
||||
particlesArray.push(new Particle(x, y, directionX, directionY, size));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user