Alright, so I’m working on a game, and I’m actually doing pretty good for my first C++ project (was entangled in the much more visual flash/ as3, but the speed of C++ and openGl are awesome :D)
Out of everything crazy and broken that I’ve typed in this mess of text I call love, I need some help on something more basic.
I need to create multiple instances of classes like:
//Simple for statement
for(int i=0;i<500;i++){
//Declare an "enemy_sniperJoe with the name enemy_sniperJoe with a number.
enemy_sniperJoe enemy_sniperJoe //with i at the end, Don't know how to do this.
}
//end
I’ve heard that this is not the way to go. I think I’m supposed to store the classes in a vector and track them their.
like:
for(int i=0;i<500;i++){
//Declare an "enemy_sniperJoe with the name enemy_sniperJoe with a number.
enemy_sniperJoe enemy_sniperJoe //wouldn't this keep repeating the same class and break?
//Add this to a vector, don't know how to.
}
So, how should I go about this, how do I keep the class instances from being the same if I use the container method, and could someone just tell me what vectors are compared to arrays or something similar?
And yes, it is a Megaman Engine (sniperJoe is a dead giveaway :P)