📜  如何从类 pygame 中删除对象 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:52.293000             🧑  作者: Mango

代码示例1
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