def hero_sprites(): global heroes global widow global cap global tony global thor global hawkeye global hulk widow = Widow() cap = Cap() tony = Tony() thor = Thor() hawkeye = Hawkeye() hulk = Hulk() heroes = pygame.sprite.Group() heroes.add(cap) heroes.add(widow) heroes.add(tony) heroes.add(thor) heroes.add(hawkeye) heroes.add(hulk)