Python Forum
[PyGame] object has no attribute 'add_internal'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] object has no attribute 'add_internal'
#5
My bad.

class Star(pygame.sprite.Sprite):
   
        def __init__(self,ai_game):
            super().__init__()  OR  pygame.sprite.Sprite.__init__(self)
 
You can also get a two in one with:
def __init__(self, game):
        self.groups = game.your_sprite_group#, another group, another group........
        pg.sprite.Sprite.__init__(self, self.groups)
game is wherever you create the sprite from.
Reply


Messages In This Thread
RE: object has no attribute 'add_internal' - by michael1789 - Feb-24-2021, 06:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Attribute Error: object has no attribute djwilson0495 3 4,678 Jan-14-2021, 08:29 PM
Last Post: Larz60+
  beginner - object has no attribute gean 2 3,782 Nov-07-2019, 02:02 PM
Last Post: gean
  Tetris - AttributeError: 'list' object has no attribute 'y' abscorpy 6 6,699 Feb-28-2019, 05:20 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020