The rotate_entity function handles rotating the player. Change the calling of it from handle_movement so the player is only rotated when pressing A or D.