screenneedsredraw true while true if screenneedsredraw displaysurf fill(bgcolor displaysurf blit(settingsimage( , ) place the ink spot marker next to the selected difficulty if difficulty =easy displaysurf blit(spotimage( ) if difficulty =medium displaysurf blit(spotimage( ) if difficulty =hard displaysurf blit(spotimage( ) place the ink spot marker next to the selected size if boxsize =smallboxsize displaysurf blit(spotimage( ) if boxsize =mediumboxsize displaysurf blit(spotimage( ) if boxsize =largeboxsize displaysurf blit(spotimage( ) for in range(len(colorschemes)) drawcolorschemeboxes( pygame display update( screenneedsredraw false by defaultdon' redraw the screen for event in pygame event get()event handling loop if event type =quit pygame quit( sys exit( elif event type =keyup if event key =k_escape esc key on settings screen goes back to game return not (origdifficulty =difficulty and origboxsize =boxsize elif event type =mousebuttonup screenneedsredraw true screen should be redrawn mousexmousey event pos syntactic sugar check for clicks on the difficulty buttons if pygame rect( collidepoint(mousexmousey) difficulty easy email questions to the authoral@inventwithpython com