Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12326


Ignore:
Timestamp:
May 2, 2019, 1:00:11 PM (5 years ago)
Author:
peterf
Message:

bug fix

Location:
code/branches/3DPacman_FS19/src/modules/pacman
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.cc

    r12325 r12326  
    260260       
    261261    //(optional parameter) pointToAvoidP1 is a point that cannot be considered
    262 
     262       
    263263
    264264    graphVertex listOfVerticesM[67]; //our list of all possible graphs
     
    619619                adjacentVertices[0]=&listOfVerticesP2[35]; //graphVertex(possibleposition[35]);
    620620                adjacentVertices[1]=&listOfVerticesP2[43]; //graphVertex(possibleposition[43]);
     621                adjacentVertices[2]=&listOfVerticesP2[40]; //error meuh
    621622                       }
    622623            else if(findpos(actuelposition,possibleposition[42])){
     
    628629                adjacentVertices[0]=&listOfVerticesP2[41]; //graphVertex(possibleposition[41]);
    629630                adjacentVertices[1]=&listOfVerticesP2[46]; //graphVertex(possibleposition[46]);
     631                adjacentVertices[2]=&listOfVerticesP2[42]; //error meuh
    630632                       }
    631633            else if(findpos(actuelposition,possibleposition[44])){
     
    12191221
    12201222                    }
    1221         std::cout<<"bra"<<frontPoint<<endl;
    12221223                }
    12231224
     
    12271228            }
    12281229    else{
    1229         std::cout<<frontPoint<<endl;
     1230        //std::cout<<frontPoint<<endl;
    12301231        return frontPoint;
    12311232            }
     
    14331434                adjacentPositions[0]=positionArray[35]; //graphVertex(possibleposition[35]);
    14341435                adjacentPositions[1]=positionArray[43]; //graphVertex(possibleposition[43]);
     1436                adjacentPositions[2]=positionArray[40];  //error
    14351437                       }
    14361438            else if(findpos(actuelposition,possibleposition[42])){
     
    14421444                adjacentPositions[0]=positionArray[41]; //graphVertex(possibleposition[41]);
    14431445                adjacentPositions[1]=positionArray[46]; //graphVertex(possibleposition[46]);
     1446                adjacentPositions[2]=positionArray[42]; //error
    14441447                       }
    14451448            else if(findpos(actuelposition,possibleposition[44])){
     
    15141517            else if(findpos(actuelposition,possibleposition[59])){
    15151518                adjacentPositions[0]=positionArray[58]; //graphVertex(possibleposition[58]);
    1516                 adjacentPositions[1]=positionArray[59]; //graphVertex(possibleposition[59]);
     1519                adjacentPositions[1]=positionArray[60]; //graphVertex(possibleposition[60]); //error 59
    15171520                adjacentPositions[2]=positionArray[63]; //graphVertex(possibleposition[63]);
    15181521                          }
  • code/branches/3DPacman_FS19/src/modules/pacman/PacmanPink.cc

    r12325 r12326  
    3636
    3737        this->actuelposition = this->getPosition();
     38        //std::cout<<this->actuelposition<<endl;
    3839
    3940
     
    4647        int directionV = findPlayerTravDir (lastPlayerPassedPoint, this->getPlayerPos());
    4748        this->pointInFrontOfPlayer=frontPosition(); //getPointInFrontOfPacman(lastPlayerPassedPoint, directionV);
    48         std::cout<<this->pointInFrontOfPlayer<<endl;
    49         std::cout<<this->lastPlayerPassedPoint<<endl;
     49        //std::cout<<this->pointInFrontOfPlayer<<endl;
     50        //std::cout<<this->lastPlayerPassedPoint<<endl;
     51
     52        Vector3 pinkPos=Vector3(this->target_x, 10, this->target_z);
     53        //std::cout<<pinkPos<<endl;
    5054       
    5155        //Stop, if target arrived
     
    8791            lockmove = true;
    8892
    89             Vector3 pinkPos=Vector3(this->target_x, 10, this->target_z);
     93            //Vector3 pinkPos=Vector3(this->target_x, 10, this->target_z);
     94            //std::cout<<pinkPos<<endl;
    9095
    9196            //int directionV = findPlayerTravDir (lastPlayerPassedPoint, this->getPlayerPos());
     
    114119        Vector3 nextTarget;
    115120
     121        std::cout<<this->actuelposition<<endl;
     122        std::cout<<pinkPosP<<endl;
     123        std::cout<<playerPos<<endl;
     124        std::cout<<pointToAvoidP11<<endl;
     125        std::cout<<this->getPlayerPos()<<endl;
     126
    116127        if(playerPos==pointToAvoidP11){ //SIGSEV if playerPos==pointToAvoidP11 otherwise
    117128            nextTarget = getShortestPath(pinkPosP, playerPos);
    118129        }
     130        /*else if(pinkPosP==pointToAvoidP11){
     131            nextTarget=getShortestPath(pinkPosP, playerPos);
     132        }*/
    119133        else{
     134            //bugs here
     135            std::cout<<"msjiowjqiq"<<endl;
    120136        nextTarget = getShortestPath(pinkPosP, playerPos, pointToAvoidP11);
    121137        }
Note: See TracChangeset for help on using the changeset viewer.