If you are referring to the delay between scaleX=-1/1
and the x-movement:
This has nothing to do with CreateJS(or any other JS framework) this is the way of browsers dispatching keydown events.
Try for example pressing a key in a text-input, you will notice that at first the character you pressed will appear immediatly, but only after a delay of a couple milliseconds the pressed key will cause additional characters to appear. This is to prevent the system from accidentally typing a character multiple times when the used only intended to type just one character.
Solution: To solve this, just set a flag whenever a certain key is keydown
and unset the flag on keyup
. For example you can use a global object pressedKeys
and whenever a
is pressed you set pressedKeys.a = true;
and onkeyUp -> pressedKeys.a = false;
then in your handleTick
you check if a
or d
is set to true
and call the according method moveRight/moveLeft
if so.