--snip-the group bullets is passed to check_keydown_events( when the player presses the spacebarwe create new bullet ( bullet instance that we name new_bulletand add it to the group bullets using the add(methodthe code bullets add(new_bulletstores the new bullet in the group bullets we need to add bullets as parameter in the definition of check_ events(wand we need to pass bullets as an argument in the call to check_keydown_events(as well we give the bullets parameter to update_screen(at xwhich draws the bullets to the screen the bullets sprites(method returns list of all sprites in the group bullets to draw all fired bullets to the screenwe loop through the sprites in bullets and call draw_bullet(on each one if you run alien_invasion py nowyou should be able to move the ship right and leftand fire as many bullets as you want the bullets travel up the screen and disappear when they reach the topas shown in figure - you can alter the sizecolorand speed of the bullets in settings py figure - the ship after firing series of bullets deleting old bullets at the momentthe bullets disappear when they reach the topbut only because pygame can' draw them above the top of the screen the bullets actually continue to existtheir -coordinate values just grow increasingly negative this is problembecause they continue to consume memory and processing power ship that fires bullets