This week, Tom ad I began to work on adapting spawning code for the bullet and the enemies. This involved implementing a system called “Object Pooling”.
To make sure we took the right approach with the enemy pooling, we tried multiple different ways to spawn the enemies. This included simply creating an object and then deleting it when it was shot. This would be a good method to use on a small scale, however when increased it puts a lot of unnecessary load onto the RAM. Pooling eliminates this load, preventing the game from lagging as both the enemies and the projectiles only need to be loaded in once. The system allows you to recycle the same objects from a pool, meaning that nothing extra needs to be added into the game as all you now need to do is change whether or not the object is visible. Below is the code I made for the pooling:
This first piece spawns in the enemies from the pool:

This piece of code is the object pooler script, which creates a pool of 20 enemies, which the game can then pick from, and then recycle:

Issues
When testing the pooling, I came across an issue regarding the enemies and projectiles going off in random directions when respawning into the game. This was a quick fix, but it took a while to locate the heart of the issue. Luckily, we are still on schedule, as shown on the production schedule below.

As shown above, we are all currently on track. I am very pleased with both myself and the teams progress so far.