2D movement algorithms

Hi =) does anyone have a hint on making a smooth 2D movement of a square moving with keyboard control (holding key to move, not continous movement) in a full screen animation? no matter how small i put the movement unit, it always looks kinda false.

Thanks for any help

JML from PT

I’m assuming with each key event, you are moving a certain distance?

Instead try to have a boolean flag for moving that gets set to true on the key down, and false on the key up. Then in the animation loop if it’s true, you move based on the time that’s elapsed since the last animation frame.