building games with pygame the display surface the display surface (aka the displayis the most important part of pygame game it is the main window display of your game and can be of any sizehowever you can only have one display surface in many ways the display surface is like blank piece of paper on which you can draw the surface itself is made up of pixels which are numbered from , in the top left hand corner with the pixel locations being indexed in the axis and the axis this is shown belowthe above diagram illustrates how pixels within surface are indexed indeed surface can be used to draw linesshapes (such as rectanglessquarescircles and elipses)display imagesmanipulate individual pixels etc lines are drawn from one pixel location to another (for example from location , to location , which would draw line across the top of the above display surfaceimages can be displayed within the display surface given starting point such as the display surface is created by the pygame display set_mode(function this function takes tuple that can be used to specify the size of the display surface to be returned for exampledisplay_surface pygame display set_mode(( )this will create display surface (windowof by pixels once you have the display surface you can fill it with an appropriate background colour (the default is blackhowever if you want different background colour or want to clear everything that has previously been drawn on the surfacethen you can use the surface' fill(methodwhite ( display_surface fill(whitethe fill method takes tuple that is used to define colour in terms of redgreen and blue (or rgbcolours although the above examples uses meaningful name for the tuple representing the rgb values used for whitethere is of course no requirement to do this (although it is considered good practice