Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2019, 2:45:27 PM (5 years ago)
Author:
peterf
Message:

continued brown

File:
1 edited

Legend:

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

    r12322 r12323  
    9292
    9393            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){
    96126                //no idea if 50 is large enough
    97127
     
    123153                std::cout<<"fleeing"<<endl;
    124154            }
    125         }
     155        }*/
    126156
    127157
     
    155185   
    156186        }
    157 
     187}
    158188
    159189
Note: See TracChangeset for help on using the changeset viewer.