Wrote player logic.