Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 12-12-2010, 03:44 PM   #1
Cardyak
Registered User
 
Join Date: Mar 2009
Posts: 3
Default [AS2] More efficient enemy coding?

Hello guys, I'm fairly new here.

I'm developing a small survival horror game, everything seems to work dandy, apart from major lag. I think I've traced this down to the fact the code for the enemies hit detection and physics, is in the enemy itself. So when I duplicate about 50 enemies for a high level, it obviously runs in each enemy instance.

Is there a way to use a for loop or function to run through all the enemies as and when they spawn? I've tried using onLoad/onEnterFrame without much success. I can post the code if need be.

I would very much appreciate some help.

~Cardyak
Cardyak is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:28 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.