movement

I'm making a top-down game and i would like to know what would be the best way to have 8-directional movement (arrow keys) and how i would make it so he could also attack (z) and defend (x) in the direction he is facing. the animations he has are:
movement- left and right
standing still- " "
attack- " "
defend- " "
+1 to best answer
-master0500
movement- left and right
standing still- " "
attack- " "
defend- " "
+1 to best answer
-master0500