So I draw an object on the screen in the object x, objecty and increment objectx when I press the right arrow, moving the object to the right. The problem I am facing is that if I hold the right arrow key, it increases once, pauses, and then increases several times. My question is, why does he do this, and how can I make an object move without this initial pause?
$(window).keydown(function(e) { if(e.keyCode == 39) { objectx++; } }
Cains source share