- Timestamp:
- May 5, 2018, 12:12:36 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
r11944 r11945 51 51 52 52 this->actuelposition = this->getPosition(); 53 54 if(findpos(actuelposition, Vector3(0,-20,0))) 55 dontmove = true; 53 56 54 57 this->target_x = actuelposition.x; … … 414 417 } 415 418 419 void changewith(PacmanGhost* otherghost){ 420 otherghost->setPosition(this->getPosition()); 421 this->setPosition(0,-20,0); 422 otherghost->target_x = this->target_x; //Probleme bei parallelen Porzessen 423 otherghost->target_y = this->target_y; 424 otherghost->ismoving = this->ismoving; 425 426 this->dontmove = true; 427 otherghost->dontmove = false; 428 } 416 429 417 430 … … 422 435 423 436 bool PacmanGhost::findpos(Vector3 one, Vector3 other){ 424 if((abs(one.x - other.x)<0.5) && (abs(one. z - other.z)<0.5)) return true;437 if((abs(one.x - other.x)<0.5) && (abs(one.y - other.y)<0.5) && (abs(one.z - other.z)<0.5)) return true; 425 438 return false; 426 439 }
Note: See TracChangeset
for help on using the changeset viewer.