createPlayer function

moved part of main into a fuunction in the game class