void BeepOK() { int i; for (i=0; i<4; i++) { Bird(); DelaymSec(20); } }
void Beep(int sound) { if (sound == SOUND_ACK) { Bird2(); } else { Bird(); } //DelaymSec(50); }
Vector Bird::hunt(vector<Bird> birds) { Vector desired = Vector(); float range = this->sight_distance; Bird prey = Bird(); for(auto bird : birds) { if(this->isNeighbor(bird)) { float dist = this->pos.distance(bird.pos); if(dist<=range) { range = dist; prey = bird; } } } if(prey.id != -1) { desired.add(prey.pos); desired.add(prey.vel); desired = desired.diff(this->pos); } return desired; }