How to make an object point in its movement direction? (BGE) I tried to do it in with actuators, but so far either the animation gets stuck, or it hangs up on a direction if you let go of one of the keys. Help?

Edit: I added the logic I'm using so far. The actions are displaying one frame of the rotate animation, each frame is a different rotation. This was my workaround for the question above, but when I hold down and right, and let go of right, it stays in the same orientation but goes downwards. Is there any way I can either fix this setup, or is there a way I can make the object point in the direction it moves?

Edit #2: I changed the program, making a logic brick for each key, and another for each one not being pressed. It works, going left or right makes the block display the up/down frame but then quickly changes to the left/right frame. Also, The jumping doesn't seem to work moving diagonally, except when moving up and to the right. If you could take a look at the blend file and let me know what I did wrong, that would be great.
I made it diferent as you was doing it but i think its more easy this way.

Instead using animation i add 8 cubes rounding the cube player and make them vertex parented with no collition physics and add 8 edit object actuator set to track to for each cube.



Abd here the blend.