Index: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc	(revision 11833)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc	(revision 11834)
@@ -50,9 +50,9 @@
         this->localLinearAcceleration_.setValue(0, 0, 0);
         this->localAngularAcceleration_.setValue(0, 0, 0);
-        this->primaryThrust_  = 100;
-        this->auxiliaryThrust_ = 100;
-        this->rotationThrust_ = 10;
 
         this->setCollisionType(CollisionType::Dynamic);
+
+        Vector3 resetposition = new Vector3(0,0,0); //Set Default start position
+
     }
 
@@ -78,8 +78,7 @@
 
         XMLPortParam(PacmanGhost, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
-        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
-        // Variables can be added by the following command
-        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
-        // Also make sure that you also create the get- and set-functions in AutonomousDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
+        XMLPortParam(PacmanGhost, "auxilliaryThrust", setAuxillaryThrust, getAuxillaryThrust, xmlelement, mode);
+        XMLPortParam(PacmanGhost, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
+        XMLPortParam(PacmanGhost, "resetposition", setResetPosition, getResetPosition, xmlelement, mode);
     }
 
Index: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h	(revision 11833)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h	(revision 11834)
@@ -55,5 +55,6 @@
             virtual void rotatePitch(const Vector2& value);
             virtual void rotateRoll(const Vector2& value);
-
+            
+            virtual void resetGhost();
             /**
             @brief Moves the Drone in the Front/Back-direction by the specifed amount.
@@ -100,7 +101,12 @@
             inline void setPrimaryThrust( float thrust )
                 { this->primaryThrust_ = thrust; }
-            //TODO: Place your set-functions here.
-            // Hint: auxiliary thrust, rotation thrust.
-            
+            inline void setAuxillaryThrust( float thrust )
+                { this->auxillaryThrust_ = thrust; }
+            inline void setRotationThrust( float thrust )
+                { this->rotationThrust_ = thrust; }
+
+            inline void setResetPosition(Vector3 rpos)
+                { this->resetposition = rpos; }    
+      
             /**
             @brief Gets the primary thrust to the input amount.
@@ -109,5 +115,13 @@
             inline float getPrimaryThrust()
                 { return this->primaryThrust_; }
-            //TODO: Place your get-functions here.
+            inline float getAuxillaryThrust()
+                { return this->auxillaryThrust_; }
+            inline float getRotationThrust()
+                { return this->rotationThrust_; }
+            
+            inline Vector3 getResetPosition()
+                { return this->resetposition; }        
+
+
 
         private:
@@ -119,4 +133,5 @@
             float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
             float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
+            Vector3 resetposition; //Start position for Ghost
         
     };
Index: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc	(revision 11833)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc	(revision 11834)
@@ -43,11 +43,18 @@
         The context of this object.
     */
-    PacmanGhostRed::PacmanGhostController(Context* context) : Controller(context)
+    PacmanGhostController::PacmanGhostController(Context* context) : Controller(context)
     {
         RegisterObject(PacmanGhostController);
+
+        PacmanGhost* myGhost = nullptr;
+        this->actuelposition = myGhost.getPosition();
+
         bool ismoving = false;
-        float reltarget_x;
-        float reltarget_z;  
-        Vector3& actuelposition;     
+        this->target_x = actuelposition.x;
+        this->target_z = actuelposition.z;     
+    }
+
+    void PacmanGhostController::setGhost(PacmanGhost ghost){
+        this->myGhost = ghost;
     }
 
@@ -61,4 +68,6 @@
     }
 
+
+    static Vector3[] possibleposition = [new Vector3(0,10,245), new Vector3(215,0,240)];
     /**
     @brief
@@ -77,50 +86,37 @@
         PacmanGhost* myDrone = *it;
 
-        if (myGhost != nullptr)
+        if (this->myGhost != nullptr)
         {
 
-            actuelposition = myGhost.getPosition();
+            this->actuelposition = this->myGhost.getPosition();
 
-            if(actuelposition.x = reltarget_x && actuelposition.z = reltarget_z){
-                    ismoving = false;
+            if(((this->actuelposition.x - this->target_x)<0.1) && ((this->actuelposition.z - this->target_z)<0.1)){
+                    this->ismoving = false;
             }
 
-
-
-            if(ismoving){
-                moveRightLeft();
-                moveFrontBack(); 
+        if(this->ismoving){
+            if(!((this->actuelposition.z-target_z)<0.1))
+                moveFrontBack(sgn(this->actuelposition.z-this->target_z)*dt*100);
+            if(!((this->actuelposition.x-target_x)<0.1))
+              moveRightLeft(sgn(this->actuelposition.x-this->target_x)*dt*100); //Assume dt is quite small
+        }
+        
+        else{ //Check on which position ghost is
+            if(((this->actuelposition.x - possibleposition[0].x)<0.1) && ((this->actuelposition.z - possibleposition[1].z)<0.1)){
+                this->target_x = possibleposition[1].x;
+                this->target_z = possibleposition[1].z; 
+                this->ismoving = true;
             }
-        
+            else if(((actuelposition.x - possibleposition[0].x)<0.1) && ((actuelposition.z - possibleposition[1].z)<0.1)){
+                this->target_x = 0
+                this->target_z =  
+                this->ismoving = true;
+            }
             else{
-
-                //hashtable
-
-                int random = rand();
-
-                switch(actuelposition) {
-                    case 1: if(random % 4 == 0){
-                            reltarget_x = 250;
-                            reltarget_z = 0;
-                            }
-                            else if(random % 4 == 1){
-                            reltarget_x = 0;
-                            reltarget_z = 250;
-                            }
-                            else if(random % 4 == 2){
-                            reltarget_x = 0;
-                            reltarget_z = -250;
-                            }
-                            else if(random % 4 == 3){
-                            reltarget_x = -250;
-                            reltarget_z = 0;
-                            }
-                            moving = true;
-                    case 2:
-                }
-            }
-
+            }      
+            } //End of Position table
 
         }
     }
+
 }
