add offsetPosition function in Player class.