title: Ice backfire effect is not working on my JavaScript game
body: <p>I'm trying to make a simple anti-spamming tactic in my game so that trying to perform "Freeze Ball" with Cyborg Ninja twice would cause the other fighter to be unfrozen and actually freeze Cyborg Ninja back.</p>
  
  <p>The code is:        </p>
  
  <pre><code>if (myObstacle.crashWith(myGamePiece2)) {
  ballCount += 1;
  freezeTime = 0;
  frozen = 1;
  myObstacle.x = freezeX;     
  myObstacle.y = freezeY;     
  freeze = 0;
  }
  
  if (freeze == 1) {
  myObstacle.update();
  myObstacle.x += 5;
  }
  
  if (frozen == 1) {
  myEffect = new component(80, 80, "https://vignette.wikia.nocookie.net/battlefordreamisland/images/4/4e/Old_Icy_Remake.png/revision/latest?cb=20180102221338", myGamePiece2.x, myGamePiece2.y, "image");  
  myEffect.newPos();
  myEffect.update();
  freezeTime += 1;
  }
  
  if (freezeTime == 201) {
  freezeTime = 0;
  frozen = 0;
  }
  
  if (myObstacle2.x &lt; -5) {
  myObstacle2.x = freezeX2;     
  myObstacle2.y = freezeY2;     
  freeze2 = 0;
  }
  
  if (myObstacle2.crashWith(myGamePiece)) {
  ballCount2 += 1;
  freezeTime2 = 0;
  frozen2 = 1;
  myObstacle2.x = freezeX2;     
  myObstacle2.y = freezeY2;     
  freeze2 = 0;
  }
  
  if (freeze2 == 1) {
  myObstacle2.update();
  myObstacle2.x -= 5;
  }
  
  if (frozen2 == 1) {
  myEffect2 = new component(80, 80, "https://vignette.wikia.nocookie.net/battlefordreamisland/images/4/4e/Old_Icy_Remake.png/revision/latest?cb=20180102221338", myGamePiece.x, myGamePiece.y+5, "image");  
  myEffect2.newPos();
  myEffect2.update();
  freezeTime2 += 1;
  }
  
  if (freezeTime2 == 201) {
  freezeTime2 = 0;
  frozen2 = 0;
  }
  
  if (freeze == 1 &amp;&amp; freeze2 == 1 &amp;&amp; myObstacle.crashWith(myObstacle2)) {
  freeze = 0;
  freeze2 = 0;
  myObstacle.x = freezeX;     
  myObstacle.y = freezeY;     
  myObstacle2.x = freezeX2;     
  myObstacle2.y = freezeY2;     
  }
  
  //P1 Double Ice Backfire
  if (doubleIce2 == 1 &amp;&amp; ballCount &gt; 1) {
  freezeTime = 0;
  frozen = 1;
  freezeTime2 = 0;
  frozen2 = 0;
  myObstacle.x = freezeX;     
  myObstacle.y = freezeY;     
  freeze = 0;
  doubleIce2 = 1;
  doubleIce = 0;
  doubleIceTime = 0;
  }
  //P2 Double Ice Backfire
  if (doubleIce2 == 1 &amp;&amp; ballCount2 &gt; 1) {
  freezeTime2 = 0;
  frozen2 = 1;
  freezeTime = 0;
  frozen = 0;
  myObstacle2.x = freezeX2;     
  myObstacle2.y = freezeY2;     
  freeze2 = 0;
  doubleIce = 1;
  doubleIce2 = 0;
  doubleIceTime2 = 0;
  }
  </code></pre>
  
  <p>When I attempt to try this, the code will fail and causes the CPU to be frozen endlessly.</p>
  
  <p>Can someone help on how to properly do this mechanic for my game? Thanks...</p>