Index: branches/avi_play/src/Makefile.am
===================================================================
--- branches/avi_play/src/Makefile.am	(revision 5923)
+++ branches/avi_play/src/Makefile.am	(revision 5924)
@@ -47,4 +47,5 @@
                   world_entities/world_entity.cc \
                   world_entities/camera.cc \
+                  world_entities/playable.cc \
                   world_entities/player.cc \
                   world_entities/npcs/npc.cc \
@@ -76,4 +77,5 @@
                   world_entities/power_ups/turret_power_up.cc \
                   world_entities/power_ups/laser_power_up.cc \
+                  world_entities/space_ships/space_ship.cc \
                   subprojects/benchmark.cc
 
@@ -87,4 +89,5 @@
                  world_entities/world_entity.h \
                  world_entities/camera.h \
+                 world_entities/playable.h \
                  world_entities/player.h \
                  world_entities/npcs/npc.h \
Index: branches/avi_play/src/defs/class_id.h
===================================================================
--- branches/avi_play/src/defs/class_id.h	(revision 5923)
+++ branches/avi_play/src/defs/class_id.h	(revision 5924)
@@ -57,5 +57,5 @@
   // superclasses
   CL_MASK_SUPER_CLASS           =    0xff000000,
-  CL_BASE_OBJECT                =    0xff000000,
+  CL_BASE_OBJECT                =    0x00000000,
 
   CL_PARENT_NODE                =    0x01000000,
@@ -69,21 +69,29 @@
   CL_ELEMENT_2D                 =    0x10000000,
 
-  CL_SYNCHRONIZEABLE             =    0x20000000,
+  CL_SYNCHRONIZEABLE            =    0x20000000,
 
   CL_WORLD_ENTITY               =    0x40000000,
 
-
+  // subsuper-classes derivations taken : 1, 2, 5, a, b, c.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
   // subsuper-classes
   CL_MASK_SUBSUPER_CLASS        =    0x00fff000,
-  CL_MASK_SUBSUPER_CLASS_ID     =    0x00f00000,
-  CL_MASK_SUBSUPER_CLASS_ID2    =    0x000ff000,
-  CL_PLAYER                     =    0x00101000,
-  CL_NPC                        =    0x00102000,
-  CL_POWER_UP                   =    0x00104000,
-  CL_FIELD                      =    0x00108000,
-  CL_PROJECTILE                 =    0x00110000,
-  CL_WEAPON                     =    0x00120000,
-
-  // subsuper-classes derivations taken : 1, 5, a, b, c.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
+  CL_MASK_SUBSUPER_CLASS_IDA    =    0x00f00000,
+  CL_MASK_SUBSUPER_CLASS_IDB    =    0x000ff000,
+  // SUPER-PNodes
+  CL_FIELD                      =    0x00101000,
+  // SUPER-WorldEntities
+  CL_PLAYABLE                   =    0x00201000,
+  CL_PLAYER                     =    0x00202000,
+  CL_NPC                        =    0x00204000,
+  CL_PROJECTILE                 =    0x00208000,
+  CL_WEAPON                     =    0x00210000,
+  CL_POWER_UP                   =    0x00220000,
+
+  // SUPER-Modeling
+  CL_TEXTURE                    =    0x00c01000,
+  CL_MODEL                      =    0x00c02000,
+
+
+  // subsuper-classes derivations taken : 1, 2, 5, a, b, c.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
 
   // lowest level classes
@@ -120,4 +128,5 @@
 
 
+
   // StoryEntities (range from 0x00000100 to 0x000001ff)
   CL_CAMPAIGN                   =    0x00000101,
@@ -135,4 +144,5 @@
   CL_TERRAIN                    =    0x00000207,
   CL_TEST_ENTITY                =    0x00000209,
+  CL_SPACE_SHIP                 =    0x0000020a,
 
   CL_TURRET_POWER_UP            =    0x00000211,
@@ -177,15 +187,16 @@
 
   // graphical stuff (range from 0x00000800 to 0x000009ff)
-  CL_TEXTURE                    =    0x00c01000,
+  CL_FONT                       =    0x00c02802,
+
+
   CL_TEXT                       =    0x00b01801,
-  CL_FONT                       =    0x00c02802,
   CL_MATERIAL                   =    0x00000804,
-  CL_MODEL                      =    0x00000805, //!< @todo make this a SUBCLASS maybe
-  CL_OBJMODEL                   =    0x00000806,
-  CL_PROMITIVE_MODEL            =    0x00000807,
-  CL_MD2Model                   =    0x00000808,
-  CL_LIGHT                      =    0x00000809,
-  CL_PARTICLE_EMITTER           =    0x0000080a,
-  CL_PARTICLE_SYSTEM            =    0x0000080b,
+  CL_TEXTURE_SEQUENCE           =    0x00c04805,
+  CL_OBJMODEL                   =    0x00000807,
+  CL_PROMITIVE_MODEL            =    0x00000808,
+  CL_MD2Model                   =    0x00000809,
+  CL_LIGHT                      =    0x0000080a,
+  CL_PARTICLE_EMITTER           =    0x0000080b,
+  CL_PARTICLE_SYSTEM            =    0x0000080c,
   CL_ENVIRONMENT                =    0x00000810,
   CL_SHADER                     =    0x00000811,
Index: branches/avi_play/src/lib/collision_detection/cd_engine.cc
===================================================================
--- branches/avi_play/src/lib/collision_detection/cd_engine.cc	(revision 5923)
+++ branches/avi_play/src/lib/collision_detection/cd_engine.cc	(revision 5924)
@@ -24,5 +24,5 @@
 #include "world_entity.h"
 #include "terrain.h"
-#include "player.h"
+// #include "player.h"
 
 #include "spatial_separation.h"
@@ -119,5 +119,5 @@
     Quadtree* q = this->terrain->ssp->getQuadtree();
 
-    QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
+//    QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
   }
   //sTriangleExt* tri = q->getTriangleFromPosition(this->player->getAbsCoor());
Index: branches/avi_play/src/lib/collision_detection/cd_engine.h
===================================================================
--- branches/avi_play/src/lib/collision_detection/cd_engine.h	(revision 5923)
+++ branches/avi_play/src/lib/collision_detection/cd_engine.h	(revision 5924)
@@ -17,5 +17,5 @@
 class OBBTree;
 class Terrain;
-class Player;
+//class Player;
 
 
@@ -51,5 +51,5 @@
   inline void setEntityList(tList<WorldEntity>* entityList) { this->entityList = entityList; }
   inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
-  inline void setPlayer(Player* player) { this->player = player; } /* only for debug purposes \todo: delete*/
+  //  inline void setPlayer(Player* player) { this->player = player; } /* only for debug purposes \todo: delete*/
 
   void drawBV(int depth, int drawMode) const;
@@ -79,5 +79,5 @@
 
   Terrain*                terrain;                          //!< this it a ref to the terrain, serving as a ground for all WE
-  Player*                 player;
+//  Player*                 player;
 };
 
Index: branches/avi_play/src/lib/coord/p_node.cc
===================================================================
--- branches/avi_play/src/lib/coord/p_node.cc	(revision 5923)
+++ branches/avi_play/src/lib/coord/p_node.cc	(revision 5924)
@@ -428,4 +428,5 @@
 
   this->bias = bias;
+  this->bRelDirChanged = true;
 }
 
@@ -836,4 +837,5 @@
         glEnd();
       }
+
       /* if we want to draw the children too */
       if (depth == 0) /* -> all of them */
Index: branches/avi_play/src/lib/coord/p_node.h
===================================================================
--- branches/avi_play/src/lib/coord/p_node.h	(revision 5923)
+++ branches/avi_play/src/lib/coord/p_node.h	(revision 5924)
@@ -76,5 +76,5 @@
   inline const Vector& getRelCoor () const { return this->prevRelCoordinate; };
   /** @returns the Relative Coordinate Destination */
-  inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; };
+  inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };
   void setAbsCoor (const Vector& absCoord);
   void setAbsCoor (float x, float y, float z);
@@ -93,5 +93,5 @@
   inline const Quaternion& getRelDir () const { return this->prevRelDirection; };
   /** @returns the Relative Directional Destination */
-  inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)?*this->toDirection:this->relDirection; };
+  inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };
   /** @returns a Vector pointing into the relative Direction */
   inline Vector getRelDirV() const { return this->prevRelDirection.apply(Vector(0,1,0)); };
@@ -100,9 +100,15 @@
   void setAbsDirSoft(const Quaternion& absDirSoft, float bias = 1.0);
   void setAbsDirSoft(float x, float y, float z, float bias = 1.0);
+  void shiftDir (const Quaternion& shift);
   /** @returns the absolute Direction */
   inline const Quaternion& getAbsDir () const { return this->absDirection; };
   /** @returns a Vector pointing into the absolute Direction */
   inline Vector getAbsDirV() const { return this->absDirection.apply(Vector(0,1,0)); };
-  void shiftDir (const Quaternion& shift);
+  /** @returns A Vector pointing into the forward direction (X) of the Node */
+  inline Vector getAbsDirX() const { return this->absDirection.apply(Vector(1,0,0)); };
+  /** @returns A Vector pointing into the upward direction (Y) of the Node */
+  inline Vector getAbsDirY() const { return this->absDirection.apply(Vector(0,1,0)); };
+  /** @returns A Vector pointing into the right direction (Z) of the Node */
+  inline Vector getAbsDirZ() const { return this->absDirection.apply(Vector(0,0,1)); };
 
   /** @returns the Speed of the Node */
Index: branches/avi_play/src/lib/event/key_mapper.cc
===================================================================
--- branches/avi_play/src/lib/event/key_mapper.cc	(revision 5923)
+++ branches/avi_play/src/lib/event/key_mapper.cc	(revision 5924)
@@ -21,8 +21,11 @@
 #include "key_mapper.h"
 
+#include "event_def.h"
+
 #include "globals.h"
 #include "ini_parser.h"
 #include "key_names.h"
 #include "debug.h"
+
 
 using namespace std;
@@ -191,14 +194,14 @@
       {
         if( index[0] == 0)
-	{
+        {
           *map[i].pValue = index[1];
           PRINTF(4)("Mapping %s to '%s' (id %i)\n", name, SDLKToKeyname(index[1]), index[1]);
           break;
-	}
-	else { 
+        }
+        else {
           *map[i].pValue = index[1];
           PRINTF(4)("Mapping %s to '%s' (id %i)\n", name, SDLBToButtonname(index[1]), index[1]);
           break;
-	}
+        }
       }
     }
Index: branches/avi_play/src/lib/event/key_mapper.h
===================================================================
--- branches/avi_play/src/lib/event/key_mapper.h	(revision 5923)
+++ branches/avi_play/src/lib/event/key_mapper.h	(revision 5924)
@@ -10,5 +10,5 @@
 
 #include "base_object.h"
-#include "event_def.h"
+//#include "event_def.h"
 
 class IniParser;
@@ -66,5 +66,5 @@
 
  private:
-  Sint32     coord[2];              //!< temp place to save variables in nameToIndex() function
+  int         coord[2];              //!< temp place to save variables in nameToIndex() function
 };
 
Index: branches/avi_play/src/lib/graphics/graphics_engine.cc
===================================================================
--- branches/avi_play/src/lib/graphics/graphics_engine.cc	(revision 5923)
+++ branches/avi_play/src/lib/graphics/graphics_engine.cc	(revision 5924)
@@ -31,8 +31,8 @@
 
 #include "globals.h"
+#include "texture.h"
 
 #ifdef __WIN32__
  #include "class_list.h"
- #include "texture.h"
  #include "list.h"
  #include "model.h"
@@ -131,7 +131,7 @@
   const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
   if (strchr(textures, '1') || !strcasecmp(textures, "true"))
-    this->texturesEnabled = true;
+    Texture::setTextureEnableState( true);
   else
-    this->texturesEnabled = false;
+    Texture::setTextureEnableState(false);
 
   // searching for a usefull resolution
