- Timestamp:
- Nov 23, 2011, 4:06:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formation/src/orxonox/controllers/Masterable.cc
r8943 r8948 59 59 static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7; 60 60 static const int RADIUS_TO_SEARCH_FOR_MASTERS = 20000; 61 static const int FORMATION_LENGTH = 1 30;61 static const int FORMATION_LENGTH = 110; 62 62 static const int FORMATION_WIDTH = 110; 63 63 static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy … … 86 86 this->speedCounter_ = 0.2f; 87 87 this->targetPosition_ = Vector3::ZERO; 88 88 //this->team_=-1; 89 89 this->target_.setCallback(createFunctor(&Masterable::targetDied, this)); 90 90 } … … 319 319 if (distance < 40) 320 320 { 321 this->getControllableEntity()->moveFrontBack(0. 8f*SPEED_MASTER);321 this->getControllableEntity()->moveFrontBack(0.2f*SPEED_MASTER); 322 322 323 323 } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER); … … 444 444 this->state_ = MASTER; 445 445 this->myMaster_ = 0; 446 orxout(debug_output) << "search new master: no master found, but teammates"<< endl; 446 447 } 447 448 } … … 588 589 if (this->state_==FREE) 589 590 { 590 float minDistance=RADIUS_TO_SEARCH_FOR_MASTERS; 591 /* 592 float minDistance=(float)RADIUS_TO_SEARCH_FOR_MASTERS; 591 593 Masterable* bestMaster=NULL; 592 594 … … 639 641 this->slaves_.clear(); 640 642 this->myMaster_=0; 643 orxout(debug_output) << this << "no formation found!, empty formation"<< endl; 641 644 return; 642 645 } 643 } 644 645 if (this->state_==SLAVE) 646 { 646 */ 647 searchNewMaster(); 648 } 649 650 if (this->state_==SLAVE) //become master of this formation 651 { 647 652 this->slaves_=myMaster_->slaves_; 648 653 this->myMaster_->slaves_.clear();
Note: See TracChangeset
for help on using the changeset viewer.