line has for loop to iterate over each event object in the list returned by pygame event get(if the type attribute of the event is equal to the constant variable quitthen you know the user has closed the window and wants to terminate the program pygame generates the quit event (which was imported from the pygame locals modulewhen the user clicks on the close button (usually an xof the program' window it is also generated if the computer is shutting down and tries to terminate all the running programs for whatever reason the quit event was generatedyou should terminate the program the pygame quit(function pygame quit(sys exit(if the quit event has been generatedthe program should call both pygame quit(and sys exit(this has been the simple "hello world!program from pygame we've covered many new topics that we didn' have to deal with in our previous games even though the code is more complicatedthe pygame programs can also be much more fun than text games let' learn how to create games with animated graphics that move animation in this program we have several different blocks bouncing off of the edges of the window the blocks are different colors and sizes and move only in diagonal directions to animate the blocks (that ismake them look like they are movingwe will move the blocks few pixels over on each iteration through the game loop this will make it look like the blocks are moving around the screen source code of the animation program type the following program into the file editor and save it as animation py if you get errors after typing this code incompare the code you typed to the book' code with the online diff tool at animation py import pygamesystime from pygame locals import set up pygame