toggling as what happens when you flip light switch on or offtoggling the light switch sets it to the opposite setting drawing the player on the window draw the block onto the surface windowsurface blit(playerstretchedimageplayerremember that the value stored in playerstretchedimage is surface object line draws the sprite of the player onto the window' surface object (which is stored in windowsurfacethe second parameter to the blit(method is rect object that specifies where on the surface object the sprite should be blitted the rect object stored in player is what keeps track of the position of the player in the window checking if the player has collided with cherries if player colliderect(food) foods remove(food player pygame rect(player leftplayer topplayer width player height playerstretchedimage pygame transform scale(playerimage(player widthplayer height) if musicplaying pickupsound play(this code is similar to the code in the previous programs but there are couple of new lines call the play(method on the sound object stored in the pickupsound variable but only do this if musicplaying is set to true (which means that the sound is turned onwhen the player eats one of the cherriesthe size of the player increases by two pixels in height and width on line new rect object that is pixels larger than the old rect object will be the new value of player while the rect object represents the position and size of the playerthe image of the player is stored in playerstretchedimage as surface object create new stretched image by calling pygame transform scale(be sure to pass the original surface object in playerimage and not playerstretchedimage stretching an image often distorts it little if you keep restretching stretched image over and overthe distortions add up quickly but by stretching the original image to the new sizeyou only distort the image once this is why you pass playerimage as the first argument for pygame transform scale(