import pygame
pygame.init()
screen= pygame.display.set_mode((1000,600))
arr = []
for i in range(3):
arr.append(i)
print(i)
sprite = pygame.sprite.Group()
sprite.add(arr)
go = True
while go:
for event in pygame.event.get():
if event.type == pygame.QUIT:
go = False
0
0
1
2
Traceback (most recent call last):
File "D:\prog\Python\lib\site-packages\pygame\sprite.py", line 365, in add
self.add(*sprite)
TypeError: add() argument after * must be an iterable, not int
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\prog\Python\lib\site-packages\pygame\sprite.py", line 365, in add
self.add(*sprite)
File "D:\prog\Python\lib\site-packages\pygame\sprite.py", line 378, in add
sprite.add_internal(self)
AttributeError: 'int' object has no attribute 'add_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\down\Drag-n-Drop.py", line 11, in <module>
sprite.add(arr)
File "D:\un\Python\lib\site-packages\pygame\sprite.py", line 376, in add
elif not self.has_internal(sprite):
File "D:\un\Python\lib\site-packages\pygame\sprite.py", line 326, in has_internal
return sprite in self.spritedict
TypeError: unhashable type: 'list'