@@ -365,9 +365,4 @@
 
 /**
- * if Textures should be enabled
-*/
-bool GraphicsEngine::texturesEnabled = true;
-
-/**
  *
  * @param show if The mouse-cursor should be visible
Index: branches/avi_play/src/lib/graphics/graphics_engine.h
===================================================================
--- branches/avi_play/src/lib/graphics/graphics_engine.h	(revision 5923)
+++ branches/avi_play/src/lib/graphics/graphics_engine.h	(revision 5924)
@@ -83,6 +83,4 @@
 
   public:
-    static bool             texturesEnabled;    //!< if textures should be enabled (globally)
-
 
   private:
Index: branches/avi_play/src/lib/graphics/importer/Makefile.am
===================================================================
--- branches/avi_play/src/lib/graphics/importer/Makefile.am	(revision 5923)
+++ branches/avi_play/src/lib/graphics/importer/Makefile.am	(revision 5924)
@@ -9,5 +9,6 @@
                            md2Model.cc \
                            material.cc \
-                           texture.cc
+                           texture.cc \
+                           texture_sequence.cc
 
 
@@ -20,4 +21,5 @@
                  material.h \
                  texture.h \
+                 texture_sequence.h \
                  anorms.h \
                  anormtab.h
Index: branches/avi_play/src/lib/graphics/importer/material.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/material.h	(revision 5923)
+++ branches/avi_play/src/lib/graphics/importer/material.h	(revision 5924)
@@ -51,15 +51,15 @@
   static void addTexturePath(const char* pathName);
 
- private:
-  int         illumModel;       //!< The IlluminationModel is either flat or smooth.
-  float       diffuse [4];      //!< The diffuse color of the Material.
-  float       ambient [4];      //!< The ambient color of the Material.
-  float       specular [4];     //!< The specular color of the Material.
-  float       shininess;        //!< The shininess of the Material.
-  float       transparency;     //!< The transperency of the Material.
+  private:
+    int         illumModel;       //!< The IlluminationModel is either flat or smooth.
+    float       diffuse [4];      //!< The diffuse color of the Material.
+    float       ambient [4];      //!< The ambient color of the Material.
+    float       specular [4];     //!< The specular color of the Material.
+    float       shininess;        //!< The shininess of the Material.
+    float       transparency;     //!< The transperency of the Material.
   public:
-  Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
-  Texture*    ambientTexture;   //!< The ambient texture of the Material.
-  Texture*    specularTexture;  //!< The specular texture of the Material.
+    Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
+    Texture*    ambientTexture;   //!< The ambient texture of the Material.
+    Texture*    specularTexture;  //!< The specular texture of the Material.
 };
 #endif
Index: branches/avi_play/src/lib/graphics/importer/texture.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/texture.cc	(revision 5923)
+++ branches/avi_play/src/lib/graphics/importer/texture.cc	(revision 5924)
@@ -19,6 +19,6 @@
 
 #include "debug.h"
-#include "graphics_engine.h"
-
+
+// INCLUDING SDL_Image
 #ifdef HAVE_SDL_IMAGE_H
 #include <SDL_image.h>
@@ -45,4 +45,5 @@
 }
 
+
 /**
  *  Destructor of a Texture
@@ -65,5 +66,5 @@
 bool Texture::loadImage(const char* imageName)
 {
-  if (GraphicsEngine::texturesEnabled)
+  if (Texture::texturesEnabled)
     {
       if (this->image != NULL)
@@ -80,5 +81,5 @@
         {
           SDL_Surface* tmpSurf;
-          if (this->texture)
+          if (this->texture != 0 && glIsTexture(this->texture))
             glDeleteTextures(1, &this->texture);
           // load the new Image to memory
@@ -87,6 +88,13 @@
           {
             PRINTF(4)("loading Image %s\n", imageName);
-            if (this->prepareSurface(tmpSurf))
-              loadTexToGL();
+            bool hasAlpha;
+            SDL_Surface* newSurf = this->prepareSurface(tmpSurf, hasAlpha);
+            if (newSurf != NULL)
+            {
+              this->setSurface(newSurf);
+              this->setAlpha(hasAlpha);
+              this->setTexture(Texture::loadTexToGL(newSurf));
+            }
+
             SDL_FreeSurface(tmpSurf);
             return true;
@@ -108,10 +116,16 @@
 }
 
+
+/**
+ * rebuilds the texture.
+ * reloads the Texture from Memory to OpenGL.
+ */
 bool Texture::rebuild()
 {
   if (this->texture != 0)
     {
-      glDeleteTextures(1,&this->texture);
-      this->texture = 0;
+      if (glIsTexture(this->texture))
+        glDeleteTextures(1,&this->texture);
+      this->setTexture(0);
     }
 
@@ -119,26 +133,61 @@
     {
       PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
-      this->loadTexToGL();
+      this->setTexture(loadTexToGL(this->image));
     }
-
-}
-
+}
+
+
+/**
+ * set the surface this Texture handles
+ * @param newSurface the new Surface to set as the image for this Texture.
+ *
+ * This deletes the old version of the stored Texture,
+ * and sets the newly given Surface as current.
+ */
+bool Texture::setSurface(SDL_Surface* newSurface)
+{
+  if (this->image != NULL)
+    SDL_FreeSurface(this->image);
+
+  this->image = newSurface;
+
+  return (this->image != NULL);
+}
+
+
+bool Texture::texturesEnabled = true;
+
+/**
+ * enables, disables textures
+ * @param texturesEnabled true if the textures should be enabled
+ */
+void Texture::setTextureEnableState(bool texturesEnabled)
+{
+  Texture::texturesEnabled = texturesEnabled;
+}
+
+
+//////////////////////////////////////
+// UTILITY FUNCTIONALITY OF TEXTURE //
+//////////////////////////////////////
 /**
  * converts surface to a new SDL_Surface, that is loadable by openGL
  * @param surface the Surface to convert
+ * @param hasAlpha if the newly created Surface has an alpha channel, true is returned otherwise false.
  * @returns a !!new!! Surface, that is loadable by openGL.
  */
-bool Texture::prepareSurface(SDL_Surface* surface)
+SDL_Surface* Texture::prepareSurface(SDL_Surface* surface, bool& hasAlpha)
 {
   PRINTF(4)("Loading texture to OpenGL-Environment.\n");
 
-  SDL_Surface* putSurface;
+  SDL_Surface* retSurface;
   SDL_Rect area;
   Uint32 saved_flags;
   Uint8  saved_alpha;
 
-  putSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
-                               surface->w, surface->h,
-                               32,
+  hasAlpha = false;
+  retSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+                                    surface->w, surface->h,
+                                    32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
                                0x000000FF,
@@ -147,14 +196,13 @@
                                0xFF000000
 #else
-                               0xFF000000,
+                                   0xFF000000,
                                0x00FF0000,
                                0x0000FF00,
                                0x000000FF
 #endif
-                               );
-  if ( putSurface == NULL )
+                                   );
+  if ( retSurface == NULL )
   {
-    this->setSurface(NULL);
-    return false;
+    return NULL;
   }
 
@@ -171,5 +219,5 @@
   area.w = surface->w;
   area.h = surface->h;
-  SDL_BlitSurface(surface, &area, putSurface, &area);
+  SDL_BlitSurface(surface, &area, retSurface, &area);
 
   /* Restore the alpha blending attributes */
@@ -177,18 +225,8 @@
   {
     SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
-    this->bAlpha = true;
-  }
-
-  return (this->setSurface(putSurface));
-}
-
-bool Texture::setSurface(SDL_Surface* newSurface)
-{
-  if (this->image != NULL)
-    SDL_FreeSurface(this->image);
-
-  this->image = newSurface;
-
-  return (this->image != NULL);
+    hasAlpha = true;
+  }
+
+  return (retSurface);
 }
 
@@ -199,16 +237,18 @@
  * @returns The ID of the texture.
  */
-GLuint Texture::loadTexToGL ()
-{
-  if (this->texture != 0 && glIsTexture(this->texture))
-    glDeleteTextures(1, &this->texture);
-  this->texture = 0;
-
-  if (this->image == NULL)
+GLuint Texture::loadTexToGL (const SDL_Surface* surface)
+{
+//   if (this->texture != 0 && glIsTexture(this->texture))
+//     glDeleteTextures(1, &this->texture);
+//   this->texture = 0;
+
+  GLuint texture;
+
+  if (surface == NULL)
     return 0;
 
   /* Create an OpenGL texture for the image */
-  glGenTextures(1, &this->texture);
-  glBindTexture(GL_TEXTURE_2D, this->texture);
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -217,18 +257,18 @@
                0,
                GL_RGBA,
-               this->image->w, this->image->h,
+               surface->w, surface->h,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
-               this->image->pixels);
+               surface->pixels);
   // build the MipMaps
   gluBuild2DMipmaps(GL_TEXTURE_2D,
                     GL_RGBA,
-                    this->image->w,
-                    this->image->h,
+                    surface->w,
+                    surface->h,
                     GL_RGBA,
                     GL_UNSIGNED_BYTE,
-                    this->image->pixels);
+                    surface->pixels);
   glBindTexture(GL_TEXTURE_2D, 0);
-  return this->texture;
-}
+  return texture;
+}
Index: branches/avi_play/src/lib/graphics/importer/texture.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/texture.h	(revision 5923)
+++ branches/avi_play/src/lib/graphics/importer/texture.h	(revision 5924)
@@ -14,8 +14,4 @@
 struct SDL_Surface;
 
-//! an enumerator for different procedural texture-types
-typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS,
-  TEXTURE_NOISE };
-
 //! A Class, that reads in Textures from different fileformats.
   class Texture : public BaseObject
@@ -27,5 +23,5 @@
 
       bool loadImage(const char* imageName);
-      bool rebuild();
+      virtual bool rebuild();
 
       /** @returns The textureID of this texture.  */
@@ -33,15 +29,30 @@
       /** @returns true if texture has alpha, false otherwise */
       inline bool hasAlpha() const {return bAlpha;}
+      /** @returns the stored image of this Texture */
+      const SDL_Surface* const getStoredImage() const { return this->image; };
+
+
+
+      static void setTextureEnableState(bool texturesEnabled);
+      /** @returns true if Textures are enabled */
+      inline static bool getTextureEnableState() { return Texture::texturesEnabled; };
+
+      // Utility functionality:
+      static SDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha);
+      static GLuint loadTexToGL (const SDL_Surface* surface);
 
     protected:
-      bool prepareSurface(SDL_Surface* input);
+
       bool setSurface(SDL_Surface* newSurface);
+      bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; };
+      bool setTexture(GLuint texture) { this->texture = texture; };
 
-      GLuint loadTexToGL ();
 
     private:
-      GLuint        texture;            //!< The Texture-ID of opengl from this Texture.
-      bool          bAlpha;             //!< if the texture has an alpha channel.
-      SDL_Surface*  image;              //!< The SDL_Surfce that stores the Texture on it.
+      GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
+      bool             bAlpha;             //!< if the texture has an alpha channel.
+      SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
+
+      static bool      texturesEnabled;    //!< If the Textures are enabled.
   };
 
