def drawLevel2(): # draw stuff ... # Replace True with your condition for # advancing to level three. Or perhaps at # this point you'd want to end the game if True: level = 3