Index: orxonox/branches/particleEngine/src/defs/debug.h
===================================================================
--- orxonox/branches/particleEngine/src/defs/debug.h	(revision 3933)
+++ orxonox/branches/particleEngine/src/defs/debug.h	(revision 3934)
@@ -72,4 +72,5 @@
 #define DEBUG_MODULE_FONT               1
 #define DEBUG_MODULE_ANIM               1
+#define DEBUG_MODULE_PARTICLE           4
 
 #define DEBUG_MODULE_NULL_PARENT        0
Index: orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
===================================================================
--- orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc	(revision 3933)
+++ orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc	(revision 3934)
@@ -112,9 +112,7 @@
 {
   // saving the time
-  float countF = (dt+this->saveTime) * this->emissionRate;
-  int count = (int)round(countF);
-  this->saveTime = countF - (float)count;
-
-  printf( "%d::%f::emmit %f\n", count, countF, emissionRate);
+  float count = (dt+this->saveTime) * this->emissionRate;
+  this->saveTime = modff(count, &count);
+  this->saveTime /= this->emissionRate;
 
   for (int i = 0; i <= count; i++)
Index: orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
===================================================================
--- orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc	(revision 3933)
+++ orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc	(revision 3934)
@@ -14,5 +14,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PARTICLE
 
 #include "particle_system.h"
@@ -32,12 +32,14 @@
    \todo this constructor is not jet implemented - do it
 */
-ParticleSystem::ParticleSystem (unsigned int count, PARTICLE_TYPE type) 
+ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
 {
    this->setClassName ("ParticleSystem");
 
+   this->maxCount = maxCount;
+   this->count = 0;
    this->particleType = type;
    this->particles = NULL;
    this->conserve = 1.0;
-   this->setLifeSpan(5.0);
+   this->setLifeSpan(.1);
 
    ParticleEngine::getInstance()->addSystem(this);
@@ -62,5 +64,6 @@
 void ParticleSystem::setLifeSpan(float lifeSpan, float randomLifeSpan)
 {
-
+  this->lifeSpan = lifeSpan;
+  this->randomLifeSpan = randomLifeSpan;
 }
 
@@ -79,12 +82,42 @@
 void ParticleSystem::tick(float dt)
 {
-  Particle* tmpPart = particles;
-  while (likely(tmpPart != NULL))
+  Particle* tickPart = particles;  // the particle to Tick
+  Particle* prevPart = NULL;       // 
+  while (likely(tickPart != NULL))
     {
-      tmpPart->position = tmpPart->position + tmpPart->velocity;
+	  
+      tickPart->position = tickPart->position + tickPart->velocity;
+      // many more to come
+      
 
-      // many more to come
 
-      tmpPart = tmpPart->next;
+
+
+
+      // find out if we have to delete tickPart
+      if ((tickPart->timeToLive -= dt) <= 0)
+	{
+	  // remove the particle from the list
+	  if (likely(prevPart != NULL))
+	    {
+	      prevPart->next = tickPart->next;
+	      delete tickPart;
+	      tickPart = prevPart->next;
+	    }
+	  else
+	    {
+	      prevPart = NULL;
+	      this->particles = tickPart->next;
+	      delete tickPart;
+	      tickPart = this->particles;
+	    }
+	  --this->count;
+	  printf("deleted particle: count %d\n", count);
+	}
+      else
+	{      
+	  prevPart = tickPart;
+	  tickPart = tickPart->next;
+	}
     }
 }
@@ -92,15 +125,15 @@
 void ParticleSystem::draw(void)
 {
-  Particle* tmpPart = particles;
-  if (likely(tmpPart != NULL))
+  Particle* drawPart = particles;
+  if (likely(drawPart != NULL))
     {
-      glBegin(GL_POINTS);
-      while (likely(tmpPart != NULL))
+      glBegin(GL_TRIANGLES);
+      while (likely(drawPart != NULL))
 	{
 	  // draw in DOT mode
-	  glVertex3f(tmpPart->position.x, tmpPart->position.y, tmpPart->position.z);
+	  glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
 	  
 	  
-	  tmpPart = tmpPart->next;
+	  drawPart = drawPart->next;
 	}
       glEnd();
@@ -111,24 +144,31 @@
 void ParticleSystem::addParticle(Vector position, Vector velocity, unsigned int data)
 {
-  // if it is the first Particle
-  if (unlikely(particles == NULL))
+  if (this->count <= this->maxCount)
     {
-      this->particles = new Particle;
-      this->particles->next = NULL;
+      // if it is the first Particle
+      if (unlikely(particles == NULL))
+	{
+	  this->particles = new Particle;
+	  this->particles->next = NULL;
+	}
+      // filling the List from the beginning
+      else
+	{
+	  Particle* tmpPart = new Particle;
+	  tmpPart->next = this->particles;
+	  this->particles = tmpPart;
+	}
+      
+      particles->timeToLive = this->lifeSpan + (float)(random()/RAND_MAX)* this->randomLifeSpan;
+      particles->position = position;
+      particles->velocity = velocity;
+      //  particle->rotation = ; //! \todo rotation is once again something to be done.
+      particles->mass = this->initialMass + (random()/RAND_MAX)* this->randomInitialMass;
+      particles->radius = this->startRadius + (random()/RAND_MAX)*this->randomRadius;
+
+      ++this->count;
     }
-  // filling the List from the beginning
   else
-    {
-      Particle* tmpPart = new Particle;
-      tmpPart->next = this->particles;
-      this->particles = tmpPart;
-    }
-  
-  particles->timeToLive = this->lifeSpan + (float)(random()/RAND_MAX)* this->randomLifeSpan;
-  particles->position = position;
-  particles->velocity = velocity;
-  //  particle->rotation = ; //! \todo rotation is once again something to be done.
-  particles->mass = this->initialMass + (random()/RAND_MAX)* this->randomInitialMass;
-  particles->radius = this->startRadius + (random()/RAND_MAX)*this->randomRadius;
+    PRINTF(4)("maximum count of particles reached not adding any more\n");
 }
 
Index: orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h
===================================================================
--- orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h	(revision 3933)
+++ orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h	(revision 3934)
@@ -44,5 +44,5 @@
 
  public:
-  ParticleSystem(unsigned int particleCount = PARTICLE_DEFAULT_MAX_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE);
+  ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE);
   virtual ~ParticleSystem();
 
@@ -67,5 +67,6 @@
   
   // particles
-  int maxCount;              //!< the count of Particles for this ParticleSystem.
+  int maxCount;              //!< The maximum count of Particles.
+  int count;                 //!< The current count of Particles.
   PARTICLE_TYPE particleType;//!< A type for all the Particles
   Material* material;        //!< A Material for all the Particles.
Index: orxonox/branches/particleEngine/src/orxonox.cc
===================================================================
--- orxonox/branches/particleEngine/src/orxonox.cc	(revision 3933)
+++ orxonox/branches/particleEngine/src/orxonox.cc	(revision 3934)
@@ -36,5 +36,5 @@
 
 #include <string.h>
-int verbose = 3;
+int verbose = 4;
 
 using namespace std;
Index: orxonox/branches/particleEngine/src/story_entities/world.cc
===================================================================
--- orxonox/branches/particleEngine/src/story_entities/world.cc	(revision 3933)
+++ orxonox/branches/particleEngine/src/story_entities/world.cc	(revision 3934)
@@ -377,7 +377,7 @@
 	    this->glmis->step();
 	    
-	    testEmitter = new ParticleEmitter(Vector(1,0,0), 20.0, 10000.0, .1);
+	    testEmitter = new ParticleEmitter(Vector(1,0,0), 0.0, 124.0, .1);
 	    testEmitter->setParent(localPlayer);
-	    testSystem = new ParticleSystem();
+	    testSystem = new ParticleSystem(100000);
 
 	    ParticleEngine::getInstance()->addConnection(testEmitter, testSystem);
