Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11555)
@@ -19,7 +19,5 @@
         RegisterObject(AsteroidsShip);
 
-        angle= 0.0f;
-
-
+        direction= 0.0f;
 
         isFireing = false;
@@ -30,22 +28,7 @@
         lastTime = 0;
 
-        height = this->getGame()->center_->getFieldHeight();
-        width = this->getGame()->center_->getFieldWidth();
-
-        force.x =0;
-        force.y =0;
-
-        velocity.x = 0;
-        velocity.y = 0;
-
+        height = 600;
+        width = 1000;
     }
-
-    //Destructor
-    AsteroidsShip::~AsteroidsShip()
-    {
-        if (this->isInitialized())
-            this->cleanup();
-    }
-
 
 
@@ -53,51 +36,57 @@
     void AsteroidsShip::tick(float dt)
     {
+        orxout() << "ich ticke!"<< endl;
+        SUPER(AsteroidsShip, tick, dt);
+
         //Movement computation beachte Beschleunigung?
         Vector3 pos = getPosition();
+        Vector3 vel = getVelocity();
 
-        float speed = sqrt(velocity.x*velocity.x+ velocity.y*velocity.y);
+        float speed = sqrt(vel.x*vel.x+ vel.z*velo.z);
+
+
+        //Daempfung falls das spaceship zu schnell wird
         if(speed > maxspeed)
         {
-            velocity.x *= maxspeed/speed;
-            velocity.y *= mayspeed/speed;
+            vel.x *= maxspeed/speed;
+            vel.z *= mayspeed/speed;
         }
 
-        pos.x += velocity.x*dt;
-        pos.y += velocity.y*dt;
+        if(moveUpPressed_)
+        {
+            //Gas geben
+            vel.x += 1;
+            vel.z += 1;
+
+        }else if(moveDownPressed_){
+            //Bremsen
+            vel.x += 1;
+            vel.z += 1;
+        }else if(moveLeftPressed_){
+            //rotate left
+        }else if (moveRightPressed_){
+            //rotateright
+        }    
+
+        setVelocity(vel);
+        
+        pos.x += vel.x*dt;
+        pos.z += vel.z*dt;
 
 
-        //haelt ship innerhalb des Kamerafensters
-        if(x>width) x=0;
-        if(x<0) x=width;
-        if(y>height) y=0;
-        if(y<0) y=height);
+
+        //haelt ship innerhalb des Kamerafensters, kommt oben bzw seitlich wieder raus. Man spawnt in (0,0)
+        if(pos.x > width/2)   pos.x = -width/2;
+        if(pos.x < -width/2)  pos.x = width/2;
+        if(pos.z > height/2)  pos.z = -height/2;
+        if(pos.z < -height/2) pos.z = height/2;
 
 
         //Schiessen wenn geschossen wurde
         // shoot!
-/*
+
         if (isFireing)
             ControllableEntity::fire(0);
-        */
-
-        //Execute movement
-        if (this->hasLocalController())
-        {
-            force.x += 1;
-            force.y += 1;
-
-        }
-
-
-
-        //Camera ticken? Bleibt eigentlich am selben Ort...irgendwo initialisieren
-        Camera* camera = this->getCamera();
-        if (camera != nullptr)
-        {
-            camera->setPosition(Vector3(0,cameradistance, 0));
-            camera->setOrientation(Vector3::UNIT_Z, Degree(90));
-        }
-
-
+    
 
         // bring back on track!
@@ -107,11 +96,18 @@
         }
 
-        velocity.x *= damping;
-        velocity.y *= damping;
+        //Reibung?
+        vel.x *= damping;
+        vel.y *= damping;
+
 
         setPosition(pos);
-        setOrientation(Vector3::UNIT_Y, Degree(270));
+        setOrientation(Vector3::UNIT_Y, Degree(direction));
 
-        SUPER(AsteroidsShip, tick, dt);
+        // Reset key variables
+        moveUpPressed_ = false;
+        moveDownPressed_ = false;
+        moveLeftPressed_ = false;
+        moveDownPressed_ = false;
+
 
     }
@@ -119,16 +115,47 @@
     void AsteroidsShip::moveFrontBack(const Vector2& value)
     {
-        velocity.x += 1;
-    } 
+        if (value.x > 0)
+        {
+            moveUpPressed_ = true;
+            moveDownPressed_ = false
+            if(moveUpPressed_)
+            {
+                orxout() << "up" << endl;
+            }
+        }
+        else
+        {
+            moveUpPressed_ = false;
+            moveDownPressed_ = true;
+            if(moveDownPressed_)
+            {
+                orxout() << "down" << endl;
+            }
+        }
+    }
 
-    void AsteroidsShip::moveUpDown(const Vector2& value)
+    void AsteroidsShip::moveRightLeft(const Vector2& value)
     {
-        velocity.y +=1;
+        if (value.x > 0)
+        {
+            moveLeftPressed_ = false;
+            moveRightPressed_ = true;
+        }
+            if(moveRightPressed_)
+            {
+                orxout() << "right" << endl;
+            }
 
+        else
+        {
+            moveLeftPressed_ = true;
+            moveRightPressed_ = false;
+            if(moveLeftPressed_)
+            {
+                orxout() << "left" << endl;
+            }
+        }
     }
-    void AsteroidsShip::moveFrontLeftRight(const Vector2& value)
-    {
-
-    }
+    
 
     Asteroids* AsteroidsShip::getGame()
