delete object pygame code example
Example: how to remove object from class pygame
A = []
while gameLoop:
...
a = Asteroid()
A.append(a)`
for i in A:
i.move()
if i.pos > dWidth:
del i # This doesn't remove the object
A = []
while gameLoop:
...
a = Asteroid()
A.append(a)`
for i in A:
i.move()
if i.pos > dWidth:
del i # This doesn't remove the object