0

Hey,

Is there anyway to control a volatile number of objects (don't know if I'm using the right term here... I mean when you don't know how many of an object you're going to have at any one time), like bullets in a shooter. If you have a bullet class, and you want to create a new object every time someone shoots, how would you go about it?

The only way I thought of was to figure out the maximum number of bullets there could be at once, then create an array with this many elements, and then fill it up and empty it out when a bullet is created or goes off screen. Is this the right way of going about it? Thanks.

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by VernonDozier
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.