Public feed #380573

Anonymous

public text v1 · immutable
Raw Edit
·published 2007-03-04 04:24 UTC
rendered paste body
//! Do AI
void DoAI() {

for(int i=0; i<50; i++) { // for every ally
 for(int x=0; x<50; x++) { // for every enemy
  if(allies[i]->getAbsolutePosition().getDistanceFrom(enemies[x]->getAbsoultePosition) < 10) 
   { // theyre in range   
    // attack the enemy in range }
 }
}

for(int i=0; i<50; i++) { // for every enemy
 for(int x=0; x<50; x++) { // for every ally
  if(enemies[i]->getAbsolutePosition().getDistanceFrom(allies[x]->getAbsoultePosition) < 10) 
   { // theyre in range   
    // attack the enemy in range }
 }
}

//! end
}