we've built our ship and fleet of aliensbut when the bullets reach the aliensthey simply pass through because we aren' checking for collisions in game programmingcollisions happen when game elements overlap to make the bullets shoot down alienswe'll use the method sprite groupcollide(to look for collisions between members of two groups detecting bullet collisions we want to know right away when bullet hits an alien so we can make an alien disappear as soon as it' hit to do thiswe'll look for collisions immediately after updating bullet' position the sprite groupcollide(method compares each bullet' rect with each alien' rect and returns dictionary containing the bullets and aliens that have collided each key in the dictionary is bulletand the corresponding value is the alien that was hit (we'll use this dictionary when we implement scoring system in use this code to check for collisions in the update_bullets(functiongame_ functions py def update_bullets(aliensbullets)"""update position of bullets and get rid of old bullets ""--snip-check for any bullets that have hit aliens if soget rid of the bullet and the alien collisions pygame sprite groupcollide(bulletsalienstruetruethe new line we added loops through each bullet in the group bullets and then loops through each alien in the group aliens whenever the rects of bullet and alien overlapgroupcollide(adds key-value pair to the dictionary it returns the two true arguments tell pygame whether to delete the bullets and aliens that have collided (to make high-powered bullet that' able to travel to the top of the screendestroying every alien in its pathyou could set the first boolean argument to false and keep the second boolean argument set to true the aliens hit would disappearbut all bullets would stay active until they disappeared off the top of the screen we pass the argument aliens in the call to update_bullets()alien_ invasion py start the main loop for the game while truegf check_events(ai_settingsscreenshipbulletsship update(gf update_bullets(aliensbulletsgf update_aliens(ai_settingsaliensgf update_screen(ai_settingsscreenshipaliensbullets