Index: branches/avi_play/src/lib/graphics/importer/texture_sequence.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/texture_sequence.cc	(revision 5924)
+++ branches/avi_play/src/lib/graphics/importer/texture_sequence.cc	(revision 5924)
@@ -0,0 +1,164 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
+
+#include "texture_sequence.h"
+
+#include "debug.h"
+#include "graphics_engine.h"
+
+#ifdef HAVE_SDL_IMAGE_H
+#include <SDL_image.h>
+#else
+#include <SDL/SDL_image.h>
+#endif
+
+/**
+ *  Constructor for a Texture
+ */
+TextureSequence::TextureSequence(unsigned int count, ...)
+{
+  this->setClassID(CL_TEXTURE_SEQUENCE, "TextureSequence");
+
+  va_list textureNameList;
+  va_start(textureNameList, count);
+
+  this->loadImageSeries(count, textureNameList);
+}
+
+/**
+ * Destructor of a TextureSequence
+ *
+ * Frees Data, and deletes the textures from GL
+ */
+TextureSequence::~TextureSequence()
+{
+  // delete all images
+  while(!this->images.empty())
+  {
+    SDL_FreeSurface(this->images.back());
+    this->images.pop_back();
+  }
+
+  this->setTexture(0);
+  // delete all textures.
+  while(!this->textures.empty())
+  {
+    if (glIsTexture(this->textures.back()))
+      glDeleteTextures(1, &this->textures.back());
+    this->textures.pop_back();
+  }
+}
+
+
+/**
+ * @brief rebuilds all the textures from the Images stored in this FrameSequence
+ */
+bool TextureSequence::rebuild()
+{
+  PRINTF(3)("Reloading TextureSequence of %s '%s'\n", this->getClassName(), this->getName());
+
+  for (unsigned int i = 0; i < this->textures.size(); i++)
+  {
+    if (glIsTexture(this->textures[i]))
+    {
+      glDeleteTextures(1, &this->textures[i]);
+      this->textures[i] = 0;
+    }
+
+    if (this->images[i] != NULL)
+      this->textures[i] = loadTexToGL(this->images[i]);
+  }
+}
+
+/**
+ * @brief loads an image Sequence
+ * @param count how many images to load to the TextureSequence
+ * @param ... the names of the Images to load
+ * @returns true on success, false otherwise
+ */
+bool TextureSequence::loadImageSeries(unsigned int count, ...)
+{
+  va_list textureNameList;
+  va_start(textureNameList, count);
+
+  return this->loadImageSeries(count, textureNameList);
+}
+
+/**
+ * @brief loads an image Sequence
+ * @param count how many images to load to the TextureSequence
+ * @param textures the names of the Images to load
+ * @returns true on success, false otherwise
+ */
+bool TextureSequence::loadImageSeries(unsigned int count, va_list textures)
+{
+  bool retVal = true;
+  for (unsigned int i = 0; i < count; i++)
+  {
+    if( !this->addFrame(va_arg(textures, char*)))
+      retVal = false;
+  }
+  return retVal;
+}
+
+/**
+ * @brief adds a new Frame to this Sequence (at the end)
+ * @param imageName the Name of the Image to add
+ * @returns true on success
+ */
+bool TextureSequence::addFrame(const char* imageName)
+{
+  if (imageName == NULL)
+    return false;
+
+  SDL_Surface* addSurface = IMG_Load(imageName);
+  bool success = this->addFrame(addSurface);
+  delete addSurface;
+
+  return success;
+}
+
+/**
+ * @brief adds a new Frame at the end of the Sequence.
+ * @param surface the Surface to add at the end of the Sequence.
+ */
+bool TextureSequence::addFrame(SDL_Surface* surface)
+{
+  if (surface == NULL)
+    return false;
+  bool hasAlpha;
+  SDL_Surface* newSurf = this->prepareSurface(surface, hasAlpha);
+  if (newSurf != NULL)
+  {
+    this->images.push_back(newSurf);
+    this->textures.push_back(Texture::loadTexToGL(newSurf));
+  }
+  this->setAlpha(hasAlpha);
+  return true;
+}
+
+
+
+/**
+ * @brief moves to the n'th texture which can then be retrieved via the Texture function: this->getTexture()
+ * @param frameNumber the n-th frame
+ */
+void TextureSequence::gotoFrame(unsigned int frameNumber)
+{
+  if (this->textures.size() > frameNumber)
+    this->setTexture(this->textures[frameNumber]);
+}
Index: branches/avi_play/src/lib/graphics/importer/texture_sequence.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/texture_sequence.h	(revision 5924)
+++ branches/avi_play/src/lib/graphics/importer/texture_sequence.h	(revision 5924)
@@ -0,0 +1,48 @@
+/*!
+ * @file texture.h
+ * @brief Contains the texture class, that handles the reading of Images into Texutre-files.
+ */
+
+#ifndef _TEXTURE_SEQUENCE_H
+#define _TEXTURE_SEQUENCE_H
+
+#include "texture.h"
+
+#include "glincl.h"
+
+#include <vector>
+#include <stdarg.h>
+
+/* Forward Declaration */
+struct SDL_Surface;
+
+//! A Class, that reads in Textures from different fileformats.
+class TextureSequence : public Texture
+{
+  public:
+    TextureSequence(unsigned int count = 0, ...);
+  //  Texture(TEXTURE_TYPE type, int resolution);
+    ~TextureSequence();
+
+    bool loadImageSeries(unsigned int count, ...);
+    bool loadImageSeries(unsigned int count, va_list textureNames);
+    bool addFrame(const char* image);
+    bool addFrame(SDL_Surface* surface);
+
+    virtual bool rebuild();
+
+    /** @returns the count of frames in this sequence */
+    inline unsigned int getFrameCount() const { return this->textures.size(); };
+
+    void gotoFrame(unsigned int frameNumber);
+    /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series.  */
+    inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; };
+    /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */
+    const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return (this->images.size()>frameNumber)?this->images[frameNumber]:NULL; };
+
+  private:
+    std::vector<GLuint>          textures;            //!< The Texture-ID of opengl from this Texture.
+    std::vector<SDL_Surface*>    images;              //!< The SDL_Surfce that stores the Texture on it.
+};
+
+#endif /* _TEXTURE_SEQUENCE_H */
Index: branches/avi_play/src/lib/graphics/text_engine/font.cc
===================================================================
--- branches/avi_play/src/lib/graphics/text_engine/font.cc	(revision 5923)
+++ branches/avi_play/src/lib/graphics/text_engine/font.cc	(revision 5924)
@@ -181,6 +181,12 @@
     this->fontTTF = NULL;
   }
-  if (this->prepareSurface(surface))
-    this->loadTexToGL( );
+  bool hasAlpha;
+  SDL_Surface* newSurf = this->prepareSurface(surface, hasAlpha);
+  if (newSurf != NULL)
+  {
+    this->setSurface(newSurf);
+    this->setAlpha(hasAlpha);
+    this->setTexture(Texture::loadTexToGL(newSurf));
+  }
 
   // initializing the Glyphs.
@@ -491,5 +497,5 @@
 
   if (this->setSurface(tmpSurf))
-    loadTexToGL();
+    (this->setTexture(Texture::loadTexToGL(tmpSurf)));
 }
 
Index: branches/avi_play/src/lib/graphics/text_engine/text_engine.cc
===================================================================
--- branches/avi_play/src/lib/graphics/text_engine/text_engine.cc	(revision 5923)
+++ branches/avi_play/src/lib/graphics/text_engine/text_engine.cc	(revision 5924)
@@ -64,5 +64,5 @@
 {
   // first remove all the remaining Texts (if any).
-  std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
+  const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
   if (textList != NULL)
   {
@@ -71,5 +71,5 @@
   }
   // delete all remaining fonts (There should not be Anything to do here)
-  std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
+  const std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
   if (fontList != NULL)
   {
@@ -124,5 +124,5 @@
 void TextEngine::debug() const
 {
-  list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
+  const list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
   if (textList != NULL)
   {
@@ -132,5 +132,5 @@
     PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
 
-    list<BaseObject*>::iterator text;
+    list<BaseObject*>::const_iterator text;
     for ( text = textList->begin(); text != textList->end(); text++)
       dynamic_cast<Text*>(*text)->debug();
Index: branches/avi_play/src/lib/lang/base_object.cc
===================================================================
--- branches/avi_play/src/lib/lang/base_object.cc	(revision 5923)
+++ branches/avi_play/src/lib/lang/base_object.cc	(revision 5924)
@@ -112,6 +112,6 @@
   else if (classID & CL_MASK_SUBSUPER_CLASS)
   {
-    if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_ID) == (this->classID & CL_MASK_SUBSUPER_CLASS_ID)) &&
-        this->classID & classID & CL_MASK_SUBSUPER_CLASS_ID2))
+    if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_IDA) == (this->classID & CL_MASK_SUBSUPER_CLASS_IDA)) &&
+        this->classID & classID & CL_MASK_SUBSUPER_CLASS_IDB))
       return true;
   }
Index: branches/avi_play/src/lib/lang/class_list.cc
===================================================================
--- branches/avi_play/src/lib/lang/class_list.cc	(revision 5923)
+++ branches/avi_play/src/lib/lang/class_list.cc	(revision 5924)
@@ -133,5 +133,5 @@
  * @return the List accessed by classID, or NULL if not found
  */
