title: adding multiple objects in p5.js
body: <p>I have a little bit of javascript, 
  which is calling from the processing/p5.js library a number of tools. </p>
  
  <pre><code>// Spring drawing constants for top bar
  let springHeight = 19,
      left,
      right,
      maxHeight = 300,
      minHeight = 0,
      over = false,
      move = false;
  
  // Spring simulation constants
  let M = 0.8,  // Mass
      K = 0.2,  // Spring constant
      D = 0.92, // Damping
      R = 180;  // Rest position
  
  // Spring simulation variables
  let ps = R,   // Position
      vs = 0.0, // Velocity
      as = 0,   // Acceleration
      f = 0;    // Force
  
  
  
  function setup() {
    createCanvas(710, 400);
    rectMode(CORNERS);
    // rectMode(CORNER);
    c = color('rgb(255,233,234)');
    fill(c);
    noStroke();
    left = width / 2 - 400;
    right = width / 2 + 400;
  }
  
  function draw() {
    background(102);
    updateSpring();
    drawWire();
  }
  
  function drawWire() {
    rect(left, ps + 10, right, ps + springHeight);
    // rect(left, ps + 10, right, ps + springHeight);
  }
  
  function updateSpring() {
    // Update the spring position
    if ( !move ) {
      f = -K * ( ps - R ); // f=-ky
      as = f / M;          // Set the acceleration, f=ma == a=f/m
      vs = D * (vs + as);  // Set the velocity
      ps = ps + vs;        // Updated position
    }
  
    if (abs(vs) &lt; 0.1) {
      vs = 0.0;
    }
  
    // Test if mouse if over the top bar
    if (mouseX &gt; left &amp;&amp; mouseX &lt; right &amp;&amp; mouseY &gt; ps &amp;&amp; mouseY &lt; ps + springHeight) {
      over = true;
    } else {
      over = false;
    }
  
    // Set and constrain the position of top bar
    if (move) {
      ps = mouseY - springHeight / 2;
      ps = constrain(ps, minHeight, maxHeight);
    }
  }
  
  function mousePressed() {
    if (over) {
      move = true;
    }
  }
  
  function mouseReleased() {
    move = false;
  }
  </code></pre>
  
  <p>the javascript file, when run in my html, will create a single, pleasantly springy string:</p>
  
  <p><a href="https://i.stack.imgur.com/ldjc7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ldjc7.png" alt="enter image description here"></a></p>
  
  <p>what would be the best way to change this code so that <em>multiple</em> strings are produced, </p>
  
  <p>perhaps spaced vertically by <em>n</em> pixels?</p>
  
  <p>I have tried simply replicating the code block, but can not seem to be getting this right!</p>