summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'script.js')
-rw-r--r--script.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/script.js b/script.js
index 1f401e6..7018f86 100644
--- a/script.js
+++ b/script.js
@@ -202,7 +202,7 @@ function tick() {
// Use click to update velocities
function updatev(event) {
for (a of A) {
- let d = ds(a, {x: event.clientX, y: event.clientY})
+ let d = Math.max(ds(a, {x: event.clientX, y: event.clientY}), 100)
a.vx += 100 * (a.x - event.clientX) / d
a.vy += 100 * (a.y - event.clientY) / d
}