ok this is just getting me ticked i see no reason this code is malfunctioning but here it is
vector<Enemy*> V_Enemys;
string Enemy_List[0]= "Enemy_1.bmp";
const char* Enemy_List_C;
SDL_Surface* I_Enemy=NULL;
string Master_Enemy_Files[] = {"Enemy_One.txt"};
//later in code
for(int i=-1; i < One->Enemy_Vector.size(); i++)
{
Enemy_List_C = Enemy_List[0].c_str();
I_Enemy = SDL_LoadBMP(Enemy_List_C);
Enemy* New_Enemy = new Enemy(Master_Enemy_Files,50,50,&V_Enemys,0);
delete New_Enemy;
if(V_Enemys == NULL)
{
asprintf(&msg,"enemy creation failed",SDL_GetError ());
};
TempRectBlit(I_Enemy,screen,V_Enemys->R_Enemy);
};
thats the main file heres the Enemy constructor that is being called
:
Enemy::Enemy(string File_Name[], int x, int y,vector<Enemy*> *V_Enemy,int NewID)
{
this->ID = NewID;
this->FileName = File_Name[ID].c_str();
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 an array;
fin >> this->Speed;
fin.close();
V_Enemy->push_back(this);
};
thanks
edit oo gosh i do that alot heres your info
error (runtime): Image isnt showed at coordinanths(50,50) as it should be it isnt showed at all, all other images are shown everything else works fine; c++ dev-cpp
[Edited by - raptorstrike on November 10, 2004 8:58:49 PM]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie