Added code for player animation.