diff options
author | Anthony Wang | 2024-01-29 22:22:58 +0000 |
---|---|---|
committer | Anthony Wang | 2024-04-13 04:32:13 +0000 |
commit | 389eeeb48d5bc1ca6eb04517152b60450e7705b5 (patch) | |
tree | 9b2c7111cad4f0440707f38013a02919973a7a59 /script.js | |
parent | ab39b82693833be59dc9b9251ebad91db6707727 (diff) |
Limit velocity change from click, add position: fixed so this finally works on mobile
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 } |