diff --git a/src/js/ball.js b/src/js/ball.js index eeac0fb..e1c20e7 100644 --- a/src/js/ball.js +++ b/src/js/ball.js @@ -94,7 +94,6 @@ class Ball extends PIXI.Graphics { } } } - bounce(ball) { const m = scale(add(this.position, ball.position), 0.5) const n1 = normalize(sub(this.position, ball.position), this.r) @@ -167,4 +166,4 @@ function setupBalls(numBalls, maskProb, vaccineProb, fatalityProb) { } } -export { balls, setupBalls } +export { balls, setupBalls } \ No newline at end of file diff --git a/src/js/vector.js b/src/js/vector.js index b64ebfb..b3c7cf3 100644 --- a/src/js/vector.js +++ b/src/js/vector.js @@ -3,13 +3,11 @@ function add(point1, point2) { newPoint.set(point1.x + point2.x, point1.y + point2.y) return newPoint } - function sub(point1, point2) { const newPoint = point1.clone() newPoint.set(point1.x - point2.x, point1.y - point2.y) return newPoint } - function scale(point, k) { const newPoint = point.clone() newPoint.set(k * point.x, k * point.y)