animating the player according to the direction