title: TypeScript Access Static Variables Using Instances
body: <p>So in most OOP languages static variables can also be called <strong>class</strong> variables, ie their value is <em>shared</em> among all instances of this class. For example, in my game I have a class <code>Bullet</code> which is extended by <code>GreenBullet</code> and <code>PinkBullet</code>. I want these subclasses to have a "class" or "static" variable called <code>ammo</code> so that I can keep track of the ammo count for that specific ammo type. But here is the catch: I want to be able to access this property through an instance of the subclass.</p>
  
  <p>Example:</p>
  
  <pre><code>var bullet: GreenBullet = new GreenBullet()
  if (bullet.ammo &lt;= 0)
      return;
  bullet.shoot();
  bullet.ammo --;
  </code></pre>
  
  <p>I want ALL instances of <code>GreenBullet</code> to be aware of this change to their ammo count.</p>