-std::list<BaseObject*>* ClassList::getList(ClassID classID)
+const std::list<BaseObject*>* ClassList::getList(ClassID classID)
 {
   ClassList* fl;
@@ -156,5 +156,5 @@
  * @return the List accessed by classID, or NULL if not found
  */
-std::list<BaseObject*>* ClassList::getList(const char* className)
+const std::list<BaseObject*>* ClassList::getList(const char* className)
 {
   ClassList* fl;
Index: branches/avi_play/src/lib/lang/class_list.h
===================================================================
--- branches/avi_play/src/lib/lang/class_list.h	(revision 5923)
+++ branches/avi_play/src/lib/lang/class_list.h	(revision 5924)
@@ -40,9 +40,11 @@
     static void                           removeFromClassList(BaseObject* objectPointer);
 
-    static std::list<BaseObject*>*        getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
-    static std::list<BaseObject*>*        getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
+    static const std::list<BaseObject*>*  getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
+    static const std::list<BaseObject*>*  getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
     static const std::list<const char*>*  getClassNames();
     static BaseObject*                    getObject(const char* name, ClassID classID = CL_NULL);
     static bool                           exists(const BaseObject* object, ClassID classID = CL_NULL);
+
+    void                                  sendBack(std::list<BaseObject*>::const_iterator it);
 
     static void                           whatIs(const BaseObject* object);
@@ -51,5 +53,5 @@
     static long                           StringToID(const char* className);
     static void                           debug(unsigned int debugLevel = 0, long classID = CL_NULL);
-    static void                           debugS(const char* className = 0x0, unsigned int debugLevel = 0);
+    static void                           debugS(const char* className = NULL, unsigned int debugLevel = 0);
 
     inline bool                           operator==(ClassID classID) { return (this->classID == classID); };
Index: branches/avi_play/src/lib/network/network_manager.cc
===================================================================
--- branches/avi_play/src/lib/network/network_manager.cc	(revision 5923)
+++ branches/avi_play/src/lib/network/network_manager.cc	(revision 5924)
@@ -161,5 +161,5 @@
   if (this->netStreamList != NULL || (this->netStreamList = ClassList::getList(CL_NETWORK_STREAM)) != NULL)
   {
-    std::list<BaseObject*>::iterator stream;
+    std::list<BaseObject*>::const_iterator stream;
     for (stream = this->netStreamList->begin(); stream != this->netStreamList->end(); ++stream)
       static_cast<NetworkStream*>(*stream)->processData();
Index: branches/avi_play/src/lib/network/network_manager.h
===================================================================
--- branches/avi_play/src/lib/network/network_manager.h	(revision 5923)
+++ branches/avi_play/src/lib/network/network_manager.h	(revision 5924)
@@ -41,6 +41,6 @@
 
 private:
-  std::list<BaseObject*>*    netStreamList;            // list with refs to all network streams
-  std::list<BaseObject*>*    syncList;                 // list of synchronizeables
+  const std::list<BaseObject*>*    netStreamList;            // list with refs to all network streams
+  const std::list<BaseObject*>*    syncList;                 // list of synchronizeables
 
 };
Index: branches/avi_play/src/lib/shell/shell_command.cc
===================================================================
--- branches/avi_play/src/lib/shell/shell_command.cc	(revision 5923)
+++ branches/avi_play/src/lib/shell/shell_command.cc	(revision 5924)
@@ -159,5 +159,5 @@
   long classID = CL_NULL;                      //< the classID retrieved from the Class.
   ShellCommandClass* commandClass = NULL;      //< the command class this command applies to.
-  std::list<BaseObject*>* objectList = NULL;   //< the list of Objects stored in classID
+  const std::list<BaseObject*>* objectList = NULL;   //< the list of Objects stored in classID
   BaseObject* objectPointer = NULL;            //< a pointer to th Object to Execute the command on
   bool emptyComplete = false;                  //< if the completion input is empty string. e.g ""
Index: branches/avi_play/src/lib/shell/shell_completion.cc
===================================================================
--- branches/avi_play/src/lib/shell/shell_completion.cc	(revision 5923)
+++ branches/avi_play/src/lib/shell/shell_completion.cc	(revision 5924)
@@ -58,5 +58,5 @@
 
   long classID;                         //< the classID retrieved from the Class.
-  std::list<BaseObject*>* objectList;   //< the list of Objects stored in classID
+  const std::list<BaseObject*>* objectList;   //< the list of Objects stored in classID
   bool emptyComplete = false;           //< if the completion input is empty string. e.g ""
   long completeType = SHELLC_NONE;      //< the Type we'd like to complete.
Index: branches/avi_play/src/lib/sound/sound_engine.cc
===================================================================
--- branches/avi_play/src/lib/sound/sound_engine.cc	(revision 5923)
+++ branches/avi_play/src/lib/sound/sound_engine.cc	(revision 5924)
@@ -137,5 +137,5 @@
   if (this->sourceList != NULL)
   {
-    list<BaseObject*>::iterator source;
+    list<BaseObject*>::const_iterator source;
     for (source = this->sourceList->begin(); source != this->sourceList->end(); source++)
     {
@@ -182,5 +182,5 @@
   if (likely(this->sourceList != NULL))
   {
-    list<BaseObject*>::iterator sourceIT;
+    list<BaseObject*>::const_iterator sourceIT;
     SoundSource* source;
     for (sourceIT = this->sourceList->begin(); sourceIT != this->sourceList->end(); sourceIT++)
@@ -281,9 +281,13 @@
 
   // INITIALIZING THE DEVICE:
-  ALchar deviceName[] =
+#ifndef AL_VERSION_1_1
+  ALubyte deviceName[] =
+#else
+  ALCchar deviceName[] =
+#endif
 #ifdef __WIN32__
-      "native";
+      "Direct3D";
 #else
-      "'( ( devices '( native arts null ) ) )";
+      "'( ( devices '( native null ) ) )";
 #endif
   //
@@ -301,4 +305,36 @@
 }
 
+
+/**
+ * Allocates openAL sources
+ * @param count how many sources to allocate
+ * @returns true on success, false if at least one source could not be allocated
+ */
+bool SoundEngine::allocateSources(unsigned int count)
+{
+  ALuint* sourceList = new ALuint[count];
+  ALenum result;
+
+  alGenSources(count, sourceList);
+  if ((result = alGetError()) != AL_NO_ERROR)
+  {
+    SoundEngine::PrintALErrorString(result);
+    return false;
+  }
+
+  /// @TODO check syntax
+
+
+  // Setting default values.
+  for (int i = 0; i < count; i++)
+  {
+    alSourcef (sourceList[i], AL_PITCH,    1.0      );
+    alSourcef (sourceList[i], AL_GAIN,     this->getEffectsVolume() );
+    alSourcei (sourceList[i], AL_LOOPING,  AL_FALSE );
+    this->ALSources.push(sourceList[i]);
+  }
+  return true;
+}
+
 /**
  *  Transforms AL-errors into something readable
Index: branches/avi_play/src/lib/sound/sound_engine.h
===================================================================
--- branches/avi_play/src/lib/sound/sound_engine.h	(revision 5923)
+++ branches/avi_play/src/lib/sound/sound_engine.h	(revision 5924)
@@ -14,4 +14,5 @@
 
 #include <list>
+#include <stack>
 
 #define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
@@ -21,4 +22,5 @@
 class PNode;
 class IniParser;
+
 
 //! A class that handles audio via the openAudioLibrary
@@ -54,4 +56,6 @@
     void flushAllBuffers();
     void flushAllSources();
+
+    bool allocateSources(unsigned int count);
     bool initAudio();
 
@@ -66,17 +70,18 @@
 
   private:
-    static SoundEngine*      singletonRef;             //!< Reference to this class
+    static SoundEngine*            singletonRef;             //!< Reference to this class
 
-    ALCdevice*               device;                   //!< the used audio-device.
-    ALCcontext*              context;                  //!< the context, currently in use.
+    ALCdevice*                     device;                   //!< the used audio-device.
+    ALCcontext*                    context;                  //!< the context, currently in use.
 
-    float                    musicVolume;              //!< the maximum volume of the music in % (0f,1f]
-    float                    effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
-    PNode*                   listener;                 //!< The listener of the Scene
+    float                          musicVolume;              //!< the maximum volume of the music in % (0f,1f]
+    float                          effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
+    PNode*                         listener;                 //!< The listener of the Scene
 
-    std::list<BaseObject*>*  bufferList;               //!< A list of buffers
-    std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
+    const std::list<BaseObject*>*  bufferList;               //!< A list of buffers
+    const std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
 
-
+    unsigned int                   maxSourceCount;           //!< How many Sources is the Maximum
+    std::stack<ALuint>             ALSources;                //!< A list of real openAL-Sources, the engine allocates, and stores for reuse.
 };
 
Index: branches/avi_play/src/lib/sound/sound_source.cc
===================================================================
--- branches/avi_play/src/lib/sound/sound_source.cc	(revision 5923)
+++ branches/avi_play/src/lib/sound/sound_source.cc	(revision 5924)
@@ -18,4 +18,5 @@
 #include "sound_source.h"
 #include "sound_engine.h"
+
 #include "alincl.h"
 #include "compiler.h"
Index: branches/avi_play/src/lib/sound/sound_source.h
===================================================================
--- branches/avi_play/src/lib/sound/sound_source.h	(revision 5923)
+++ branches/avi_play/src/lib/sound/sound_source.h	(revision 5924)
@@ -39,4 +39,5 @@
 
   private:
+    bool                   bPlay;                 //!< If the Source is Playing.
     ALuint                 sourceID;              //!< The ID of the Source
     const SoundBuffer*     buffer;                //!< The buffer to play in this source.
Index: branches/avi_play/src/story_entities/world.cc
===================================================================
--- branches/avi_play/src/story_entities/world.cc	(revision 5923)
+++ branches/avi_play/src/story_entities/world.cc	(revision 5924)
@@ -26,5 +26,4 @@
 #include "null_parent.h"
 #include "pilot_node.h"
-#include "track_node.h"
 #include "world_entity.h"
 #include "player.h"
@@ -40,5 +39,4 @@
 #include "shell.h"
 
-#include "track_manager.h"
 #include "garbage_collector.h"
 #include "fast_factory.h"
@@ -63,5 +61,4 @@
 #include "weapons/projectile.h"
 #include "event_handler.h"
-
 #include "sound_engine.h"
 #include "ogg_player.h"
@@ -72,4 +69,6 @@
 #include "npcs/npc_test1.h"
 #include "shader.h"
+
+#include "playable.h"
 
 SHELL_COMMAND(speed, World, setSpeed);
@@ -122,13 +121,14 @@
   PRINTF(3)("World::~World() - deleting current world\n");
 
+
   // here everything that is alocated by the World is deleted
   delete this->entities;
   State::setWorldEntityList(NULL);
 
+  delete this->localPlayer;
 
   // delete all the initialized Engines.
   FastFactory::flushAll(true);
   delete LightManager::getInstance();
-  delete TrackManager::getInstance();
   delete ParticleEngine::getInstance();
   delete AnimationPlayer::getInstance();
@@ -142,4 +142,5 @@
   // erease everything that is left.
   delete NullParent::getInstance();
+
   Shader::suspendShader();
 
@@ -172,4 +173,6 @@
   this->shell = NULL;
   this->entities = NULL;
+  this->localPlayer = NULL;
+  this->localCamera = NULL;
 
   this->showPNodes = false;
@@ -213,4 +216,5 @@
 
   AnimationPlayer::getInstance(); // initializes the animationPlayer
+  ParticleEngine::getInstance();
   PhysicsEngine::getInstance();
 
@@ -242,10 +246,10 @@
     }
 
-  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
+  TiXmlDocument* XMLDoc = new TiXmlDocument( getPath());
   // load the campaign document
   if( !XMLDoc->LoadFile())
   {
     // report an error
-    PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
+    PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getPath(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     delete XMLDoc;
     return (ErrorMessage){213,"XML File parsing error","World::load()"};
@@ -313,17 +317,21 @@
       while( element != NULL)
         {
-          WorldEntity* created = dynamic_cast<WorldEntity*>( loader->fabricate( element));
-          if( created != NULL) this->spawn( created);
+          BaseObject* created = (loader->fabricate(element));
+          if( created != NULL )
+          {
+            if(created->isA(CL_WORLD_ENTITY))
+              this->spawn(dynamic_cast<WorldEntity*>(created));
+            printf("Created a %s: %s\n", created->getClassName(), created->getName());
+          }
+
           // if we load a 'Player' we use it as localPlayer
+
+
           //todo do this more elegant
-          if( element->Value() != NULL && !strcmp( element->Value(), "Player"))
-          {
-            localPlayer = (Player*) created;
-            CDEngine::getInstance()->setPlayer(localPlayer);
-          }
-          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
+          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
+            sky = dynamic_cast<SkyBox*>(created);
           if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
           {
-            terrain = (Terrain*) created;
+            terrain = dynamic_cast<Terrain*>(created);
             CDEngine::getInstance()->setTerrain(terrain);
           }
@@ -340,21 +348,6 @@
     LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
 
-    LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
-    LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
-
-  // find Track
-  element = root->FirstChildElement( "Track");
-  if( element == NULL)
-    {
-      PRINTF(0)("World is missing a 'Track'\n");
-    }
-  else
-    {
-      //load track
-      PRINTF(4)("Loading Track\n");
-
-      TrackManager::getInstance()->loadParams( element);
-      TrackManager::getInstance()->finalize();
-    }
+   LoadParamXML(root, "ParticleEngine", ParticleEngine::getInstance(), ParticleEngine, loadParams);
+//   LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
 
   // free the XML data
@@ -363,31 +356,24 @@
   /* GENERIC LOADING PROCESS FINISHED */
 
-  // bind input
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, SDLK_PAGEUP);
-  EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, SDLK_PAGEDOWN);
+
+  // Create a Player
+  this->localPlayer = new Player();
+
+  Playable* playable;
+  const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
+  if (playableList != NULL)
+  {
+    playable = dynamic_cast<Playable*>(playableList->front());
+    this->localPlayer->setControllable(playable);
+  }
 
   // bind camera
-  //this->localCamera->bind (localPlayer);
- // this->localPlayer->addChild (this->localCamera);
-
-
-  //        TrackManager::getInstance()->setBindSlave(env);
-  PNode* tn = TrackManager::getInstance()->getTrackNode();
-  tn->addChild(this->localPlayer);
-
-  //localCamera->setParent(TrackNode::getInstance());
-  tn->addChild(this->localCamera);
-  localCamera->lookAt(tn);
+  playable->addChild (this->localCamera);
+
+//   //localCamera->setParent(TrackNode::getInstance());
+//  tn->addChild(this->localCamera);
   localCamera->setClipRegion(1, 10000.0);
-  this->localPlayer->setParentMode(PNODE_ALL);
-  TrackManager::getInstance()->condition(1, LEFTRIGHT, this->localPlayer);
-
+  localCamera->lookAt(playable);
+//  this->localPlayer->setParentMode(PNODE_ALL);
   if (sky != NULL)
   {
@@ -400,6 +386,4 @@
   glNewList (objectList, GL_COMPILE);
 
-  //TrackManager::getInstance()->drawGraph(.01);
-  //TrackManager::getInstance()->debug(2);
   glEndList();
 
@@ -412,11 +396,4 @@
   ////////////
 
-  Gravity* test = new Gravity();
-
-  // SYSTEM TRAILING THE PLAYER
-  // Creating a Test Particle System
-
-  //new PhysicsConnection(system, gravity);
-  //    new PhysicsConnection(this->localPlayer, gravity);
 
 //   TestEntity* testEntity = new TestEntity();
@@ -424,47 +401,4 @@
 //   testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
 //   this->spawn(testEntity);
-
-//   TestEntity* testEntity2 = new TestEntity();
-//   testEntity2->setAnim(STAND);
-//   testEntity2->setRelCoor(Vector(2400.0, 10.0, -30.0));
-//   testEntity2->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   //testEntity2->setParent(this->localPlayer);
-//   this->spawn(testEntity2);
-//
-//   TestEntity* testEntity3 = new TestEntity();
-//   testEntity3->setAnim(BOOM);
-//   testEntity3->setRelCoor(Vector(2450.0, 10.0, -40.0));
-//   testEntity3->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity3);
-//
-//   TestEntity* testEntity4 = new TestEntity();
-//   testEntity4->setAnim(FLIP);
-//   testEntity4->setRelCoor(Vector(2500.0, 10.0, -22.0));
-//   testEntity4->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity4);
-//
-//   TestEntity* testEntity5 = new TestEntity();
-//   testEntity5->setAnim(WAVE);
-//   testEntity5->setRelCoor(Vector(2420.0, 10.0, -50.0));
-//   testEntity5->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity5);
-//
-//   TestEntity* testEntity6 = new TestEntity();
-//   testEntity6->setAnim(WAVE);
-//   testEntity6->setRelCoor(Vector(2420.0, 10.0, -20.0));
-//   testEntity6->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity6);
-//
-//   TestEntity* testEntity7 = new TestEntity();
-//   testEntity7->setAnim(WAVE);
-//   testEntity7->setRelCoor(Vector(2500.0, 10.0, -50.0));
-//   testEntity7->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
-//   this->spawn(testEntity7);
-
-
-
-//  PhysicsEngine::getInstance()->debug();
-
-
 
   for(int i = 0; i < 100; i++)
@@ -476,11 +410,5 @@
     tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);
     this->spawn(tmp);
-
-
   }
-
-
-
-//  ClassList::debug();
 
   this->music = NULL;//(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);
@@ -498,60 +426,4 @@
   this->glmis->step();
   // stuff beyond this point remains to be loaded properly
-
-  // initializing the TrackManager
-  TrackManager::getInstance()->addPointV(Vector(150, -35, 5));
-  TrackManager::getInstance()->addPointV(Vector(200,-35, 5));
-  TrackManager::getInstance()->addPointV(Vector(250, -35, 5));
-  TrackManager::getInstance()->addPointV(Vector(320,-33,-.55));
-  TrackManager::getInstance()->setDuration(1);
-  TrackManager::getInstance()->setSavePoint();
-
-  TrackManager::getInstance()->addPointV(Vector(410, 0, 0));
-  TrackManager::getInstance()->addPointV(Vector(510, 20, -10));
-  TrackManager::getInstance()->addPointV(Vector(550, 20, -10));
-  TrackManager::getInstance()->addPointV(Vector(570, 20, -10));
-  TrackManager::getInstance()->setDuration(2);
-
-  TrackManager::getInstance()->forkS("testFork1,testFork2");
-  TrackManager::getInstance()->workOnS("testFork1");
-  TrackManager::getInstance()->addPointV(Vector(640, 25, -30));
-  TrackManager::getInstance()->addPointV(Vector(700, 40, -120));
-  TrackManager::getInstance()->addPointV(Vector(800, 50, -150));
-  TrackManager::getInstance()->addPointV(Vector(900, 60, -100));
-  TrackManager::getInstance()->addPointV(Vector(900, 60, -70));
-  TrackManager::getInstance()->addPointV(Vector(990, 65, -15));
-  TrackManager::getInstance()->addPointV(Vector(1050, 65, -10));
-  TrackManager::getInstance()->addPointV(Vector(1100, 65, -20));
-  TrackManager::getInstance()->setDuration(4);
-
-  TrackManager::getInstance()->workOnS("testFork2");
-  TrackManager::getInstance()->addPointV(Vector(640, 25, 20));
-  TrackManager::getInstance()->addPointV(Vector(670, 50, 120));
-  TrackManager::getInstance()->addPointV(Vector(700, 70, 80));
-  TrackManager::getInstance()->addPointV(Vector(800, 70, 65));
-  TrackManager::getInstance()->addPointV(Vector(850, 65, 65));
-  TrackManager::getInstance()->addPointV(Vector(920, 35, 40));
-  TrackManager::getInstance()->addPointV(Vector(945, 40, 40));
-  TrackManager::getInstance()->addPointV(Vector(970, 24, 40));
-  TrackManager::getInstance()->addPointV(Vector(1000, 40, -7));
-
-  TrackManager::getInstance()->setDuration(4);
-
-
-  TrackManager::getInstance()->joinS("testFork1,testFork2");
-
-  TrackManager::getInstance()->addPointV(Vector(1200, 60, -50));
-  TrackManager::getInstance()->addPointV(Vector(1300, 50, -50));
-  TrackManager::getInstance()->addPointV(Vector(1400, 40, -50));
-  TrackManager::getInstance()->addPointV(Vector(1500, 40, -60));
-  TrackManager::getInstance()->addPointV(Vector(1600, 35, -55));
-  TrackManager::getInstance()->addPointV(Vector(1700, 45, -40));
-  TrackManager::getInstance()->addPointV(Vector(1750, 60, -40));
-  TrackManager::getInstance()->addPointV(Vector(1770, 80, -40));
-  TrackManager::getInstance()->addPointV(Vector(1800, 100, -40));
-  TrackManager::getInstance()->setDuration(10);
-
-  TrackManager::getInstance()->finalize();
-
 
   // LIGHT initialisation
@@ -571,23 +443,6 @@
       {
         LightManager::getInstance()->getLight()->setAbsCoor(-5.0, 10.0, -40.0);
-
-
-        this->localPlayer = new Player ();
-        this->localPlayer->setName ("player");
-        this->spawn (this->localPlayer);
-        this->localPlayer->setRelCoor(Vector(5,0,0));
         /*monitor progress*/
         this->glmis->step();
-
-
-        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
-        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
-        EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
-
-        /*
-        Field* testField = new Gravity();
-        testField->setMagnitude(10);
-        new PhysicsConnection(this->localPlayer, testField);
-        */
 
         // bind camera
@@ -614,26 +469,4 @@
         this->glmis->step();
 
-        this->pilotNode = new PilotNode();
-        this->spawn(this->pilotNode);
-        this->pilotNode->setAbsCoor(Vector(150, -35, 5));
-        this->pilotNode->addChild(this->localPlayer);
-        this->pilotNode->addChild(this->localCamera);
-        this->localCamera->lookAt(this->localPlayer);
-
-        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
-        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
-        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
-        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
-        EventHandler::getInstance()->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
-
-        /*
-        PNode* tn = TrackManager::getInstance()->getTrackNode();
-        tn->addChild(this->localPlayer);
-        this->localCamera->lookAt(tn);
-
-        tn->addChild(this->localCamera);
-        this->localPlayer->setParentMode(PNODE_ALL);
-        TrackManager::getInstance()->condition(2, LEFTRIGHT, this->localPlayer);
-        */
         this->glmis->step();
         break;
@@ -663,5 +496,4 @@
 {
   this->bPause = false;
-  this->pilotNode = NULL;
 
   /* update the object position before game start - so there are no wrong coordinates used in the first processing */
@@ -838,8 +670,4 @@
 void World::handleInput ()
 {
-  // localinput
-  //CommandNode* cn = Orxonox::getInstance()->getLocalInput();
-  //cn->process();
-
   EventHandler::getInstance()->process();
 
@@ -893,5 +721,4 @@
 
       /* update tick the rest */
-      TrackManager::getInstance()->tick(this->dtS);
       this->localCamera->tick(this->dtS);
       // tick the engines
Index: branches/avi_play/src/story_entities/world.h
===================================================================
--- branches/avi_play/src/story_entities/world.h	(revision 5923)
+++ branches/avi_play/src/story_entities/world.h	(revision 5924)
@@ -16,5 +16,4 @@
 class Camera;
 class Player;
-class PNode;
 class GLMenuImageScreen;
 class Terrain;
@@ -22,5 +21,4 @@
 class Text;
 class TiXmlElement;
-class PilotNode;
 
 class Shell;
@@ -121,7 +119,4 @@
     tList<WorldEntity>* entities;       //!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
     Player* localPlayer;                //!< The Player, you fly through the level.
-    PilotNode* pilotNode;               //!< THe pilot node to fly with the mouse
-
-
 };
 
Index: branches/avi_play/src/subprojects/importer/Makefile.am
===================================================================
--- branches/avi_play/src/subprojects/importer/Makefile.am	(revision 5923)
+++ branches/avi_play/src/subprojects/importer/Makefile.am	(revision 5924)
@@ -6,5 +6,6 @@
 importer_LDFLAGS = $(MWINDOWS)
 
-bin_PROGRAMS = importer
+bin_PROGRAMS = importer \
+               multitex
 
 importer_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \
@@ -32,3 +33,32 @@
                   $(MAINSRCDIR)/lib/util/color.cc \
                   $(MAINSRCDIR)/lib/util/multi_type.cc \
+                  $(MAINSRCDIR)/lib/util/executor/executor.cc \
                   $(MAINSRCDIR)/util/loading/factory.cc
+
+
+multitex_LDADD = $(MAINSRCDIR)/lib/event/libORXevent.a \
+                 $(MAINSRCDIR)/lib/tinyxml/libtinyxml.a \
+                 $(MAINSRCDIR)/lib/graphics/libORXgraphics.a \
+                 $(MAINSRCDIR)/lib/shell/libORXshell.a \
+                 $(MAINSRCDIR)/lib/sound/libORXsound.a \
+                 $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a
+
+multitex_SOURCES= ../framework.cc \
+                  multitex.cc \
+                  $(MAINSRCDIR)/util/state.cc \
+                  $(MAINSRCDIR)/world_entities/camera.cc \
+                  $(MAINSRCDIR)/lib/lang/base_object.cc \
+                  $(MAINSRCDIR)/lib/lang/class_list.cc \
+                  $(MAINSRCDIR)/lib/math/vector.cc \
+                  $(MAINSRCDIR)/util/loading/resource_manager.cc \
+                  $(MAINSRCDIR)/lib/util/ini_parser.cc \
+                  $(MAINSRCDIR)/lib/coord/p_node.cc \
+                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
+                  $(MAINSRCDIR)/util/loading/load_param.cc \
+                  $(MAINSRCDIR)/util/loading/load_param_description.cc \
+                  $(MAINSRCDIR)/lib/util/helper_functions.cc \
+                  $(MAINSRCDIR)/lib/util/substring.cc \
+                  $(MAINSRCDIR)/lib/util/color.cc \
+                  $(MAINSRCDIR)/lib/util/multi_type.cc \
+                  $(MAINSRCDIR)/lib/util/executor/executor.cc \
+                  $(MAINSRCDIR)/util/loading/factory.cc
Index: branches/avi_play/src/subprojects/importer/multitex.cc
===================================================================
--- branches/avi_play/src/subprojects/importer/multitex.cc	(revision 5924)
+++ branches/avi_play/src/subprojects/importer/multitex.cc	(revision 5924)
@@ -0,0 +1,103 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+
+   this file extends the framework file, so it renders what i want.
+*/
+
+#include "framework.h"
+
+#include "light.h"
+
+#include "texture_sequence.h"
+#include "material.h"
+
+#include "objModel.h"
+
+#include "primitive_model.h"
+#include <stdlib.h>
+
+#include "resource_manager.h"
+
+Model* obj;
+TextureSequence* seq;
+Texture* test;
+Material* testMat;
+
+float counter = 0;
+
+
+void Framework::moduleInit(int argc, char** argv)
+{
+  ResourceManager::getInstance()->addImageDir("./");
+
+  testMat = new Material;
+
+  seq = new TextureSequence();
+  for (int i = 1; i < argc; i++)
+  {
+    seq->addFrame(argv[i]);
+    printf("%s\n", argv[i]);
+  }
+  test = new Texture(argv[1]);
+  testMat->setDiffuseMap(argv[1]);
+
+  ResourceManager::getInstance()->addImageDir("");
+
+
+  obj = new PrimitiveModel(PRIM_SPHERE, 10.0);
+
+  ResourceManager::getInstance()->debug();
+
+  LightManager* lightMan = LightManager::getInstance();
+  lightMan->setAmbientColor(.1,.1,.1);
+  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
+  (new Light())->setAbsCoor(-10, -20, -100);
+}
+
+void Framework::moduleEventHandler(SDL_Event* event)
+{
+  switch (event->type)
+    {
+    case SDL_KEYDOWN:
+      switch (event->key.keysym.sym)
+        {
+        case SDLK_i:
+          break;
+        }
+    }
+}
+
+void Framework::moduleTick(float dt)
+{
+  counter+=dt;
+
+  seq->gotoFrame((unsigned int)counter);
+  if ((unsigned int)counter > seq->getFrameCount())
+    counter = 0;
+}
+
+void Framework::moduleDraw(void) const
+{
+  testMat->select();
+  glBindTexture(GL_TEXTURE_2D, seq->getTexture());
+  obj->draw();
+
+  LightManager::getInstance()->draw();
+}
+
+
+void Framework::moduleHelp(void) const
+{
+
+}
Index: branches/avi_play/src/world_entities/Makefile.am
===================================================================
--- branches/avi_play/src/world_entities/Makefile.am	(revision 5923)
+++ branches/avi_play/src/world_entities/Makefile.am	(revision 5924)
@@ -7,5 +7,6 @@
                   world_entity.cc \
                   camera.cc \
-                  player.cc \
+                  playable.cc \
+		  player.cc \
                   npc.cc \
                   npc2.cc \
@@ -17,4 +18,5 @@
                   character_attributes.cc \
                   test_entity.cc \
+		  space_ships/space_ship.cc \
                   weapons/weapon_manager.cc \
                   weapons/weapon.cc \
@@ -35,5 +37,6 @@
                  world_entity.h \
                  camera.h \
-                 player.h \
+                 playable.h \
+		 player.h \
                  npc.h \
                  npc2.h \
@@ -45,4 +48,5 @@
                  character_attributes.h \
                  test_entity.h \
+		 space_ships/space_ship.h \
                  weapons/weapon_manager.h \
                  weapons/weapon.h \
Index: branches/avi_play/src/world_entities/playable.cc
===================================================================
--- branches/avi_play/src/world_entities/playable.cc	(revision 5924)
+++ branches/avi_play/src/world_entities/playable.cc	(revision 5924)
@@ -0,0 +1,127 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Silvan Nellen
+   co-programmer: Benjamin Knecht
+*/
+
+
+#include "playable.h"
+
+#include "weapons/weapon_manager.h"
+#include "event_handler.h"
+#include "player.h"
+
+
+Playable::Playable()
+{
+  this->init();
+}
+
+Playable::~Playable()
+{
+  delete this->weaponMan;
+
+  if (this->currentPlayer)
+  {
+    PRINTF(2)("There is Still a Player subscribed to this Playable (%s::%s)\n", this->getClassName(), this->getName());
+
+  }
+}
+
+/**
+ * initializes this Playable
+ */
+void Playable::init()
+{
+  this->setClassID(CL_PLAYABLE, "Playable");
+  PRINTF(4)("PLAYABLE INIT\n");
+
+  this->weaponMan = new WeaponManager(this);
+
+  // the reference to the Current Player is NULL, because we dont have one at the beginning.
+  this->currentPlayer = NULL;
+}
+
+/**
+ * subscribe to all events the controllable needs
+ * @param player the player that shall controll this Playable
+ */
+bool Playable::subscribePlayer(Player* player)
+{
+  if (this->currentPlayer != NULL)
+  {
+    PRINTF(1)("Already registered Player:%s to this Playable (%s:%s)\n", this->currentPlayer->getName(), this->getClassName(), this->getName());
+    return false;
+  }
+  else
+  {
+    this->currentPlayer = player;
+    /*EventHandler*/
+    EventHandler* evh = EventHandler::getInstance();
+    std::list<int>::iterator ev;
+    for (ev = this->events.begin(); ev != events.end(); ev++)
+      evh->subscribe(player, ES_GAME, (*ev));
+
+    return true;
+  }
+}
+
+/**
+ * unsubscribe from all events the controllable needs
+ * @param player the Player, that controlled this Ship.
+ */
+bool Playable::unsubscribePlayer(Player* player)
+{
+  if (this->currentPlayer != player)
+  {
+    PRINTF(1)("not the right Player to unregister from this Playable (%s:%s)\n", this->currentPlayer->getName(), this->getClassName(), this->getName());
+    return false;
+  }
+
+  else
+  {
+    /*EventHandler*/
+    EventHandler* evh = EventHandler::getInstance();
+    std::list<int>::iterator ev;
+    for (ev = this->events.begin(); ev != events.end(); ev++)
+      evh->unsubscribe( ES_GAME, (*ev));
+
+    this->currentPlayer = NULL;
+    return true;
+  }
+}
+
+/**
+ * add an event to the event list of events this Playable can capture
+ * @param eventType the Type of event to add
+ */
+void Playable::registerEvent(int eventType)
+{
+  this->events.push_back(eventType);
+
+  if (this->currentPlayer != NULL)
+    EventHandler::getInstance()->subscribe(this->currentPlayer, ES_GAME, eventType);
+}
+
+/**
+ * remove an event to the event list this Playable can capture.
+ * @param event the event to unregister.
+ */
+void Playable::unregisterEvent(int eventType)
+{
+  this->events.remove(eventType);
+
+  if (this->currentPlayer != NULL)
+    EventHandler::getInstance()->unsubscribe(ES_GAME, eventType);
+}
+
+
Index: branches/avi_play/src/world_entities/playable.h
===================================================================
--- branches/avi_play/src/world_entities/playable.h	(revision 5924)
+++ branches/avi_play/src/world_entities/playable.h	(revision 5924)
@@ -0,0 +1,56 @@
+
+/*!
+ * @file playable.h
+ * Interface for a basic controllable WorldEntity
+ */
+#ifndef _PLAYABLE_H
+#define _PLAYABLE_H
+
+#include "world_entity.h"
+#include "event.h"
+#include <list>
+
+class Weapon;
+class WeaponManager;
+class Player;
+
+//! Basic controllable WorldEntity
+/**
+ *
+ */
+class Playable : public WorldEntity
+{
+  public:
+    Playable();
+    virtual ~Playable();
+
+
+    virtual void addWeapon(Weapon* weapon )  {}//= 0;
+    virtual void removeWeapon(Weapon* weapon) {}//= 0;
+    inline WeaponManager* getWeaponManager() const { return this->weaponMan; };
+
+    bool subscribePlayer(Player* player);
+    bool unsubscribePlayer(Player* player);
+
+    virtual void process(const Event &event) = 0;
+
+
+    /** @return a List of Events in PEV_* sytle */
+    inline const std::list<int>& getEventList() { return this->events; };
+
+  protected:
+    void registerEvent(int eventType);
+    void unregisterEvent(int eventType);
+
+  private:
+    void init();
+
+  private:
+    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
+    std::list<int>        events;             //!< A list of Events, that are captured for this playable
+
+    Player*               currentPlayer;      //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL
+
+};
+
+#endif /* _PLAYABLE_H */
Index: branches/avi_play/src/world_entities/player.cc
===================================================================
--- branches/avi_play/src/world_entities/player.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/player.cc	(revision 5924)
@@ -10,37 +10,18 @@
 
    ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
+   main-programmer: Silvan Nellen
+   co-programmer: Benjamin Knecht
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "executor/executor.h"
 #include "player.h"
-
-#include "track_manager.h"
-#include "objModel.h"
-#include "resource_manager.h"
-#include "factory.h"
-
-#include "weapons/weapon_manager.h"
-#include "weapons/test_gun.h"
-#include "weapons/turret.h"
-#include "weapons/cannon.h"
-
-#include "list.h"
+#include "playable.h"
 
 #include "event_handler.h"
 
-#include "event.h"
-
 using namespace std;
 
-CREATE_FACTORY(Player, CL_PLAYER);
 
 /**
  * creates a new Player
- * @param isFree if the player is free
 */
 Player::Player()
@@ -49,51 +30,4 @@
 }
 
-/**
- * loads a Players information from a specified file.
- * @param fileName the name of the File to load the player from (absolute path)
- */
-Player::Player(const char* fileName)
-{
-  this->init();
-  TiXmlDocument doc(fileName);
-
-  if(!doc.LoadFile())
-  {
-    PRINTF(2)("Loading file %s failed for player.\n", fileName);
-    return;
-  }
-
-  this->loadParams(doc.RootElement());
-}
-
-/**
- *  creates a new Player from Xml Data
- * @param root the xml element containing player data
-
-   @todo add more parameters to load
-*/
-Player::Player(const TiXmlElement* root)
-{
-  this->init();
-  if (root != NULL)
-    this->loadParams(root);
-
-  //weapons:
-  Weapon* wpRight = new TestGun(0);
-  wpRight->setName("testGun Right");
-  Weapon* wpLeft = new TestGun(1);
-  wpLeft->setName("testGun Left");
-  Weapon* cannon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(CL_CANNON));
-
-  cannon->setName("BFG");
-
-  this->weaponMan->addWeapon(wpLeft, 1, 0);
-  this->weaponMan->addWeapon(wpRight,1 ,1);
-  this->weaponMan->addWeapon(cannon, 0, 6);
-
-  //this->weaponMan->addWeapon(turret, 3, 0);
-
-  this->weaponMan->changeWeaponConfig(1);
-}
 
 /**
@@ -102,12 +36,6 @@
 Player::~Player ()
 {
-  /* do not delete the weapons, they are contained in the pnode tree
-  and will be deleted there.
-  this only frees the memory allocated to save the list.
-  */
-  delete this->weaponMan;
 }
 
