PDA

View Full Version : optimizing large groups



npgames
September 1st, 2008, 04:51 PM
im making a zombie game and want to have a large number of zombies on the screen at one time, 50+, and so far im controlling them inside a while loop that goes through all of the zombies, and im curious if there is a faster way to control all the zombies at the same time. and also if using something besides movieclips would make a huge difference as well, i want to use the best methods to make the game run smoothly

Lou
September 1st, 2008, 05:41 PM
You should take a look at this thread about not using movieclips in games. If you have a bunch of movieclips on the stage at once, it will tend to bog down a bit.

http://www.kirupa.com/forum/showthread.php?t=276114&highlight=movieclip+games

npgames
September 1st, 2008, 06:08 PM
i looked through the first 3 pages, and collected a few ideas, and so would using just generic variables that each hold the info for each zombie, and then attach a picture each frame for each one. would that work?

ajcates
September 1st, 2008, 06:49 PM
I would have a zombie class, and inside it I would have code for controlling a zombie, then just have a bunch of zombie objects on the stage.

npgames
September 1st, 2008, 07:05 PM
would that be more effective than a while loop?

ArmoredSandwich
September 1st, 2008, 07:23 PM
would that be more effective than a while loop?

Not as much as stop using movieclips, but then again, nothing much is :)

npgames
September 1st, 2008, 07:44 PM
ok thx, ill see what i can do