In many modern top-down view games, such as The Legend of Zelda: A Link to the Past , players have great freedom of movement in that they can move in any of the...
floor((((Player.Angle + 22.5) % 360) / 45))
You will need to number your animations from 0 to 7. This is a really late response, I know, but maybe it'll help others who have the same question!