-//#include "glgui_pushbutton.h"
 
 /**
@@ -120,276 +48,37 @@
 
   PRINTF(4)("PLAYER INIT\n");
-  travelSpeed = 15.0;
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
-  bFire = false;
-  acceleration = 10.0;
 
-//   GLGuiButton* button = new GLGuiPushButton();
-//   button->show();
-//   button->setLabel("orxonox");
-//   button->setBindNode(this);
-
-  this->weaponMan = new WeaponManager(this);
-  this->weaponMan->setSlotCount(7);
-
-  this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0));
-  this->weaponMan->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan->setSlotPosition(1, Vector(-2.6, .1, 3.0));
-  this->weaponMan->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan->setSlotPosition(2, Vector(-1.5, .5, -.5));
-  this->weaponMan->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan->setSlotPosition(3, Vector(-1.5, .5, .5));
-  this->weaponMan->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan->setSlotPosition(4, Vector(-1.5, -.5, .5));
-  this->weaponMan->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->weaponMan->setSlotPosition(5, Vector(-1.5, -.5, -.5));
-  this->weaponMan->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-//
-   this->weaponMan->setSlotPosition(6, Vector(-1, 0.0, 0));
-   this->weaponMan->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-   //
-//   this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
-//   this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
-//
-//   this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
-//   this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
-
+  this->controllable = NULL;
 }
 
 
-/**
- * loads the Settings of a Player from an XML-element.
- * @param root the XML-element to load the Player's properties from
- */
-void Player::loadParams(const TiXmlElement* root)
+bool Player::setControllable(Playable* controllable)
 {
-  static_cast<WorldEntity*>(this)->loadParams(root);
-
-
-
+  if(controllable != NULL && controllable->subscribePlayer(this))
+  {
+      this->controllable = controllable;
+      return true;
+  }
+  else
+    return false;
 }
 
