pygame quit( sys exit( def waitforplayertopresskey() while true for event in pygame event get() if event type =quit terminate( if event type =keydown if event key =k_escapepressing escape quits terminate( return def playerhashitbaddie(playerrectbaddies) for in baddies if playerrect colliderect( ['rect']) return true return false def drawtext(textfontsurfacexy) textobj font render(text textcolor textrect textobj get_rect( textrect topleft (xy surface blit(textobjtextrect set up pygamethe windowand the mouse cursor pygame init( mainclock pygame time clock( windowsurface pygame display set_mode((windowwidthwindowheight) pygame display set_caption('dodger' pygame mouse set_visible(false set up fonts font pygame font sysfont(none set up sounds gameoversound pygame mixer sound('gameover wav' pygame mixer music load('background mid' set up images playerimage pygame image load('player png' playerrect playerimage get_rect( baddieimage pygame image load('baddie png' show the "startscreen drawtext('dodger'fontwindowsurface(windowwidth )(windowheight )