this won' appear on the screen until drawboard(has been called to draw it to the displaysurf surface object (which is done on line and pygame display update(is called to draw the display surface object on the actual computer screen (which is done on line at the end of the game loopclicking on the buttons checkforquit( for event in pygame event get()event handling loop if event type =mousebuttonup spotxspoty getspotclicked(mainboardevent pos[ ]event pos[ ] if (spotxspoty=(nonenone) check if the user clicked on an option button if reset_rect collidepoint(event pos) resetanimation(mainboardallmovesclicked on reset button allmoves [ elif new_rect collidepoint(event pos) mainboardsolutionseq generatenewpuzzle( clicked on new game button allmoves [ elif solve_rect collidepoint(event pos) resetanimation(mainboardsolutionseq allmovesclicked on solve button allmoves [before going into the event loopthe program calls checkforquit(on line to see if any quit events have been created (and terminates the program if there havewhy we have separate function (the checkforquit(functionfor handling the quit events will be explained later the for loop on line executes the event handling code for any other event created since the last time pygame event get(was called (or since the program startedif pygame event get(has never been called beforeif the type of event was mousebuttonup event (that isthe player had released mouse button somewhere over the window)then we pass the mouse coordinates to our getspotclicked(function which will return the board coordinates of the spot on the board the mouse release happened the event pos[ is the coordinate and event pos[ is the coordinate if the mouse button release did not happen over one of the spaces on the board (but obviously still happened somewhere on the windowsince mousebuttonup event was created)then getspotclicked(will return none if this is the casewe want to do an additional check to