360 degree 2d rotating

Hi guys and ladies!
I'm working on a game where you move 360 degrees and I used the code from the old asteroids demo. However I need to use the velocity = 0 in key up. And when I again start moving the animation and the direction aren't synced anymore. Someone can help me?
I'm working on a game where you move 360 degrees and I used the code from the old asteroids demo. However I need to use the velocity = 0 in key up. And when I again start moving the animation and the direction aren't synced anymore. Someone can help me?