# Optimizing enterframe code for multiple mc's

**URL:** <https://forum.kirupa.com/t/optimizing-enterframe-code-for-multiple-mcs/151601>\
**Category:** flash\
**Created:** [June 16, 2005, 4:40pm UTC](https://forum.kirupa.com/t/optimizing-enterframe-code-for-multiple-mcs/151601 "2005-06-16T16:40:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominicaninja](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dominicaninja](https://forum.kirupa.com/u/dominicaninja)\
**Post date:** [June 16, 2005, 4:40pm UTC](https://forum.kirupa.com/t/optimizing-enterframe-code-for-multiple-mcs/151601/1 "2005-06-16T16:40:15Z")

</div>

Hi, this is my first post so sorry if this was previously asked. I am calling duplicateMovieClip to create the enemies in my game. Problem is, I experience slowdown when I have many enemies in the game (not necessarily on-screen). They each basically do hitTests on enterframe to see if they are touching a wall, ground, hero, or bullet. So I was wondering if there is a better way to do this. Is there somewhere else I should be putting the code? I know some people throw all the code into one frame in \_root and call attachMovieClip, but would that help me in my case? Any help is appreciated. Thanks.

edit: Hmm probably should’ve posted this in the game forum, sorry.