-/**
- * adds a weapon to the weapon list of player
- * @param weapon to add
-*/
-void Player::addWeapon(Weapon* weapon)
-{
-  this->weaponMan->addWeapon(weapon);
-}
+bool Player::disconnectControllable()
+ {
+   if(this->controllable == NULL) return true;
 
+   if(this->controllable->unsubscribePlayer(this))
+   {
+     this->controllable = NULL;
+     return true;
+   }
+   else
+     return false;
+ }
 
-/**
- *  removes a weapon from the player
- * @param weapon to remove
-*/
-void Player::removeWeapon(Weapon* weapon)
-{
-  this->weaponMan->removeWeapon(weapon);
-}
+ void Player::process(const Event &event)
+ {
+   if (likely(this->controllable != NULL))
+     this->controllable->process(event);
+ }
 
-
-/**
- *  effect that occurs after the player is spawned
-*/
-void Player::postSpawn ()
-{
-  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
-}
-
-
-/**
- *  the action occuring if the player left the game
-*/
-void Player::leftWorld ()
-{}
-
-
-WorldEntity* ref = NULL;
-/**
- *  this function is called, when two entities collide
- * @param entity: the world entity with whom it collides
- *
- * Implement behaviour like damage application or other miscellaneous collision stuff in this function
- */
-void Player::collidesWith(WorldEntity* entity, const Vector& location)
-{
-  if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)
-  {
-    this->ADDWEAPON();
-    ref = entity;
-    }
-//  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
-}
-
-/**
- *  draws the player after transforming him.
-*/
-void Player::draw () const
-{
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  /* rotate */
-  Vector tmpRot = this->getAbsDir().getSpacialAxis();
-  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-  this->model->draw();
-  glPopMatrix();
-
-  this->weaponMan->draw();
-
-  //this->debug(0);
-}
-
-
-/**
- *  the function called for each passing timeSnap
- * @param time The timespan passed since last update
-*/
-void Player::tick (float time)
-{
-  // player controlled movement
-  this->move(time);
-
-  this->weaponMan->tick(time);
-  // weapon system manipulation
-  this->weaponAction();
-}
-
-
-/**
- *  action if player moves
- * @param time the timeslice since the last frame
-*/
-void Player::move (float time)
-{
-  Vector accel(0.0, 0.0, 0.0);
-  Vector rot(0.0, 0.0, 0.0);
-  float rotVal = 0.0;
-  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
-  /* calculate the direction in which the craft is heading  */
-  Vector direction (1.0, 0.0, 0.0);
-  //direction = this->absDirection.apply (direction);
-  Vector orthDirection (0.0, 0.0, 1.0);
-  //orthDirection = orthDirection.cross (direction);
-
-  if( this->bUp && this->getRelCoor().x < 20)
-    accel += direction;
-  if( this->bDown && this->getRelCoor().x > -5)
-    accel -= direction;
-
-  if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
-  {
-    accel -=(orthDirection);
-    rot +=Vector(1,0,0);
-    rotVal -= .4;
-  }
-  if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
-  {
-    accel += orthDirection;
-    rot += Vector(1,0,0);
-    rotVal += .4;
-  }
-  if (this->bAscend )
-  {
-    accel += Vector(0,1,0);
-    rot += Vector(0,0,1);
-    rotVal += .4;
-  }
-  if (this->bDescend )
-  {
-    accel -= Vector(0,1,0);
-    rot += Vector(0,0,1);
-    rotVal -= .4;
-  }
-
-  Vector move = accel * time *acceleration;
-
-/*  if (accel.z < 0)
-    this->setRelDirSoft(Quaternion(-.4, accel), 5);
-  else if (accel.z > 0)
-    this->setRelDirSoft(Quaternion(.4, accel), 5);
-  else*/
-  rot.normalize();
-  this->setRelDirSoft(Quaternion(rotVal, rot), 5);
-  this->shiftCoor (move);
-}
-
-
-/**
- * weapon manipulation by the player
-*/
-void Player::weaponAction()
-{
-  if( this->bFire)
-    {
-      this->weaponMan->fire();
-    }
-}
-
-/**
- * @todo switch statement ??
- */
-void Player::process(const Event &event)
-{
-  if( event.type == KeyMapper::PEV_UP)
-      this->bUp = event.bPressed;
-  else if( event.type == KeyMapper::PEV_DOWN)
-      this->bDown = event.bPressed;
-  else if( event.type == KeyMapper::PEV_RIGHT)
-      this->bRight= event.bPressed;
-  else if( event.type == KeyMapper::PEV_LEFT)
-      this->bLeft = event.bPressed;
-  else if( event.type == KeyMapper::PEV_FIRE1)
-      this->bFire = event.bPressed;
-  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
-    this->weaponMan->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
-  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
-    this->weaponMan->previousWeaponConfig();
-
-  else if( event.type == SDLK_PAGEUP)
-    this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0);
-  else if( event.type == SDLK_PAGEDOWN)
-    this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0);
-}
-
-#include "weapons/aiming_turret.h"
-// FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
-void Player::ADDWEAPON()
-{
-  Weapon* turret = NULL;
-
-  if ((float)rand()/RAND_MAX < .1)
-  {
-    //if (this->weaponMan->hasFreeSlot(2, WTYPE_TURRET))
-    {
-      turret = new Turret();
-      this->weaponMan->addWeapon(turret, 2);
-      this->weaponMan->changeWeaponConfig(2);
-    }
-  }
-  else
-  {
-    //if (this->weaponMan->hasFreeSlot(3))
-    {
-      turret = new AimingTurret();
-      this->weaponMan->addWeapon(turret, 3);
-
-      this->weaponMan->changeWeaponConfig(3);
-    }
-  }
-
-  if(turret != NULL)
-  {
-    turret->setName("Turret");
-    turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
-  }
-}
Index: branches/avi_play/src/world_entities/player.h
===================================================================
--- branches/avi_play/src/world_entities/player.h	(revision 5923)
+++ branches/avi_play/src/world_entities/player.h	(revision 5924)
@@ -7,13 +7,8 @@
 #define _PLAYER_H
 
