Working game loop and game logic. Goes through all game conditions correctly, though the AI still acts pretty stupid