KevinnFtw Posted May 23, 2014 Share Posted May 23, 2014 Hi, I'm creating a shooter game, and I've followed the 'Space Invaders' example.Everything is working but one thing, I would like to have infinite ammo, so CreateMultiple has to be infinite. It requires a value, so I don't know how to make it actually infinite. Basically what I want to do is create a couple bullets and recycle them over and over again. Any suggestions on how I could do so you never run out of bullets? Thanks in advance,Kevin Link to comment Share on other sites More sharing options...
Heppell08 Posted May 23, 2014 Share Posted May 23, 2014 Put 999 in there and do a kill out of bounds check. It would be pretty hard to not have infinite ammo after doing that. Link to comment Share on other sites More sharing options...
lewster32 Posted May 23, 2014 Share Posted May 23, 2014 Look at this example for how to 'pool' bullets. Object pooling is the phrase you're looking for. Link to comment Share on other sites More sharing options...
KevinnFtw Posted May 23, 2014 Author Share Posted May 23, 2014 Look at this example for how to 'pool' bullets. Object pooling is the phrase you're looking for. Very nice example! That did the trick for me, thanks alot :-) lewster32 1 Link to comment Share on other sites More sharing options...
Recommended Posts