In my game, I made a struct for "Enemy". Then I'll declare the struct for it:
Code: Select all
private:
struct Enemy{
int hp;
int x;
int y;
};
private:
Enemy enemy[ MAX_ENEMIES ];
For the time being I decided to make a 2nd global struct called:
Code: Select all
Global_Enemy{
velocity;
color[ 3 ];
count;
};
Is any of this making sense? Am I making things more complicated than necessary? I love the concept of structs because it keeps all relevant variables together, but I'm puzzled what to do when I need to change everything all at once without for-looping every time.