()
| 79 | } |
| 80 | |
| 81 | function animate() { |
| 82 | ctx.clearRect(0, 0, canvas.width, canvas.height); |
| 83 | |
| 84 | particles.forEach(particle => { |
| 85 | particle.update(); |
| 86 | particle.draw(); |
| 87 | }); |
| 88 | |
| 89 | connectParticles(); |
| 90 | |
| 91 | requestAnimationFrame(animate); |
| 92 | } |
| 93 | |
| 94 | // Handle mouse click to create a new particle |
| 95 | canvas.addEventListener('click', (e) => { |
no test coverage detected