Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Object Cycling

Author
Message
vibe runner
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: The Future
Posted: 8th Jun 2007 18:27 Edited at: 8th Jun 2007 18:37
If you want a billion functions to automate your object cycling.

This version has one array. In that array are groups. As you make objects you wish to recycle to assign them to a group (it's fine to just use one group). Whenever you need a reusable object you call a function, it'll activate and return an object if one's free. Whenever you've finished with an object call one of the kill functions. There are off-screen and time-based kill tools too.

I suspect as long as your numbers remain reasonable this is quick enough. The next version will have multiple arrays, each with groups. That should speed things, not that this seems laggy. Smaller arrays are quicker to search than large ones, and not all groups might be active at once; or you might want a very large but infrequently needed group, etc.



ta.
alucart13
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location:
Posted: 21st Jun 2007 19:20
umm......wow

Bring the fire, as I fall into oblivion I'll be thinking of you

Login to post a reply

Server time is: 2024-11-22 19:14:03
Your offset time is: 2024-11-22 19:14:03