1 Reply Latest reply on Apr 27, 2006 3:15 AM by Newsgroup_User

    reusing vs destroying targets in a shooting game

    Level 7
      In a shooting game targets keep coming and either get destroyed by the
      shooter or disapper outside the screen borders.
      In terms of performance what is more efficient - to reuse used targets or to
      destoy them using removeMovie() and then creating new usinf attachMovie()?


        • 1. Re: reusing vs destroying targets in a shooting game
          Level 7
          aa,

          > In a shooting game ... In terms of performance what is
          > more efficient - to reuse used targets or to destoy them
          > using removeMovie() and then creating new usinf
          > attachMovie()?

          It depends on the nature of the game. The fewer movie clips Flash has
          to manage at any time, the easier it is for Flash to update the screen
          (thus, smoother game play) ... so for a relatively slow-paced game,
          interrupted on occasion by sudden flurries of targets, removing used targets
          may be better.

          For a rapid-fire, no holds barred, constantly action-packed game, I
          would probably set used targets invisbile (MovieClip._visible) property,
          position them, then turn them visible again as needed.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."