functionthen we want to call rungame()which will start game of wormy this function will return when the player' worm collides into wall or into itself and causes game over at that point we will show the game over screen by calling showgameoverscreen(when that function call returnsthe loop goes back to the start and calls rungame(again the while loop on line will loop forever until the program terminates separate rungame(function def rungame() set random start point startx random randint( cellwidth starty random randint( cellheight wormcoords [{' 'startx' 'starty} {' 'startx ' 'starty} {' 'startx ' 'starty} direction right start the apple in random place apple getrandomlocation(at the beginning of gamewe want the worm to start in random position (but not too close to the edges of the boardso we store random coordinate in startx and starty (remember that cellwidth and cellheight is the number of cells wide and high the window isnot the number of pixels wide and highthe body of the worm will be stored in list of dictionary values there will be one dictionary value per body segment of the worm the dictionary will have keys 'xand 'yfor the xy coordinates of that body segment the head of the body to be at startx and starty the other two body segments will be one and two cells to the left of the head the head of the worm will always be the body part at wormcoords[ to make this code more readablewe've set the head constant to on line so that we can use wormcoords[headinstead of wormcoords[ the event handling loop while truemain game loop for event in pygame event get()event handling loop if event type =quit terminate( elif event type =keydown if (event key =k_left or event key =k_aand direction !right