Index: code/branches/3DPacman_FS19/src/modules/pacman/CMakeLists.txt
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/CMakeLists.txt	(revision 12319)
+++ code/branches/3DPacman_FS19/src/modules/pacman/CMakeLists.txt	(revision 12320)
@@ -9,4 +9,6 @@
   PacmanRed.cc
   PacmanPink.cc
+  PacmanBrown.cc
+  PacmanCyan.cc
 )
 
Index: code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.cc
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.cc	(revision 12319)
+++ code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.cc	(revision 12320)
@@ -25,4 +25,15 @@
     }
 
+
+int PacmanBrown::absoluteDistance(Vector3 pos1, Vector3 pos2){
+
+
+        Ogre::Vector3 diffVector;
+        diffVector.x=pos2.x-pos1.x;
+        diffVector.y=pos2.y-pos1.y; //should always be 0
+        diffVector.z=pos2.z-pos1.z;
+        int result = sqrt((diffVector.x)*(diffVector.x)+(diffVector.z)*(diffVector.z));
+        return result;
+    }
 
 
@@ -59,5 +70,39 @@
         	//put everything needed here
 
-        	if((this->fleeing==true)&&(this->actuelposition!=(-215,10,-195))){
+            Vector3 brownPos=Vector3(this->target_x, 10, this->target_z);
+
+            if(absoluteDistance(this->lastPlayerPassedPoint, this->actuelposition)<50){
+                //no idea if 50 is large enough 
+
+                //if near player, flee
+
+                this->isFleeing=true;
+                Vector3 nextMove=getShortestPath( brownPos,Vector3(-215, 10, -195));
+                setNewTargetGhost(nextMove);
+
+            }
+
+            else if((this->isFleeing==true)&&(brownPos!=Vector3(-215,10,-195))){
+                //if fleeing, continue to flee
+             Vector3 nextMove = getShortestPath(brownPos, Vector3(-215, 10, -195));
+             setNewTargetGhost(nextMove);
+        }
+            else if ((this->isFleeing==true)&&(brownPos==Vector3(-215,10,-195))){
+                //if fleeing and reached flee point, go back near player
+            this->isFleeing=false;
+            Vector3 nextMove = getShortestPath(brownPos, this->lastPlayerPassedPoint);
+            setNewTargetGhost(nextMove);
+        }
+            else{
+                //if not fleeing and not near player, go near player
+                Vector3 nextMove = getShortestPath(brownPos, this->lastPlayerPassedPoint);
+            setNewTargetGhost(nextMove);
+            }
+        }
+
+
+
+
+        	/*if((this->fleeing==true)&&(this->actuelposition!=(-215,10,-195))){
             //if fleeing, then go to corner map if not already there
         		fleeMode();
@@ -82,36 +127,43 @@
         		}
 
-        	}
+        	}*/
+            lockmove=false; //NEVER FORGET THIS ONE !!!
    
         }
-        
-    }
-
-
-
-
-
-
-
-
-
-
-	int graphDistance(Vector3 start, Vector3 goal){
+    }
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+	/*int graphDistance(Vector3 start, Vector3 goal){
 
         Vector3 differenceVector= Vector3(abs(goal.x-start.x), 0,abs(goal.z-start.z));
 
         return differenceVector.x+differenceVector.z;
-    }
-
-	void setNewTargetBrown(Vector3 goalToGo){
+    }*/
+
+	/*void setNewTargetBrown(Vector3 goalToGo){
 
 					this->target_x = goalToGo.x;
                     this->target_z = goalToGo.z; 
                     this->ismoving = true;
-	}
-
-
-
-	int absoluteDistance(Vector3 pos1, Vector3 pos2){
+	}*/
+
+
+
+	/*int PacmanBrown::absoluteDistance(Vector3 pos1, Vector3 pos2){
 
 
@@ -120,24 +172,24 @@
 		diffVector.y=pos2-pos1; //should always be 0
 		diffVector.z=pos2-pos1;
-		int result = sqrt(diffVector.x²+diffVector.z²);
+		int result = sqrt((diffVector.x)*(diffVector.x)+(diffVector.z)*(diffVector.z));
 		return result;
-	}
-
-
-	void fleeMode(){ //flees to corner of the map
+	}*/
+
+
+	/*void fleeMode(){ //flees to corner of the map
 
 		Vector3 cornerPos = Vector3(-215,10,-195); //let's take this. We can still change
 		Vector3 nextMove = getShortestPath(this->actuelposition, cornerPos);
-		setNewTargetBrown(nextMove);
-
-		/*//while(this->actuelposition!=cornerPos){
+		setNewTargetGhost(nextMove);
+
+		//while(this->actuelposition!=cornerPos){
 	
 		continue moving and each time find next point to go until
 		we reach the corner
-		}*/
-	}
-
-
-	Vector3 goAdjacentOfPlayer(Vector neighboorsOfPlayer[]){
+		}
+	}*/
+
+
+	/*Vector3 goAdjacentOfPlayer(Vector neighboorsOfPlayer[]){
 		//find ,nearest to brown, player neighboor 
 
@@ -171,8 +223,8 @@
 		return chosenNeighbor;
 
-	}
-
-
-	Vector3 findPlayerNeighboorNearestToPacman(Vector3 neighboorArray[]){
+	}*/
+
+
+	/*Vector3 findPlayerNeighboorNearestToPacman(Vector3 neighboorArray[]){
 		//uh, i think it does the same think as the function above
 
@@ -203,9 +255,9 @@
         return nextMove;
 
-    }
-
-}
-
-
-
-
+    }*/
+
+
+
+
+
+
Index: code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.h
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.h	(revision 12319)
+++ code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.h	(revision 12320)
@@ -29,7 +29,9 @@
 
 
-  			Vector3 goAdjacentOfPlayer(Vector neighboorsOfPlayer[]);
+  			Vector3 goAdjacentOfPlayer(Vector3 neighboorsOfPlayer[]);
   			//they both do the same -_-
   			Vector3 findPlayerNeighboorNearestToPacman(Vector3 neighboorArray);
