title: Phaser: How to use a simple timer from 0 to 3
body: <p>I am using the following code <em>(which is a simplified snippet in order to make it more readable)</em>: </p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var player;
  var box_tnt;
  
  function create (){
      this.physics.add.collider(player, box_tnt, hitTnt, null, this);
  }
  
  //the function hitTnt stop the game because the player died
  function hitTnt (player, boxes){
      this.physics.pause();
      player.setTint(0xff0000);
      player.anims.play('default');
      gameOver = true;
      textGameOver.setText('GAME OVER');
  }
  </code></pre>
  
  <ul>
  <li><strong>Actual comportment:</strong></li>
  </ul>
  
  <p>When the player hit the bomb: player die; end of the game</p>
  
  <ul>
  <li><strong>Desired comportment:</strong></li>
  </ul>
  
  <p>When the player hits the bomb: the bomb waits 3 secondes and then explodes ! If the player is too close he dies.
  But I struggle a lot to use a timer even after reading a lot of examples in the forum. I am a newbie concerning Phaser so I didn't succeed to it so far.</p>
  
  <p>Any help would be appreciated, thank you in advance! </p>