move main loop into Game class