   Astroids and Tree's
 Does anyone know how to delete nodes from trees? Im trying to use a tree for spliting up astroid rocks when hit by a bullet. I was thinking of going through the tree and puting all nodes into a vector and deleting the node out of a vector. Then recunstructing the tree from the vector. I think that way would be way to slow. So if anyone has a better idea, please post. 
  << I was thinking of going through the tree and puting all nodes into a vector and deleting the node out of a vector. >>A Binary Tree? Nodes? Linked List?Just use an array, so easy. To insert 2 rocks you go through the array looking for the first 2 open spaces. Like so // insert 2 rocks at x,y of size/type tvoid InsertRocks(int x, int y, int t){   int i, inserted; inserted = 0; // reset how many inserted to zero for (i = 0; i < MAX_ASTEROIDS; i++)   { if (!Rocks[i].alive)  // if rock is dead (free), insert one here {    Rocks[i].alive = TRUE;    Rocks[i].size = t;    Rocks[i].shape = (rand()%5);    Rocks[i].xcenter = x + (rand()%21) - 10; // insert close to center    Rocks[i].ycenter = y + (rand()%21) - 10; // insert close to center    do    {  Rocks[i].xmove = (rand()%13) - 6;  // move -6 to +6  Rocks[i].ymove = (rand()%13) - 6;  // move -6 to +6  if (game_difficulty == DIFFICULTY_EASY)  {Rocks[i].xmove = (rand()%7) - 3;  // move -3 to +3Rocks[i].ymove = (rand()%7) - 3;  // move -3 to +3  }    } while (Rocks[i].xmove == 0 && Rocks[i].ymove == 0);   inserted++;    if (inserted == 2) return;} // end of if    } // end of for   } // END OF InsertRocksMAX_ASTEROIDS around 60 or 70 should do it. Why worry about pointers when you don''t have to?Vazteroids.cpp | EXEPhil P 