added some formatting
This commit is contained in:
@@ -173,7 +173,7 @@ function applyCohesion(p, particleGrid, cellX, cellY) {
|
||||
if (other === p) continue;
|
||||
let ddx = other.x - p.x;
|
||||
let ddy = other.y - p.y;
|
||||
let dist = sqrt(ddx*ddx + ddy*ddy);
|
||||
let dist = sqrt(ddx * ddx + ddy * ddy);
|
||||
if (dist > 0 && dist < cohesionRadius) {
|
||||
let strength = cohesionStrength * (1 - dist / cohesionRadius);
|
||||
fx += ddx * strength;
|
||||
@@ -245,7 +245,7 @@ function draw() {
|
||||
if (p.y <= radius || p.y >= height - radius) p.vy *= -0.9;
|
||||
}
|
||||
|
||||
for (let i = waterParticles.length-1; i >= 0; i--) {
|
||||
for (let i = waterParticles.length - 1; i >= 0; i--) {
|
||||
let p = waterParticles[i];
|
||||
if (p.y + radius >= height) {
|
||||
waterParticles.splice(i, 1);
|
||||
|
||||
Reference in New Issue
Block a user