Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12259


Ignore:
Timestamp:
Mar 28, 2019, 3:47:15 PM (5 years ago)
Author:
rueegseb
Message:

distinguish the different Ghost when the Ghost is not moving

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

Legend:

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

    r12252 r12259  
    119119            if(!(abs(this->actuelposition.z-target_z)<0.5)) {
    120120                velocity = Vector3(0,0,-sgn(this->actuelposition.z-this->target_z));
    121                 move(dt, actuelposition, velocity);
     121                move(dt, actuelposition, newGoal, velocity);
    122122            }   
    123123            if(!(abs(this->actuelposition.x-target_x)<0.5)){
     
    126126            }
    127127        }
     128
     129        else{
     130            while (lockmove){};
     131            lockmove=true;
     132
     133            if(this.colour=1){
     134                //calculate new goal
     135
     136            }
     137
     138            else if(this.colour=2){
     139
     140            }
     141
     142            else if(this.colour=3){
     143
     144            }
     145
     146            else if(this.colour=4){
     147
     148            }
     149
     150            getShortestPath(actuelposition, goal_x, goal_z)
     151            //setnewTarget
     152        }
     153        /*
    128154        //Check on which position the ghost has arrived and set new target
    129155         else{
     
    338364                lockmove = false;
    339365            }
    340        
     366        */
    341367    }
    342368
  • code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h

    r12252 r12259  
    7373            Vector3 actuelposition;
    7474            bool ismoving = false;
    75             int target_x = 0;
     75            int target_x = 0;   // next step
    7676            int target_z = 0;
     77            int goal_x = 0;     // faraway goal to dertmine the direction of the target
     78            int goal_z =0;   
     79
    7780            bool lockmove = false;
    7881            int colour=0;
Note: See TracChangeset for help on using the changeset viewer.