+
+        bool isFleeing;
 
 
Index: code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.cc
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.cc	(revision 12320)
+++ code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.cc	(revision 12320)
@@ -0,0 +1,91 @@
+#include "PacmanCyan.h"
+//#include "Pacman.h"
+
+#include "core/CoreIncludes.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+
+
+	namespace orxonox{
+
+		RegisterClass(PacmanCyan);
+
+		PacmanCyan::PacmanCyan(Context* context) : PacmanGhost(context){
+
+        RegisterObject(PacmanCyan);
+        this->target_x=0;
+        this->target_z=15;
+        this->lastPlayerPassedPoint=Vector3(70,10,-135);
+          
+    }
+
+
+    /**
+    @brief
+        Method for creating a ghost through XML.
+    */
+    void PacmanCyan::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PacmanCyan, XMLPort, xmlelement, mode);
+    }
+
+
+
+    void PacmanCyan::tick(float dt)
+    {
+        
+        SUPER(PacmanGhost, tick, dt);
+
+        this->actuelposition = this->getPosition();
+
+
+
+        //Stop, if target arrived
+        if((abs(this->actuelposition.x - this->target_x)<0.5) && (abs(this->actuelposition.z - this->target_z)<0.5)){
+            
+                 this->ismoving = false;
+        }
+
+        //Move, if ghost hasn't arrived yet
+        if(this->ismoving){
+            
+            if(!(abs(this->actuelposition.z-target_z)<0.5)) {
+                velocity = Vector3(0,0,-sgn(this->actuelposition.z-this->target_z));
+                move(dt, actuelposition, velocity);
+            }    
+            if(!(abs(this->actuelposition.x-target_x)<0.5)){
+                velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),0,0);
+                move(dt, actuelposition, velocity);
+            }
+            
+        }
+
+        //Check on which position the ghost has arrived and set new target
+        else{
+
+            while(lockmove){};
+            lockmove = true;
+
+        	
+
+            Vector3 cyanPos=Vector3(this->target_x, 10, this->target_z);
+            
+
+
+            lockmove=false; //NEVER FORGET THIS ONE !!!!!!!
+        }
+        
+    }
+
+
+	void PacmanCyan::nextMove( Vector3 cyanPosP, Vector3 playerPos){
+	
+        Vector3 nextTarget;
+
+	   nextTarget = getShortestPath(cyanPosP, playerPos);
+	
+	   setNewTargetGhost(nextTarget);
+	}
+
+
+}
Index: code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.h
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.h	(revision 12320)
+++ code/branches/3DPacman_FS19/src/modules/pacman/PacmanCyan.h	(revision 12320)
@@ -0,0 +1,28 @@
+#ifndef _PacmanCyan_H__
+#define _PacmanCyan_H__
+
+
+#include "PacmanGhost.h"
+//#include "getShortestPath.h"
+
+
+namespace orxonox {
+
+	class _OrxonoxExport PacmanCyan : public PacmanGhost{
+
+		public :
+			PacmanCyan(Context* context);
+
+			virtual void tick(float dt) override; //!< Defines which actions the AutonomousDrone has to take in each tick.
+
+  			virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+  			void nextMove( Vector3 cyanPosP, Vector3 playerPos);
+
+
+
+	};
+
+}
+
+#endif 
Index: code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h	(revision 12319)
+++ code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h	(revision 12320)
@@ -37,5 +37,5 @@
 
 #include "Pacman.h"
-#include "GetShortestPathAlgorithm.h"
+//#include "GetShortestPathAlgorithm.h"
 
 namespace orxonox {