-#include "world_entity.h"
-#include "physics_interface.h"
 #include "event_listener.h"
 
-template<class T> class tList;
-class Weapon;
-class WeaponManager;
-class Vector;
-class Event;
+/* Forward Declaration */
+class Playable;
 
 //! Basic controllable WorldEntity
@@ -23,51 +18,25 @@
      the player.cc for debug also
 */
-class Player : public WorldEntity, public EventListener
+class Player : public EventListener
 {
-  friend class World;
 
   public:
     Player();
-    Player(const char* fileName);
-    Player(const TiXmlElement* root);
     virtual ~Player();
 
-    void init();
-    void loadParams(const TiXmlElement* root);
+    bool              setControllable(Playable* controllalble);
+    inline Playable*  getControllable() { return this->controllable; };
 
-    void addWeapon(Weapon* weapon);
-    void removeWeapon(Weapon* weapon);
+    bool              disconnectControllable();
 
-    virtual void postSpawn();
-    virtual void leftWorld();
+    // eventListener extension.
+    virtual void      process(const Event &event);
 
-    virtual void collidesWith(WorldEntity* entity, const Vector& location);
-    virtual void tick(float time);
-    virtual void draw() const;
-
-    virtual void process(const Event &event);
+  private:
+    void              init();
 
 
   private:
-    void move(float time);
-    void weaponAction();
-
-    // !! temporary !!
-    void ADDWEAPON();
-
-  private:
-    bool                  bUp;                //!< up button pressed.
-    bool                  bDown;              //!< down button pressed.
-    bool                  bLeft;              //!< left button pressed.
-    bool                  bRight;             //!< right button pressed.
-    bool                  bAscend;            //!< ascend button pressed.
-    bool                  bDescend;           //!< descend button presses.
-    bool                  bFire;              //!< fire button pressed.
-
-    WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
-
-    Vector                velocity;           //!< the velocity of the player.
-    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
-    float                 acceleration;       //!< the acceleration of the player.
+    Playable*         controllable;                  //!< The one we controll or NULL if none
 };
 
Index: branches/avi_play/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- branches/avi_play/src/world_entities/power_ups/laser_power_up.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/power_ups/laser_power_up.cc	(revision 5924)
@@ -79,5 +79,5 @@
 {
  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
- if (entity->isA(CL_PLAYER))
+ if (entity->isA(CL_PLAYABLE))
   State::getWorldEntityList()->remove(this);
 }
Index: branches/avi_play/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- branches/avi_play/src/world_entities/power_ups/turret_power_up.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/power_ups/turret_power_up.cc	(revision 5924)
@@ -79,5 +79,5 @@
 {
  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
- if (entity->isA(CL_PLAYER))
+ if (entity->isA(CL_PLAYABLE))
   State::getWorldEntityList()->remove(this);
 }
