1 decade ago by doobdargent
Hey guys,
for my current game, I'm using 2 entities pools. One for the bullets and one for the particles.
I was wondering if it was possible to merge both pools into one generic EntityPool that will manage instances of the Entity class.
To be able to do this, I need a way to transform an Entity to an EntityBullet (which extends Entity), and a way to transform an EntityBullet back to an Entity with default properties and methods.
How can I do that?
I thought of doing something like this to transform and Entity to an EntityBullet:
But doing it like this, am I not using a pool for nothing?
Thanks for any input!
Bastien.
for my current game, I'm using 2 entities pools. One for the bullets and one for the particles.
I was wondering if it was possible to merge both pools into one generic EntityPool that will manage instances of the Entity class.
To be able to do this, I need a way to transform an Entity to an EntityBullet (which extends Entity), and a way to transform an EntityBullet back to an Entity with default properties and methods.
How can I do that?
I thought of doing something like this to transform and Entity to an EntityBullet:
var entity = new ig.Entity(); entity = new EntityBullet();
But doing it like this, am I not using a pool for nothing?
Thanks for any input!
Bastien.