- Timestamp:
- Apr 25, 2019, 2:45:27 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.cc
r12322 r12323 92 92 93 93 Vector3 brownPos=Vector3(this->target_x, 10, this->target_z); 94 95 if(absoluteDistance(this->lastPlayerPassedPoint, this->actuelposition)<50){ 94 std::cout<<brownPos<<endl; 95 96 97 if(this->isFleeing==true){ 98 if(findpos(brownPos, Vector3(-215,10,-195))){ 99 this->isFleeing=false; 100 //Vector3 nextMoveP = getShortestPath(brownPos, this->lastPlayerPassedPoint); 101 //this->setNewTargetGhost(nextMoveP); 102 } 103 else{ 104 Vector3 nextMoveP = getShortestPath(brownPos, Vector3(-215,10,-195)); 105 this->setNewTargetGhost(nextMoveP); 106 } 107 108 } 109 else { 110 Vector3 arrayPlaNeig[4]; 111 112 findNeighboorPositions(this->lastPlayerPassedPoint, arrayPlaNeig, possibleposition); 113 if(isAdjacentToPlayerLastPastPoint(brownPos, arrayPlaNeig)){ 114 this->isFleeing=true; 115 } 116 else{ 117 Vector3 nextMove = getShortestPath(brownPos, this->lastPlayerPassedPoint); 118 setNewTargetGhost(nextMove); 119 } 120 121 } 122 std::cout<<this->isFleeing<<endl; 123 124 125 /*if(absoluteDistance(this->lastPlayerPassedPoint, this->actuelposition)<50){ 96 126 //no idea if 50 is large enough 97 127 … … 123 153 std::cout<<"fleeing"<<endl; 124 154 } 125 } 155 }*/ 126 156 127 157 … … 155 185 156 186 } 157 187 } 158 188 159 189
Note: See TracChangeset
for help on using the changeset viewer.