title: How to pause while condition is false
body: <p>I'm making a game, and I want to have a pause between one condition being true and an expression being run. The commented line below shows you where I want the pause, and the <strong><em>kind</em></strong> of pause I want is like this (which doesn't work):</p>
  
  <pre><code>while (bullet.yPos &gt;= 0) {}; //Tried, failed
  </code></pre>
  
  <p>So I want my code to stop <strong><em>while</em></strong> <code>bullet.yPos</code> is greater than or equal to 0, and then continue when <code>bullet.yPos</code> is less than 0. </p>
  
  <pre><code>bullet.hidden = true;
  //I want the pause here, and the line below to be executed when bullet.yPos is less than 0
  bullet.hidden = false;
  </code></pre>
  
  <p>How should I do this?</p>
  
  <p>EDIT: Here is the relevant method:</p>
  
  <pre><code>check: function() {
  
      for (var i = 0; i &lt; this.aliens.length; i++) {
  
          var item = this.aliens[i];
  
          if ((bullet.lockedXPos &gt;= item.xPos) &amp;&amp; (bullet.lockedXPos &lt;= item.xPos + this.size) &amp;&amp; (bullet.yPos &gt;= item.yPos) &amp;&amp; (bullet.yPos &lt;= item.yPos + this.size)) {
  
              item.hit = true;
              bullet.hidden = true;
              while (bullet.yPos &gt;= 0) {};
              bullet.hidden = false;
  
  
          }
  
      }
  
  },
  </code></pre>