if playerrect colliderect( ['rect'])return true return false the playerhashitbaddie(function will return true if the player' character has collided with one of the baddies the baddies parameter is list of "baddiedictionary data structures each of these dictionaries has 'rectkeyand the value for that key is rect object that represents the baddie' size and location playerrect is also rect object rect objects have method named colliderect(that returns true if the rect object has collided with the rect object that is passed to it otherwisecolliderect(will return false the for loop on line iterates through each baddie dictionary in the baddies list if any of these baddies collide with the player' characterthen playerhashitbaddie(will return true if the code manages to iterate through all the baddies in the baddies list without detecting collision with any of themit will return false def drawtext(textfontsurfacexy) textobj font render(text textcolor textrect textobj get_rect( textrect topleft (xy surface blit(textobjtextrectdrawing text on the window involves few steps firstthe render(method call on line creates surface object that has the text rendered in specific font on it nextyou need to know the size and location of the surface object you can get rect object with this information from the get_rect(surface method the rect object returned on line from get_rect(has copy of the width and height information from the surface object line changes the location of the rect object by setting new tuple value for its topleft attribute finallyline blits the surface object of the rendered text onto the surface object that was passed to the drawtext(function displaying text in pygame take few more steps than simply calling the print(function but if you put this code into single function named drawtext()then you only need to call this function to display text on the screen initializing pygame and setting up the window now that the constant variables and functions are finishedstart calling the pygame functions that set up the window and clock post questions to