Coding the player animation