title: How to prevent screen holding on "touchstart"?
body: <p>I’m trying to create a small game as a learning experience and I’m having trouble adding a jump function. The game is for mobile touch screens.</p>
  <p>Essentially I have a gravity variable which is applied to the player on the canvas (which works fine) and an accelerate function for up/down movement.</p>
  <p>I need to be able to tap the screen and have the &quot;player&quot; jump, then fall back down. so far I have:</p>
  <pre><code>document.addEventListener
  (“touchstart”,jump) 
  function jump() {
   accelerate(-0.5);
  }
  
  document.addEventListner
  (&quot;touchend”,fall)
  function fall() {
   accelerate(0.4)
  }
  </code></pre>
  <p>I might not have remembered what I wrote exactly, but the above code works for rising and falling, the problem however is if the user <em>holds</em> the screen, the player will just keep rising. Now obviously logically this is to be expected but I want more of a tap screen to jump type thing</p>
  <p>so is there a way to have the accelerate run once when the user taps the screen, perhaps for a set duration then stops, until the screen is tapped again?</p>
  <p>sorry for the long post</p>