moving updatign of player state to Player class