Index: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	(revision 11944)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	(revision 11945)
@@ -70,5 +70,5 @@
             if(timer<=0){
                 afraid = false;
-                timer = 0;
+                this->setNormal();
             }
         }
@@ -88,5 +88,5 @@
 
         bcolli = false;
-        for(int nrghost = 0; (nrghost<3) && (!bcolli); ++nrghost){
+        for(int nrghost = 0; (nrghost<8) && (!bcolli); ++nrghost){
             bcolli = collis(ghosts[nrghost]->getPosition(), currentPosition);
             //orxout() << "GHOST" << nrghost << ghosts[nrghost]->getPosition() << endl;
@@ -127,5 +127,5 @@
         }
     else{
-        for(int nrghost = 0; nrghost<3; ++nrghost){
+        for(int nrghost = 0; nrghost<8; ++nrghost){
         bcolli = collis(ghosts[nrghost]->getPosition(), currentPosition);
         if(bcolli) ghosts[nrghost]->resetGhost();
@@ -136,6 +136,31 @@
 
     void Pacman::setAfraid(){
-        afraid = true;
+
         timer = 10; //Set timer to 10 seconds
+
+        //Change normal Ghosts with afraid ones
+        if(!afraid){
+            ghosts[0]->changewith(ghosts[4]);
+            ghosts[1]->changewith(ghosts[5]);
+            ghosts[2]->changewith(ghosts[6]);
+            ghosts[3]->changewith(ghosts[7]);
+        }
+
+        afraid = true; 
+    } 
+
+    void Pacman::setNormal(){
+
+        timer = 0;
+
+        //Change normal Ghosts with afraid ones
+        if(afraid){
+            ghosts[4]->changewith(ghosts[0]);
+            ghosts[5]->changewith(ghosts[1]);
+            ghosts[6]->changewith(ghosts[2]);
+            ghosts[7]->changewith(ghosts[3]);
+        }
+
+        afraid = false; 
     } 
 
Index: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h	(revision 11944)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h	(revision 11945)
@@ -81,4 +81,5 @@
             int getPoints();
             void setAfraid();
+            void setNormal();
 
 
Index: code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc	(revision 11944)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc	(revision 11945)
@@ -51,4 +51,7 @@
         
         this->actuelposition = this->getPosition();
+
+        if(findpos(actuelposition, Vector3(0,-20,0)))
+            dontmove = true;
         
         this->target_x = actuelposition.x;
@@ -414,4 +417,14 @@
 	}
 
+    void changewith(PacmanGhost* otherghost){
+        otherghost->setPosition(this->getPosition());
+        this->setPosition(0,-20,0);
+        otherghost->target_x = this->target_x;   //Probleme bei parallelen Porzessen
+        otherghost->target_y = this->target_y;
+        otherghost->ismoving = this->ismoving;
+
+        this->dontmove = true;
+        otherghost->dontmove = false;
+    }
 
 
@@ -422,5 +435,5 @@
 
     bool PacmanGhost::findpos(Vector3 one, Vector3 other){
-       if((abs(one.x - other.x)<0.5) && (abs(one.z - other.z)<0.5)) return true;
+       if((abs(one.x - other.x)<0.5) && (abs(one.y - other.y)<0.5) && (abs(one.z - other.z)<0.5)) return true;
         return false;
     }
Index: code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h	(revision 11944)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h	(revision 11945)
@@ -55,15 +55,17 @@
             void setnewTarget(int firstdec, int seconddec, int thirddec);
             void setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec);
-
+            void changewith(PacmanGhost* otherghost);
 
             bool findpos(Vector3 one, Vector3 other);      
             void changemovability();
             bool dontmove = false;
-        private:
+
+            Vector3 actuelposition;
             bool ismoving = false;
-            int decision = 0; //Gives the random which way information to the ghost.
             int target_x = 0; 
             int target_z = 0; 
-            Vector3 actuelposition;
+            
+        private:
+            int decision = 0; //Gives the random which way information to the ghost.
             Vector3 velocity;
             Vector3 resetposition = Vector3(0,10,15);
