 this.spawn();
  }
}
            </code></pre>
          </section>
          <section>
            <iframe width="100%" height="600" data-src="/ch10.html">
            </iframe>
          </section>


          <!-- Making it a game -->
          <section>
            <h1>Making it a game</h1>
          </section>
          <section>
            <h2>Tracking the score</h2>
            <pre><code>
document.addEventListener('ped_dead', e => {
  this.score += 100;
  document.getElementById('currentScore').inn