title: Grab the current position of a moving ellipse in processing.js
body: <p>Easy Question! I have an ellipse moving from left to right, I was wondering if there is anyway to store a specific point in that left to right path in a variable </p>
  
  <p>e.g when the ellipse hits position X 100 pixels, store the specific position of the ellipse in a variable. </p>
  
  <p>I'd like the ellipse must continue to run from left.</p>
  
  <pre><code>void draw(){     
  
      background(44,209,216); 
  
      fill(colourR,250,182);     
      noStroke();    
      ellipse(posX,posY,100,50);          
  
      posX = posX + speed;
  
      if(posX == 100){
          store posX in a variable
      }                  
  } 
  </code></pre>
  
  <p>That is the sort of process I am looking for, the problem I am getting is that when I try to do something like <code>newPosX = posX</code>, they both continue to increment. How can I make it so <code>newPosX</code> stores the current position of <code>posX</code> and <code>posX</code> continues to increment? Also I mean that <code>newPosX</code> can NOT just <code>= 100</code>, I want to grab the position of <code>posX</code> when it hits 100 and store it in a variable.</p>