From 5b0d2d108a8c3306be4e1164a1a638ec85bb060e Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 8 Apr 2020 04:35:04 -0600 Subject: [PATCH] initialize mouse position as undefined This stops the particles from sticking at 0,0 on start. --- js/particles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/particles.js b/js/particles.js index fc0b864..8c79686 100644 --- a/js/particles.js +++ b/js/particles.js @@ -12,8 +12,8 @@ let particlesArray; // get mouse position let mousePosition ={ - x: null, - y: null, + x: undefined, + y: undefined, radius: (canvas.height / 80) * (canvas.width / 80) };