PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

using actorpool

hello
How to use this class function AActorPool()?
and what is the use?
thanx
Ehm yes, this is an undocumented yet very cool class. If you are already using actors, that is. An actor is an object that can do certain actions autonomously. There is one example in EasyCE 2.0 / 1.6: The particle explosion. What you do is this: First, you instantiate and initialize the actor. Then, for each frame, you call 'update' on it. That updates the actor. :) As soon as update returns 'false', the actor is 'done' and you can savely delete it. To create your own actor, simply subclass the AActor class and implement the pure virtuals.

The actor pool makes managing these actors even simpler. You add a couple of actors to the pool, and once a frame you call 'update' for the pool. That updates all the actors, and better, deletes the ones that are done. This way you can add dynanic stuff on-the-fly to the pool and update them automatically with a single call (without keeping track of all the individual actors), and they will even get deleted when ready.

It's really great for games. :)

- Jacco.
laurnet · 13 Mar 2002, 16:25 UTC — pool
ah yes! ,it can be really usefull to manage actors ,but now there is just one "standard" actor(the explosion class)
are you going to create some other cool actor like that?
Hm, the particle thingy is just an example. I use it a lot for cyclic animations. Check out the atoms in MeltDown. They are all in a single actorpool; to update the animations for the board, I can use a single call. Greatly simplifies game design, and it's VERY easy to extend. I added sparks floating along the grid lines, glowing spots behind the atoms, particle explosions, atom splitting anims, and all of these require very little code. The coolest thing is that basically you only have to fire the actor; after that it gets updated and deleted automatically.