# FrameRate drop with MovieClips

**URL:** https://forum.kirupa.com/t/framerate-drop-with-movieclips/314782
**Category:** flash
**Created:** [October 8, 2010, 3:26pm UTC](https://forum.kirupa.com/t/framerate-drop-with-movieclips/314782 "2010-10-08T15:26:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coggia](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@coggia](https://forum.kirupa.com/u/coggia)
#### Post date: [October 8, 2010, 3:26pm UTC](https://forum.kirupa.com/t/framerate-drop-with-movieclips/314782/1 "2010-10-08T15:26:07Z")

</div>

Hello,

I’m currently trying to make a little game but I experience now some loss of framerate while adding “bullets” in the game

I’ll not enter in the full code source as it will take some time but basically  
I got a mainGame class, a Player class, and a bulletClass

the mainGame class contain the game loop working like this,  
A main timer checks:

-loop function of the Player class, checking if space is pressed,  
if it’s pressed a bullet is displayed with this line in the player class:

```auto

//main_class is the MainGame class and the container is the main display
main_class.container.addChild(new Bullet(x, y, rotation,main_class));
//then the bullet add itself in a _bulletArray of the Main Game class

```

-loop function of the bullet Class, for each bullet cointained in the \_bulletArray,  
it moves the bullet from some X, and if it’s out of view of the screen it destroying itself from the array and with a removeChild of the display list like this:

```auto

y += vy;
x += vx;
 
if (x > main_class.visX || y > main_class.visY || x < main_class.visXMin || y < main_class.visYMin)
	destroy(); //function that erase it from the array and from the display list

```

Problem is, if I shot more than 3 bullets i experience a drop of the FrameRate from 30 to 19, and once bullets are exiting the screen, the FPS get back to 30…

Is there a better solution to don’t have this kind of framerate loss?
