Pygame Typeerror: Update() Takes 1 Positional Argument But 2 Were Given
After analyzing my code for about 2-3 hours, I looked up the following links that were similar to my problem, which are provided below. But after recognizing what their issue was,
Solution 1:
Usually that error is because you are calling a method that just takes self
with an additional argument. In this case it looks like you are calling .update(bullet_list)
with something that is defined as def update(self)
and the implicit self in your method call is the first of the 2 positional args.
Quickly searching through your code and looking at the error you set
enemy_group = pygame.sprite.Group()
and then call enemy_group.add(explosion)
which isn't an Enemy
and i assume doesn't have a custom .update
defined on it.
in the future i'd recommend looking into pdb
.
Post a Comment for "Pygame Typeerror: Update() Takes 1 Positional Argument But 2 Were Given"