hi there i have the following question.
I work at a little site. On this site you're able to "play" with the arrow keys. If I press the right arrow key the player walks right. Now I press the up arrow key to jump. So now i'm pressing the right and up key at the same time. No problem here.
If i stop pressing the up key the player stops to jump. Now I'm pressing only the right arrow key. But now the person stops walking. I have to release and press the right key again to let him walk. Is there a way that he walks further?
- $(document).keydown(function(key) {
- switch(key.keyCode) {
- case 38: // UP ARROW
- key.preventDefault();
- $(".point").playit("jump", 100,0);
- break;
-
- case 39: // RIGHT ARROW
- $(".point").playit("moveRight", 10);
- break;
-
- case 37: // LEFT ARROW
- $(".point").playit("moveLeft", 10);
- break;
- }
- });
Best regards,
hetrash