ok what this function is doing is (wow this is complicated) ok its reading in a text file that has some atributes of the object, then puting it at posistion 50,50 and placing that object in the back of a vector i think the problem is in the enemy constructor but ill post more code then that
void Level::run(int LVL_NUM,char* Master_Enemy_List[])
{
Enemy* New_Enemy = new Enemy(Master_Enemy_List[0],50,50,&this->Enemy_Vector);// master list is the .txt files that the constructor reads from
this->Enemy_Vector.push_back(New_Enemy);
this->Respawn++;
return;
};
Enemy::Enemy(char* File_Name, int x, int y,vector<Enemy*> *V_Enemy)
{
FileName = File_Name;
R_Enemy.x = x;
R_Enemy.y = y;
ifstream fin;
this->Name = "";
fin.open(FileName);
getline(fin, Name);
fin >> this->Life;
getline(fin, Image);
fin >> this->Weapon_ID; // index to a weapon array;
fin >> this->Speed;
fin >> this->ID;//index to enemy array
fin.close();
V_Enemy->push_back(this);
};
//part of source
char* Master_Enemy_Files[] = {"Enemy_One.txt"};
//later
I_Enemy = SDL_LoadBMP(Enemy_List[One->Enemy_Vector->ID]);
TempRectBlit(I_Enemy,screen,One->Enemy_Vector->R_Enemy);
One->Enemy_Vector->R_Enemy.x -= One->Enemy_Vector->Speed;
lol oops ok the problem is that this image is sapposed to render and move accross the screen briefly (yes thats it for now) and it isnt i ran to debugger and got 2 segmentation faluts but it wont point our were they are and since these are the only 2 functions that i have changed today its gotta be them
also when commenting out the run() it runs fine
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie