In Flash Actionscript 3.0 how do I create smooth keyboard controls for player movement?
Posted
by Reid
on Stack Overflow
See other posts from Stack Overflow
or by Reid
Published on 2010-02-12T21:05:24Z
Indexed on
2010/05/09
19:58 UTC
Read the original article
Hit count: 184
I am a beginner in Flash Actionscript 3.0 programming. I am trying to create smooth keyboard controls for player movement in a game.
I'm currently using addEventListener(KeyboardEvent.KEY_DOWN) listening for a keyboard key press and then within the handler function moving a graphic by adding a number to its .x or .y property.
This creates a slow, sluggish jerk at the beginning. I know there's a smoother, more responsive way to do this but have no idea where to begin. Any help would be appreciated!
© Stack Overflow or respective owner