Partial conversion of the main game loop
The rest of the game loop converted over