title: How to effectively handle object removal of objects with Corona SDK
body: <p>just starting to play around with the awesome corona sdk.</p>
  
  <p>I started building a simple shooter game.</p>
  
  <p>I have the following code : </p>
  
  <pre><code>-- Global Variables
  local shot = audio.loadSound('shot.mp3')
  local bg = display.newImage('bg.png')
  local shoot = {}
  local Main = {}
  local Init = {}
  
  local bullets = display.newGroup()
  
  function update()
      if(bullets.numChildren ~= 0) then
          for i = 1, bullets.numChildren do
              bullets[i].y = bullets[i].y - 8
              -- Destroy Offstage Bullets
  
              if(bullets[i].y &lt; (-bullets[i].height-5)) then
                  -- bullets[i]:removeSelf()
                  bullets:remove(bullets[i])
                  display.remove(bullets[i])
                  return
              end
          end
      end
  end
  -- Initialisation functions
  function Init ()
      display.setStatusBar(display.HiddenStatusBar)
      local movieclip = require('movieclip')
      local physics = require('physics')
      physics.start()
      physics.setGravity(0, 0)
  
  end
  
  function shoot:tap(e)
          for i = 1, 15 do
      local bullet = display.newImage('bullet.png')
      bullet.x = 150
      bullet.y = 470
      bullet.name = 'bullet'
      physics.addBody(bullet)
      bullets.insert(bullets, bullet)
      end 
  audio.play(shot)
  
  end
  
  -- Main routine
  function Main ()
      Init()
      bg:addEventListener('tap', shoot)
      Runtime:addEventListener('enterFrame', update)
  end
  
  Main()
  </code></pre>
  
  <p>For now it 'works'; but when the bullet comes of the screen the whole 'game' slows down and I can clearly see that each bullet is removed which slows down the game.</p>
  
  <p>Maybe i'm not doing it right; also tried the :removeSelf() function; same results.</p>