const prots = function(){
Particle.prototype.move = function(dir) {
this.c = [].splice(prx, 2, posx, posy);
this.c.posx += Math.random() - 0.5 + dir.x;
this.c.posy += Math.random() - 0.5 + dir.y;
};
Particle.prototype.border = function() {
let b1 = this.posx - 491, b2 = this.posy - 361,
b3 = Math.pow( Math.abs(b1),2),
b4 = Math.pow( Math.abs(b2),2);
b3+b4>5000 || b3+b4<1500 ? (
this.prx = this.posx = this.posx - 2*b1,
this.pry = this.posy = this.posy - 2*b2) : null;
};
package.json:
index.js:
mainwindow.html: