Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 20, 2019, 6:29:44 PM (5 years ago)
Author:
peterf
Message:

Red Pacman seems to work even better

File:
1 edited

Legend:

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

    r12316 r12317  
    8282            //nextMove(this->getPlayerPos(), redPos);
    8383
     84            int directionV = findPlayerTravDir (lastPlayerPassedPoint, this->getPlayerPos());
     85
    8486
    8587            if(this->actuelposition!=lastPlayerPassedPoint){
    86                 //std::cout<<this->target_x<<" "<<this->target_z<<endl;
    87                 std::cout<<redPos<<endl;
     88               
     89                std::cout<<this->getPlayerPos()<<endl;
    8890                std::cout<<this->lastPlayerPassedPoint<<endl;
    89                 //getShortestPath(Vector3(-215,10,-195),Vector3(70,10,-135));
    90                 //getShortestPath(redPos, lastPlayerPassedPoint);
     91                std::cout<<getPointInFrontOfPacman(lastPlayerPassedPoint, directionV)<<endl;
    9192            nextMove(redPos, lastPlayerPassedPoint);
    92             }/*
     93            }
    9394            else{// red pacman is at lastPlayerPassedPoint
    94             nextMove(this->getPlayerPos(), redPos);
    95             }*/
    9695
    97             //setNewTargetRed(Vector3(70,10,-85));
    98             //std::cout<<this->target_x<<" "<<target_z<<endl;
    99             //std::cout<<"meuh"<<endl;
    100             //std::cout<<this->actuelposition;
     96            //int directionV = findPlayerTravDir (lastPlayerPassedPoint, this->getPlayerPos());
     97
     98            Vector3 pointInFrontOfPlayer = getPointInFrontOfPacman(lastPlayerPassedPoint, directionV);
     99
     100            nextMove(redPos, pointInFrontOfPlayer);
     101
     102            //nextMove(this->getPlayerPos(), redPos);
     103            }
     104
    101105
    102106            lockmove=false; //NEVER FORGET THIS ONE !!!!!!!
Note: See TracChangeset for help on using the changeset viewer.