Wednesday, April 2, 2008

Ant Movement

This is the animation and the script that is moving our "ants" around and stopping them at the food source. The next step of the process is to have them start to return to back to the "colony"

Bloom and Neil

//ant script
//create food nodes//assign for loop to assign number of nodesfor($n=1;$n<6;$n++){//assign nodename="node" c="rand(-30,30);$d="rand(-30,30);move" j="1;$j<5;$j++){" name="ant" i="1;$i<300;$i++){" 10="="0)" a="{rand(-1,1),rand(-1,1),rand(-1,1),rand(-1,1)};" b="{rand(-1,1),rand(-1,1),rand(-1,1),rand(-1,1)};}" k="1;$k<5;$k++){" ant="ant" overlap="false;" h="1;$h<6;$h++){" ax =" eval(" az =" eval(" node="node" nx =" eval(" nz =" eval(" diffx =" abs((float)($ax-$nx));" diffz =" abs((float)($az-$nz));" overlap="true;" overlap="=">