Index: branches/avi_play/src/world_entities/space_ships/space_ship.cc
===================================================================
--- branches/avi_play/src/world_entities/space_ships/space_ship.cc	(revision 5924)
+++ branches/avi_play/src/world_entities/space_ships/space_ship.cc	(revision 5924)
@@ -0,0 +1,401 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Benjamin Knecht
+   co-programmer: ...
+
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "executor/executor.h"
+#include "space_ship.h"
+
+#include "objModel.h"
+#include "resource_manager.h"
+
+#include "weapons/weapon_manager.h"
+#include "weapons/test_gun.h"
+#include "weapons/turret.h"
+#include "weapons/cannon.h"
+
+#include "factory.h"
+#include "key_mapper.h"
+
+using namespace std;
+
+CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
+
+/**
+ *  creates the controlable Spaceship
+ */
+SpaceShip::SpaceShip()
+{
+  this->init();
+}
+
+/**
+ *  destructs the spaceship, deletes alocated memory
+ */
+SpaceShip::~SpaceShip ()
+{
+}
+
+/**
+ * loads a Spaceships information from a specified file.
+ * @param fileName the name of the File to load the spaceship from (absolute path)
+ */
+SpaceShip::SpaceShip(const char* fileName)
+{
+  this->init();
+  TiXmlDocument doc(fileName);
+
+  if(!doc.LoadFile())
+  {
+    PRINTF(2)("Loading file %s failed for spaceship.\n", fileName);
+    return;
+  }
+
+  this->loadParams(doc.RootElement());
+}
+
+/**
+ *  creates a new Spaceship from Xml Data
+ * @param root the xml element containing spaceship data
+
+   @todo add more parameters to load
+*/
+SpaceShip::SpaceShip(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+
+  //weapons:
+  Weapon* wpRight = new TestGun(0);
+  wpRight->setName("testGun Right");
+  Weapon* wpLeft = new TestGun(1);
+  wpLeft->setName("testGun Left");
+  Weapon* cannon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(CL_CANNON));
+
+  cannon->setName("BFG");
+
+  this->getWeaponManager()->addWeapon(wpLeft, 1, 0);
+  this->getWeaponManager()->addWeapon(wpRight,1 ,1);
+  this->getWeaponManager()->addWeapon(cannon, 0, 6);
+
+  //this->getWeaponManager()->addWeapon(turret, 3, 0);
+
+  this->getWeaponManager()->changeWeaponConfig(1);
+}
+
+
+/**
+ * initializes a Spaceship
+ */
+void SpaceShip::init()
+{
+//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
+  this->setClassID(CL_SPACE_SHIP, "SpaceShip");
+
+  PRINTF(4)("SPACESHIP INIT\n");
+
+
+  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
+  bFire = false;
+
+  travelSpeed = 15.0;
+  this->velocity = Vector(0.0,0.0,0.0);
+  this->velocityDir = Vector(1.0,0.0,0.0);
+
+//   GLGuiButton* button = new GLGuiPushButton();
+//   button->show();
+//   button->setLabel("orxonox");
+//   button->setBindNode(this);
+
+  //add events to the eventlist
+  registerEvent(KeyMapper::PEV_UP);
+  registerEvent(KeyMapper::PEV_DOWN);
+  registerEvent(KeyMapper::PEV_LEFT);
+  registerEvent(KeyMapper::PEV_RIGHT);
+  registerEvent(KeyMapper::PEV_FIRE1);
+  registerEvent(KeyMapper::PEV_NEXT_WEAPON);
+  registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON);
+  registerEvent(SDLK_PAGEUP);
+  registerEvent(SDLK_PAGEDOWN);
+
+  this->getWeaponManager()->setSlotCount(7);
+
+  this->getWeaponManager()->setSlotPosition(0, Vector(-2.6, .1, -3.0));
+  this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->getWeaponManager()->setSlotPosition(1, Vector(-2.6, .1, 3.0));
+  this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5));
+  this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
+
+  this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5));
+  this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
+
+  this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5));
+  this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
+
+  this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5));
+  this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
+//
+   this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0));
+   this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+   //
+//   this->getWeaponManager()->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
+//   this->getWeaponManager()->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
+//
+//   this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
+//   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
+
+}
+
+/**
+ * loads the Settings of a SpaceShip from an XML-element.
+ * @param root the XML-element to load the Spaceship's properties from
+ */
+void SpaceShip::loadParams(const TiXmlElement* root)
+{
+  static_cast<WorldEntity*>(this)->loadParams(root);
+}
+
+
+/**
+ * adds a weapon to the weapon list of the spaceship
+ * @param weapon to add
+*/
+void SpaceShip::addWeapon(Weapon* weapon)
+{
+  this->getWeaponManager()->addWeapon(weapon);
+}
+
+
+/**
+ *  removes a weapon from the spaceship
+ * @param weapon to remove
+*/
+void SpaceShip::removeWeapon(Weapon* weapon)
+{
+  this->getWeaponManager()->removeWeapon(weapon);
+}
+
+/**
+ *  effect that occurs after the SpaceShip is spawned
+*/
+void SpaceShip::postSpawn ()
+{
+  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
+}
+
+/**
+ *  the action occuring if the spaceship left the game
+*/
+void SpaceShip::leftWorld ()
+{}
+
+WorldEntity* ref = NULL;
+/**
+ *  this function is called, when two entities collide
+ * @param entity: the world entity with whom it collides
+ *
+ * Implement behaviour like damage application or other miscellaneous collision stuff in this function
+ */
+void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)
+  {
+    this->ADDWEAPON();
+    ref = entity;
+    }
+//  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
+}
+
+/**
+ *  draws the spaceship after transforming it.
+*/
+void SpaceShip::draw () const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  this->model->draw();
+  glPopMatrix();
+
+  this->getWeaponManager()->draw();
+
+  //this->debug(0);
+}
+
+/**
+ *  the function called for each passing timeSnap
+ * @param time The timespan passed since last update
+*/
+void SpaceShip::tick (float time)
+{
+  // spaceship controlled movement
+  this->calculateVelocity(time);
+
+  Vector move = (velocity)*time;
+
+  //orient the spaceship model in the direction of movement.
+
+  this->shiftCoor (move);
+
+  this->getWeaponManager()->tick(time);
+  // weapon system manipulation
+  this->weaponAction();
+}
+
+/**
+ *  calculate the velocity
+ * @param time the timeslice since the last frame
+*/
+void SpaceShip::calculateVelocity (float time)
+{
+  Vector accel(0.0, 0.0, 0.0);
+  //Vector rot(0.0, 0.0, 0.0);
+  //float rotVal = 0.0;
+  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
+  /* calculate the direction in which the craft is heading  */
+
+  if( this->bUp )
+   {
+     this->shiftCoor(this->getAbsDirX());
+      //if(travelSpeed <= 5000)  travelSpeed += 10;
+   }
+
+  if( this->bDown )
+   {
+     this->shiftCoor(Vector()-this->getAbsDirX());
+     //if(travelSpeed >= 10) travelSpeed -= 10;
+   }
+
+  if( this->bLeft /* > -this->getRelCoor().z*2*/)
+  {
+    this->shiftDir(Quaternion(time, Vector(0,1,0)));
+//    accel -= rightDirection;
+    //velocityDir.normalize();
+    //rot +=Vector(1,0,0);
+    //rotVal -= .4;
+  }
+  if( this->bRight /* > this->getRelCoor().z*2*/)
+  {
+    this->shiftDir(Quaternion(-time, Vector(0,1,0)));
+
+    //    accel += rightDirection;
+    //velocityDir.normalize();
+    //rot += Vector(1,0,0);
+    //rotVal += .4;
+  }
+  if (this->bAscend )
+  {
+    this->shiftDir(Quaternion(time, Vector(0,0,1)));
+
+//    accel += upDirection;
+    //velocityDir.normalize();
+    //rot += Vector(0,0,1);
+    //rotVal += .4;
+  }
+  if (this->bDescend )
+  {
+    this->shiftDir(Quaternion(-time, Vector(0,0,1)));
+
+    //    accel -= upDirection;
+    //velocityDir.normalize();
+    //rot += Vector(0,0,1);
+    //rotVal -= .4;
+  }
+
+  velocity += accel*(time);
+  //rot.normalize();
+  //this->setRelDirSoft(Quaternion(rotVal, rot), 5);
+}
+
+/**
+ * weapon manipulation by the player
+*/
+void SpaceShip::weaponAction()
+{
+  if( this->bFire)
+    {
+      this->getWeaponManager()->fire();
+    }
+}
+
+/**
+ * @todo switch statement ??
+ */
+void SpaceShip::process(const Event &event)
+{
+  if( event.type == KeyMapper::PEV_UP)
+      this->bUp = event.bPressed;
+  else if( event.type == KeyMapper::PEV_DOWN)
+      this->bDown = event.bPressed;
+  else if( event.type == KeyMapper::PEV_RIGHT)
+      this->bRight= event.bPressed;
+  else if( event.type == KeyMapper::PEV_LEFT)
+      this->bLeft = event.bPressed;
+  else if( event.type == KeyMapper::PEV_FIRE1)
+      this->bFire = event.bPressed;
+  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
+    this->getWeaponManager()->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
+  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
+    this->getWeaponManager()->previousWeaponConfig();
+
+  else if( event.type == SDLK_PAGEUP)
+    this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0);
+  else if( event.type == SDLK_PAGEDOWN)
+    this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0);
+}
+
+#include "weapons/aiming_turret.h"
+// FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
+void SpaceShip::ADDWEAPON()
+{
+  Weapon* turret = NULL;
+
+  if ((float)rand()/RAND_MAX < .1)
+  {
+    //if (this->getWeaponManager()->hasFreeSlot(2, WTYPE_TURRET))
+    {
+      turret = new Turret();
+      this->getWeaponManager()->addWeapon(turret, 2);
+      this->getWeaponManager()->changeWeaponConfig(2);
+    }
+  }
+  else
+  {
+    //if (this->getWeaponManager()->hasFreeSlot(3))
+    {
+      turret = new AimingTurret();
+      this->getWeaponManager()->addWeapon(turret, 3);
+
+      this->getWeaponManager()->changeWeaponConfig(3);
+    }
+  }
+
+  if(turret != NULL)
+  {
+    turret->setName("Turret");
+    turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
+  }
+}
Index: branches/avi_play/src/world_entities/space_ships/space_ship.h
===================================================================
--- branches/avi_play/src/world_entities/space_ships/space_ship.h	(revision 5924)
+++ branches/avi_play/src/world_entities/space_ships/space_ship.h	(revision 5924)
@@ -0,0 +1,65 @@
+/*!
+ * @file space_ship.h
+ * Implements the Control of a Spaceship
+ */
+
+#ifndef _SPACE_SHIP_H
+#define _SPACE_SHIP_H
+
+#include "playable.h"
+
+template<class T> class tList;
+class Vector;
+class Event;
+
+class SpaceShip : public Playable
+{
+
+  public:
+
+    SpaceShip();
+    SpaceShip(const char* fileName);
+    SpaceShip(const TiXmlElement* root);
+    virtual ~SpaceShip();
+
+    void init();
+    void loadParams(const TiXmlElement* root);
+
+    void addWeapon(Weapon* weapon );
+    void removeWeapon(Weapon* weapon);
+
+    virtual void postSpawn();
+    virtual void leftWorld();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+    virtual void tick(float time);
+    virtual void draw() const;
+
+    virtual void process(const Event &event);
+
+
+
+  private:
+
+    void calculateVelocity(float time);
+    void weaponAction();
+
+    // !! temporary !!
+    void ADDWEAPON();
+
+    bool                  bUp;                //!< up button pressed.
+    bool                  bDown;              //!< down button pressed.
+    bool                  bLeft;              //!< left button pressed.
+    bool                  bRight;             //!< right button pressed.
+    bool                  bAscend;            //!< ascend button pressed.
+    bool                  bDescend;           //!< descend button presses.
+    bool                  bFire;              //!< fire button pressed.
+
+    Vector                velocity;           //!< the velocity of the player.
+    Vector                velocityDir;        //!< the direction of the velocity of the spaceship
+    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
+    float                 acceleration;       //!< the acceleration of the player.
+
+};
+
+#endif /* _SPACE_SHIPS_H */
Index: branches/avi_play/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- branches/avi_play/src/world_entities/weapons/aiming_turret.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/weapons/aiming_turret.cc	(revision 5924)
@@ -93,5 +93,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
-  this->setProjectileType(CL_ROCKET);
+  this->setProjectileType(CL_GUIDED_MISSILE);
 
 
@@ -142,7 +142,8 @@
     return;
 
-    pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13)
+  pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13)
             /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
 
+  pj->setTarget(this->target->getParent());
   pj->setParent(NullParent::getInstance());
   pj->setAbsCoor(this->getEmissionPoint());
Index: branches/avi_play/src/world_entities/weapons/ground_turret.cc
===================================================================
--- branches/avi_play/src/world_entities/weapons/ground_turret.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/weapons/ground_turret.cc	(revision 5924)
@@ -145,5 +145,6 @@
 void GroundTurret::collidesWith (WorldEntity* entity, const Vector& location)
 {
-
+  if (entity->isA(CL_PROJECTILE))
+    this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
 }
 
Index: branches/avi_play/src/world_entities/weapons/guided_missile.cc
===================================================================
--- branches/avi_play/src/world_entities/weapons/guided_missile.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/weapons/guided_missile.cc	(revision 5924)
@@ -48,6 +48,6 @@
   this->energyMin = 1;
   this->energyMax = 10;
-  this->lifeSpan = 5;
-  this->agility = 5;
+  this->lifeSpan = 5.0;
+  this->agility = 5.0;
   this->maxVelocity = 100;
 
Index: branches/avi_play/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- branches/avi_play/src/world_entities/weapons/weapon_manager.cc	(revision 5923)
+++ branches/avi_play/src/world_entities/weapons/weapon_manager.cc	(revision 5924)
@@ -110,6 +110,4 @@
   this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
   this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
-
-  this->targetIterator = NULL;
 }
 
@@ -337,49 +335,4 @@
     }
   }
-}
-
-
-/**
- * Selects an Entity from the NPC-list, and returns the Target
- */
-PNode* WeaponManager::getSomeTarget()
-{
-   if (this->targetIterator == NULL)
-   {
-     std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
-     if (npcList != NULL)
-     {
-       this->targetIterator = npcList->begin();
-     }
-     else
-       return NULL;
-   }
-
-   ///FIXME
-//   this->targetIterator++;
-   PNode* retNode = dynamic_cast<PNode*>((*targetIterator));
-//   if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
-//     retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
-
-   return retNode;
-}
-
-
-/**
- * Selects an Entity from the Entity-List, that is near of the carrier PNode.
- * @param carrier: The PNode from which the distance should be measured
- * @param distance: The Maximum Distance to Return.
- */
-PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)
-{
-  std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);
-  if (npcList != NULL)
-  {
-    list<BaseObject*>::iterator node;
-    for (node= npcList->begin(); node != npcList->end(); node++)
-      if ((carrier->getAbsCoor() - dynamic_cast<PNode*>(*node)->getAbsCoor()).len() < distance)
-        return dynamic_cast<PNode*>(*node);
-  }
-  return this->getFixedTarget();
 }
 
Index: branches/avi_play/src/world_entities/weapons/weapon_manager.h
===================================================================
--- branches/avi_play/src/world_entities/weapons/weapon_manager.h	(revision 5923)
+++ branches/avi_play/src/world_entities/weapons/weapon_manager.h	(revision 5924)
@@ -80,6 +80,4 @@
     /** @returns a fixed target namely the Crosshair's 3D position */
     inline PNode* getFixedTarget() const { return this->crosshair; };
-    PNode* getSomeTarget();
-    PNode* getDistanceTarget(const PNode* carrier, float distance);
 
     void fire();
@@ -109,5 +107,3 @@
     Crosshair*              crosshair;                                //!< an aim.
     tAnimation<Crosshair>*  crossHairSizeAnim;                        //!< An animation for the crosshair (scaling)
-
-    std::list<BaseObject*>::iterator  targetIterator;                           //!< An iterator for traversion lists of enemies.
 };
Index: branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
===================================================================
--- branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc	(revision 5923)
+++ branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc	(revision 5924)
@@ -375,6 +375,6 @@
   else if( event.type == EV_MOUSE_MOTION)
   {
-    this->xMouse = event.x;
-    this->yMouse = event.y;
+    this->xMouse = event.xRel;
+    this->yMouse = event.yRel;
   }
 }
