bullets update(gf update_screen(ai_settingsscreenshipbulletsrun_game(we import group from pygame sprite at uwe make an instance of group and call it bullets this group is created outside of the while loop so we don' create new group of bullets each time the loop cycles note if you make group like this inside the loopyou'll be creating thousands of groups of bullets and your game will probably slow to crawl if your game freezes uplook carefully at what' happening in your main while loop we pass bullets to check_events(and update_screen(we'll need to work with bullets in check_events(when the spacebar is pressedand we'll need to update the bullets that are being drawn to the screen in update_screen(when you call update(on group vthe group automatically calls update(for each sprite in the group the line bullets update(calls bullet update(for each bullet we place in the group bullets firing bullets in game_functions pywe need to modify check_keydown_events(to fire bullet when the spacebar is pressed we don' need to change check_keyup_events(because nothing happens when the key is released we also need to modify update_screen(to make sure each bullet is redrawn to the screen before we call flip(here are the relevant changes to game_functions pygame_ functions py --snip-from bullet import bullet def check_keydown_events(eventai_settingsscreenshipbullets)--snip- elif event key =pygame k_spacecreate new bullet and add it to the bullets group new_bullet bullet(ai_settingsscreenshipbullets add(new_bullet--snip- def check_events(ai_settingsscreenshipbullets)"""respond to keypresses and mouse events ""for event in pygame event get()--snip-elif event type =pygame keydowncheck_keydown_events(eventai_settingsscreenshipbullets--snip- def update_screen(ai_settingsscreenshipbullets)--snip-redraw all bullets behind ship and aliens for bullet in bullets sprites()bullet draw_bullet(