sketch.js
// setting the particle in motion.
setting the particle in motion.
setting the particle in motion .
moveParticle() {
    if (this.x < 0 || this.x > width) this.xSpeed *= -1;
    if (this.y < 0 || this.y > height) this.ySpeed *= -1;
    this.x += this.xSpeed;
    this.y += this.ySpeed;
  }
moveParticle ( ) { if ( this . x < 0 || this . x > width ) this . xSpeed *= - 1 ; if ( this . y < 0 || this . y > height ) this . ySpeed *= - 1 ; this . x += this . xSpeed ; this . y += this . ySpeed ; }
setting the particle in motion.
setting the particle in motion .