title: I have two timers ones not working in javascript
body: <p>In my tank game (not unlike awesome tanks for reference) I want my AI tank to also shoot a bullet so I made another timer but when i try to run it says the <code>AItimer</code> is not defined in <code>clearInterval(AItimer);</code> I am confused because the code is from another timer but it works fine.</p>
  <pre class="lang-js prettyprint-override"><code>function aiStartTimer() {
    if (shoot == 0) {
      //creates aitimer variable
      AItimer = setInterval(&quot;aiFireBullet()&quot;, 100);
      shoot = 1 * 1;
    } else if (shoot == 1) {
      clearInterval(AItimer);
      shoot = 0 * 1;
    }
  }
  </code></pre>
  <p>Here is a <a href="https://jsfiddle.net/tm9oL74r/" rel="nofollow noreferrer">JSFiddle</a></p>