Fixed animation issue with switching direction.

Required a rewrite of movement code