My problem is that I want to create an object out of my entity class when the map array contains certain numbers:
void Draw_Map(int map[]){ for(int i = 0; i <= COLS; i++) { for(int t = 0; t <=ROWS; t++) { if(map[i*ROWS+t] == 1) { // Create an entity and push it onto a list. } } }}
Now I have lots of "1" in my array and everytime the nested for-loop detects a "1" a new object out of the entity class should be created. The same goes for 2, 3, 4, 5 etc.. But different object with other behaviours.
How would I do this? I can't just create (entity *Name = new entity; can I?
I hope you know what I mean. I really want to solve this one out.
Cheers!