Changeset 12323 for code/branches/3DPacman_FS19/src/modules/pacman
- Timestamp:
- Apr 25, 2019, 2:45:27 PM (6 years ago)
- Location:
- code/branches/3DPacman_FS19/src/modules/pacman
- Files:
-
- 3 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 -
code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.cc
r12322 r12323 711 711 else if(findpos(actuelposition,possibleposition[59])){ 712 712 adjacentVertices[0]=&listOfVerticesP2[58]; //graphVertex(possibleposition[58]); 713 adjacentVertices[1]=&listOfVerticesP2[ 59]; //graphVertex(possibleposition[59]);713 adjacentVertices[1]=&listOfVerticesP2[60]; //graphVertex(possibleposition[59]); 714 714 adjacentVertices[2]=&listOfVerticesP2[63]; //graphVertex(possibleposition[63]); 715 715 } -
code/branches/3DPacman_FS19/src/modules/pacman/PacmanRed.cc
r12322 r12323 45 45 46 46 for(int u=0; u < 67; u++){//always check if player passed a point 47 if(jeanfindpos(this->getPlayerPos(), possibleposition[u])){ 48 this->lastPlayerPassedPoint=possibleposition[u]; 49 } 47 //if(possibleposition[u]!=Vector3(0,10,15)){ 48 if(jeanfindpos(this->getPlayerPos(), possibleposition[u])){ 49 //if(!findpos(possibleposition[u],Vector3(0,10,15))){ 50 this->lastPlayerPassedPoint=possibleposition[u]; 51 } 52 //} 53 //} 50 54 } 51 55 … … 125 129 std::cout<<this->actuelposition<<endl;*/ 126 130 131 //if(!findpos(pointInFrontOfPlayer, Vector3(0,10,15))){ 127 132 nextMove(lastPlayerPassedPoint, pointInFrontOfPlayer); 133 //} 128 134 std::cout<<"ogslodm"<<endl; 129 135 }
Note: See TracChangeset
for help on using the changeset viewer.