drawing the screen displaysurf fill(bgcolordrawgrid(drawworm(wormcoordsdrawapple(appledrawscore(len(wormcoords pygame display update(fpsclock tick(fpsthe code for drawing the screen in the rungame(function is fairly simple line fills in the entire display surface with the background color lines to draw the gridwormappleand score to the display surface then the call to pygame display update(draws the display surface to the actual computer screen drawing "press keytext to the screen def drawpresskeymsg() presskeysurf basicfont render('press key to play 'truedarkgray presskeyrect presskeysurf get_rect( presskeyrect topleft (windowwidth windowheight displaysurf blit(presskeysurfpresskeyrectwhile the start screen animation is playing or the game over screen is being shownthere will be some small text in the bottom right corner that says --press key to play |rather than have the code typed out in both the showstartscreen(and the showgameoverscreen()we put it in this separate function and simply call the function from showstartscreen(and showgameoverscreen(the checkforkeypress(function def checkforkeypress() if len(pygame event get(quit) terminate( keyupevents pygame event get(keyup if len(keyupevents= return none if keyupevents[ key =k_escape terminate( return keyupevents[ key