Skip to content

Commit 75937f3

Browse files
committed
contain the balls
1 parent 0d9e000 commit 75937f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

static/kvh/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ function updatePhysics() {
121121

122122
// Use viewport dimensions instead of window dimensions
123123
if (centerX - data.radius <= 0 || centerX + data.radius >= viewport.width) {
124-
data.vx = -data.vx * 0.8;
124+
data.vx = -data.vx * 1.1;
125125
data.vr *= 0.9;
126126
data.x = Math.max(0, Math.min(viewport.width - data.radius * 2, data.x));
127127
}
128128

129-
if (centerY + data.radius >= viewport.height) {
130-
data.vy = -data.vy * 0.8;
129+
if (centerY - data.radius <= 0 || centerY + data.radius >= viewport.ght) {
130+
data.vy = -data.vy * 1.1;
131131
data.vr = data.vx / data.radius; // no slip
132-
data.vx *= 0.95;
132+
data.vx *= 1.05;
133133
data.y = viewport.height - data.radius * 2;
134134
}
135135

0 commit comments

Comments
 (0)