これは私のプログラムからのコードの例外です。最初のブロックはショット + 敵の衝突を処理し、2 番目は地雷 + 敵の衝突を処理し、3 番目は実際に新しい波を生成します。現在、最初の波のサイズは 10 の敵をスポーンし、ゲーム ループは最初の波の後、新しい敵を生成しません。
# baddie and shot collision
removed = False
for a in baddies[:]:
for b in shots[:]:
if a.imgRect.colliderect(b.imgRect):
shots.remove(b)
a.toughness -= 1
if a.toughness < 1:
baddies.remove(a)
removed = True
print str(wavesize)
break
# baddie and mine collision
removed = False
for a in baddies[:]:
for b in mines[:]:
if a.imgRect.colliderect(b.imgRect):
mines.remove(b)
a.toughness -= 1
if a.toughness < 1:
baddies.remove(a)
removed = True
break
if removed:
wavesize -= 1
if wavesize < 1:
loopcount += 1
wavesize = 10+(loopcount*5)
baddies = createNewWave(wavesize)