Skip to main content
edited tags
Link
Source Link

How do I make multiple instances of an object?

In a game I am working on, I am having an issue with making the player's ship shoot multiple bullets. The bullets have individual X and Y coordinates and velocity for X and Y. When I press "SPACE" to shoot the bullet, only one comes out, and when I release the space bar, the bullet disappears. I want to make multiple bullets without having to make an array since the amount of shots would be limited to the array size.

How do I make multiple instances of an object with data without using an array?