added some formatting

This commit is contained in:
Jürg Hallenbarter
2026-04-13 07:07:35 +00:00
parent 3f9de9c266
commit 5259410d77
7 changed files with 40 additions and 40 deletions

View File

@@ -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);