Master Maniac
06-10-2008, 07:45 PM
I have two questions.
1- managing Lweapons. their X and Y coordinates can be manipulated and checked like everything else, right?
like this:
if(LW_SWORD->X>=this->X&&LW_SWORD->X<=this->X+16&&LW_SWORD->Y>=this->Y&&LW_SWORD->Y==this->Y+16){
that would be valid, right?
2- the possibility of arrays. can the following be converted into an array? and if so, can someone do it for me? i haven't the faintest clue as to how to make arrays work.
if(enemy_exist){
if(enemy_max==1){
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==2){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==3){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==4){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==5){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==6){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==7){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==8){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==9){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==10){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
}
thanks for any help =)
1- managing Lweapons. their X and Y coordinates can be manipulated and checked like everything else, right?
like this:
if(LW_SWORD->X>=this->X&&LW_SWORD->X<=this->X+16&&LW_SWORD->Y>=this->Y&&LW_SWORD->Y==this->Y+16){
that would be valid, right?
2- the possibility of arrays. can the following be converted into an array? and if so, can someone do it for me? i haven't the faintest clue as to how to make arrays work.
if(enemy_exist){
if(enemy_max==1){
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==2){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==3){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==4){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==5){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==6){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==7){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==8){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==9){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
else if(enemy_max==10){
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
Screen->CreateNpc(e);
enemy_exist=false;
}
}
thanks for any help =)