How would you create a certain amount of objects based on user input? Like I have an enemy class and the player chooses how many enemies they want on the screen, how would I create those objects?

Thanks

Recommended Answers

All 3 Replies

Look up the 'new' operator.

Ok that makes them but gives them all the same name. So how would I give them each their own name so I can make them act on their own?

post some code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.