Recycle bullets - Multiple Firers
wij_man
Member Posts: 66
Hi,
I was just thinking about recycling my bullets rather than spawning. The issue I have is that I have up to 10 actors on the screen at once (any of 5 types of actor), all of which can have 10 bullets on the screen at once. It would be kind of tedious to number all my bullets from 0-99 but I have a way around that. The issue I have is that I don't really want 20 attributes for all of the various actors' locations. Given that I have multiple actor types it also means that I would have to alter the behaviour of each actor instance on each scene, which again is going to be a pain.
Does anyone have any ideas on a way around this? Also, if the most bullets that will be fired is 1k is it worth the extra effort, and what point does spawning start to slow down the game?
I was just thinking about recycling my bullets rather than spawning. The issue I have is that I have up to 10 actors on the screen at once (any of 5 types of actor), all of which can have 10 bullets on the screen at once. It would be kind of tedious to number all my bullets from 0-99 but I have a way around that. The issue I have is that I don't really want 20 attributes for all of the various actors' locations. Given that I have multiple actor types it also means that I would have to alter the behaviour of each actor instance on each scene, which again is going to be a pain.
Does anyone have any ideas on a way around this? Also, if the most bullets that will be fired is 1k is it worth the extra effort, and what point does spawning start to slow down the game?
Comments
Spawning and destroying would be the easiest way but GS just really can't handle all that action! From what I've seen, recycling is your best option and although it would be a pain to reference all those actor locations, it would be worth it to see your game perform better.
I would try out a few scenes with the recycled bullets to see how it affects performance first. If all is well, I'd finish the rest of the scenes. But sometimes even with recycled bullets, and again, depending on what else you have going on, you may experience unwanted performance issues. If that's the case, you'd have to tweak your game design a bit...maybe have less shooters on a scene at a time...etc.
Good luck!