-
Why does my game run slow after a while?
It's a small arcade type game. All shots are unloaded. All enemies are unloaded after they are hit. There's only 2 for loops in the bullet mc to check if its hitting any of my 2 enemies. I mean, I can't think of anything else that is causing this. I've never had this problem before.
any suggestions?
-
Senior Member
Some array growing constantly?
-
There are tons of threads on here about optimizing code.
This is from the main page: http://board.flashkit.com/board/showthread.php?t=780650
But, you say that the for loops are in the bullet movieclip? It'd be best to have one main loop on the main timeline that iterates over all active bullets.
-
ya I do all my code in frame code. I meant, I have the bullet mc code in its time line, you know.
nice thread btw,
but actually I think the problem is my particle explosion effect.
lemme test something...
EDIT: yup, I was just reducing the alpha of the particles, and not unloading them. Problem solved!
Last edited by DeadRiver; 12-05-2008 at 09:45 AM.
-
Intermediate Game Dev
Are you unloading the bullets using removeMovieClip(target), or unloadMovie(target)?
Needs an update...
-
Zombie Coder
Most likely you're not removing your particles properly. What are you using movieclips or bitmap data?
Run through debug and check your variables
-
I use, this.unloadMovie();
should I be doing something else?
-
Intermediate Game Dev
^Yep, for some reason the stuff stays in the memory. For a complete unload, use
PHP Code:
removeMovieClip(target);
Needs an update...
-
oh, I never knew the difference, thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|