Changeset 582 for experiments/frams
- Timestamp:
- 08/18/16 14:41:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/foraminifera/data/scripts/foraminifera.expdef
r581 r582 525 525 } 526 526 527 function fence(pos, zone) 527 function fence(pos, zone) //TODO consider sizes (bboxes) of creatures and nutrients consistently throughout this expdef 528 528 { 529 529 return Math.min(Math.max(0,pos),World.wrldsiz); … … 532 532 function foramMove(cr) 533 533 { 534 //TODO moving inside sediment?535 536 534 //adjustment in z axis 537 535 var change_direction = 0; 538 536 var new_x = fence(cr.pos_x, getZoneRange(cr, 1)); 539 var new_y = fence(cr.pos_y, getZoneRange(cr, 1));537 var new_y = fence(cr.pos_y, getZoneRange(cr, 1)); 540 538 541 539 if ((new_x != cr.pos_x) || (new_y != cr.pos_y) || (cr.data->lifeparams->dir_counter >= int(secToSimSteps(ExpProperties.dir_change_sec)))) … … 544 542 } 545 543 546 cr.moveAbs(new_x, new_y, -cr.getPart(cr.numparts-1).sx); 544 cr.moveAbs(new_x, new_y, -cr.getPart(cr.numparts-1).sx); //place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber) 547 545 548 546 //are there any nutrients in zone 1 or 2? … … 780 778 var nut = Populations[2].add("//0\nm:Vstyle=nutrient_visual\np:sh=2,sx="+nutsize+",sy="+nutsize+",sz="+nutsize+",ry=1.5,vr=0.0,1.0,0.0"); 781 779 cr.data->reticulopodiacreature = nut; 782 nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, -nutsize); 780 nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, -nutsize); //TODO replace -1.5 with the properly calculated value, now nutsize=1, cr.size=0.28284271 783 781 } 784 782 }
Note: See TracChangeset
for help on using the changeset viewer.