Index: code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc	(revision 11979)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc	(revision 11992)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Oli Scheuss
+ *      Marc Dreher
  *   Co-authors:
- *      Damian 'Mozork' Frick
+ *      ..
  *
  */
@@ -62,5 +62,5 @@
     /**
     @brief
-        Destructor. Destroys controller, if present.
+        Destructor. Destroys ghost, if present.
     */
     PacmanGhost::~PacmanGhost()
@@ -71,5 +71,5 @@
     /**
     @brief
-        Method for creating a AutonomousDrone through XML.
+        Method for creating a ghost through XML.
     */
     void PacmanGhost::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -79,5 +79,5 @@
 
 
-
+    //All positions in the map, see documentation
     Vector3 possibleposition[] = {Vector3(20,10,245),Vector3(215,10,245),Vector3(215,10,195),Vector3(185,10,195),Vector3(135,10,195), //0-4
         Vector3(185,10,150),Vector3(135,10,150),Vector3(215,10,150),Vector3(215,10,105),Vector3(135,10,105), //5-9
@@ -97,5 +97,5 @@
     /**
     @brief
-        Defines which actions the AutonomousDrone has to take in each tick.
+        Defines which actions the ghost has to take in each tick.
     @param dt
         The length of the tick.
@@ -104,6 +104,4 @@
     {
         SUPER(PacmanGhost, tick, dt);
-
-        //setorientation
 
         this->actuelposition = this->getPosition();
@@ -340,4 +338,5 @@
     }
 
+    //Random choice of new target (not used in game, but useful)
     void PacmanGhost::setnewTarget(int firstdec){
         
@@ -352,4 +351,5 @@
     }
 
+    //Random choice of new target
     void PacmanGhost::setnewTarget(int firstdec, int seconddec){ 
     	   decision = rand()%2;
@@ -369,4 +369,5 @@
     }
 
+    //Random choice of new target
     void PacmanGhost::setnewTarget(int firstdec, int seconddec, int thirddec){
         
@@ -392,4 +393,5 @@
 	}
 
+    //Random choice of new target
     void PacmanGhost::setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec){
         
@@ -420,12 +422,13 @@
 	}
 
+    //Change this with other ghost
     void PacmanGhost::changewith(PacmanGhost* otherghost){
 
         while(lockmove){};
-        lockmove = true;
+        lockmove = true;    //Prevent change of target while ghost is changed
 
         otherghost->setPosition(this->getPosition());
         this->setPosition(0,-20,0);
-        otherghost->target_x = this->target_x;   //Probleme bei parallelen Porzessen
+        otherghost->target_x = this->target_x;   
         otherghost->target_z = this->target_z;
         otherghost->ismoving = this->ismoving;
@@ -437,8 +440,10 @@
     }
 
-
+    //Move ghost with rotation
     void PacmanGhost::move(float dt, Vector3 actuelposition, Vector3 velocity){
         if(!dontmove){
             this->setPosition(Vector3(actuelposition.x+speed*velocity.x*dt,10,actuelposition.z+speed*velocity.z*dt));
+        
+        //Rotate ghost in the direction of movement 
         if((abs(abs(velocity.x)-1)<0.1) && (abs(velocity.z-0)<0.1))
             if(velocity.x<0){
@@ -455,9 +460,9 @@
                  this->setOrientation(Quaternion(Radian(0), Vector3(0, 1, 0)));  
             }
-            this->getOrientation();
                      
      }
     }
 
+    //Check if there is a collision
     bool PacmanGhost::findpos(Vector3 one, Vector3 other){
        if((abs(one.x - other.x)<0.5) && (abs(one.y - other.y)<0.5) && (abs(one.z - other.z)<0.5)) return true;
@@ -465,4 +470,5 @@
     }
 
+    //Change ability to move
     void PacmanGhost::changemovability(){
         if(dontmove){
@@ -473,4 +479,5 @@
     }
 
+    //ResetGhost
     void PacmanGhost::resetGhost(){
     
@@ -484,4 +491,5 @@
     }
 
+    //Increase speed of ghosts
     void PacmanGhost::levelupvelo(){
         speed ++;
