Squeezing extra performance

I have been working on a scrolling shooter game with some particle effects for some time, mainly to develop my AS3 knowledge. I discovered many particle effect tutorials and got a bit special effects-happy on the screen. It looks really cool, there are two particle systems running at the same time and I believe I have optimized these as much as I can.

The other side of things (where I think I may be able to gain performance) is the player, lazers and enemies which are movie clips. I have a player one, lazer one and enemy one with different frames representing different types of each (all the frames are just bitmaps dragged from the library to the stage). I the game will run up to about 100fps on my desktop but sometimes drops to as low as 20fps on my laptop (which is still fairly mid-range as laptops go). My goal is to bump this up to 30 without comprimising on my particle effects too much (without all the other stuff going on game-wise, the laptop can handle the particle effects up to about 40fps).

In order to increase performance I need to understand more about how flash deals with movie clips and its dificult to find definitive answers. For example, I have all of my enemies that are currently on the screen in an array, when they die they get moved to a different array and re-used so I only ever create as many as are visible at one time. But I have several options when removing them visibly, I could set their visibility to false and leave them on the stage exactly where they died, setting to true and moving into posistion when recycling, I could removeChild and then addChild when recycling them, I could simply move them off the side of the screen so they cannot be seen. (Note, with all of these options the actual enemy that was originally created is moved in and out of an active array so even if its still visible, it wont be looped through in any onEnterFrame code that I have written).

Im not looking for a particluar exact solution, just any ideas about where to scrape more performance out. Someone mentioned that lists will perform better than arrays in large sizes, I have never used lists before, perhaps they would be best suited in the particle systems?

I have also considered that the best option may be to scrap all of my movieclips altogether and just bring enemies, player and lazers into a third and final particle system on top of the others. I dont know if this would be more or less difficult for the computer but if I did that it would seem like I was then completely side-tracking everything I have ever done in a flash project - draw something, convert to movieClip, code movieClip :stuck_out_tongue:

Oh there was something else, someone may be able to answer this. I have a movie clip that is exported for AS, it is the base for the “enemy” class. It contains 10 frames, each with a different picture of an enemy (all different sizes too). When an enemy is created or recycled it is told what frame to go to. Is flash having to do extra work in the background by having to deal with 10 frames even though im only using one? I am not coding for mobile devices so I dont really care about using a few extra mb of ram as the enemies are created. Its the processor that I want to keep sweet.

Thanks for reading