refactored animation for player and addedanimation component for player