Hi there,
I am developing a game with the following rules:
-
The “enemy” objects are the same image.png file BUT their size are randomly created with different sizes (from 50,50 to 300,300)
-
Each “Enemy” is attach to Physics by addBody() in order to detected a collision.
-
A-lot of enemies are created during the games (Created and removed)
I want to use the pattern of Spawn Object (which means that you create a pool of objects and then during the game use the next available object from the pool).
The problem :
As the “Enemy” are created with random size and each object are attached to Physics how can I use the pattern of pooling of objects?
BTW - A solution to created all random objects and adding it to pool is not feasible as there will be a lot of objects (~200 or even more)
Thanks