title: Tricky sprite movement control with JavaScript/jQuery
body: <p>I'm currently trying to figure out how to animate the sprite properly without the help of extra libraries other than jQuery. <a href="http://kesun.github.io/temp/temp.html" rel="nofollow">This is the live demo of what I have right now.</a></p>
  
  <p>Controls: A for left, D for right, Space for jump, left mouse click to fire.</p>
  
  <p>Here's the problem: if I press the left and right keys really fast, the animation gets screwed up, try it yourself since It's kind of hard to describe the mess...</p>
  
  <p>My code is very scrappy right now because I'm playing around with many methods, so please bear with me for now. <a href="https://github.com/kesun/kesun.github.io/blob/master/temp/temp.js" rel="nofollow">Here's the JavaScript code</a>. If you want to see the html and css, they are in the same directory.</p>
  
  <p>$('#obj') is the object of the sprite.</p>