title: I'm coding a tower defense program in pygame. My code for spawning new waves is not working
body: <p>Here is an except of code from my program. The first block deals with shot + enemy collision, the second with mine + enemy collision, the third with actually spawning the new waves. Currently, the initial wave size spawns 10 enemies and the game loop does not generate new enemies after the first wave. </p>
  
  <pre><code>        # 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 &lt; 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 &lt; 1:
                          baddies.remove(a)
                          removed = True
                          break
  
          if removed:
              wavesize -= 1
              if wavesize &lt; 1:
                  loopcount += 1
                  wavesize = 10+(loopcount*5)
                  baddies = createNewWave(wavesize)
  </code></pre>