Index: orxonox/branches/dave/core/ai.cc
===================================================================
--- orxonox/branches/dave/core/ai.cc	(revision 1995)
+++ orxonox/branches/dave/core/ai.cc	(revision 1995)
@@ -0,0 +1,32 @@
+
+
+/* 
+   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: Patrick Boenzli
+   co-programmer: ...
+*/
+
+
+#include "ai.h"
+
+
+using namespace std;
+
+
+
+AI::AI () {}
+
+
+
+AI::~AI () {}
+
+
Index: orxonox/branches/dave/core/ai.h
===================================================================
--- orxonox/branches/dave/core/ai.h	(revision 1995)
+++ orxonox/branches/dave/core/ai.h	(revision 1995)
@@ -0,0 +1,15 @@
+
+#ifndef AI_H
+#define AI_H
+
+#include "data_tank.h"
+
+class AI {
+
+ public:
+  AI ();
+  ~AI ();
+
+};
+
+#endif
Index: orxonox/branches/dave/core/shoot_laser.cc
===================================================================
--- orxonox/branches/dave/core/shoot_laser.cc	(revision 1995)
+++ orxonox/branches/dave/core/shoot_laser.cc	(revision 1995)
@@ -0,0 +1,147 @@
+
+
+/* 
+   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: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "shoot_laser.h"
+
+#include <iostream>
+
+
+using namespace std;
+
+
+
+ShootLaser::ShootLaser () 
+{
+  lastShoot = null;
+  step = 1.0;
+  inhibitor = 0;
+}
+
+
+ShootLaser::~ShootLaser () {}
+
+
+void ShootLaser::drawShoot() 
+{
+
+  //cout << "ShootLaser::drawShoot" << endl;
+  /* now draw all the shoots (many) */
+  shoot* tmpShoot = lastShoot;
+  shoot* lastRef = null;
+  while( tmpShoot != null )
+    {
+      glPushMatrix(); 
+      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
+      tmpShoot->xCor+=tmpShoot->xVel;
+      tmpShoot->yCor+=tmpShoot->yVel;
+      glScalef(0.1, 0.1, 0.1);
+      glutWireCube(1.0);
+      glPopMatrix();
+
+      /* garbage collection: look if shoot is outside world */
+      /* fix1: weak boundaries check all four sides */
+      /* fix2: conditions, that a struct tree can be cut off */
+      /* fix3: more efficent and nicer please */
+      if (tmpShoot->yCor - DataTank::yOffset > 20) 
+	{
+	  /* normal case: delete one element, link the others */
+	  if (lastRef != null) 
+	    {
+	      //cout << "garbage collection" << endl;
+	      lastRef->next = tmpShoot->next;
+	      delete tmpShoot;
+	      tmpShoot = lastRef->next;
+	      //cout << "garbage collection left" << endl;
+	    }
+	  else
+	    {
+	      /* special case: first element to be processed */
+	      //cout << "garbage collecton: first el in queue" << endl;
+	      lastRef = tmpShoot->next;
+	      delete tmpShoot;
+	      tmpShoot = lastRef;
+	      lastShoot = tmpShoot;
+	      if (tmpShoot != null) 
+		{
+		  tmpShoot = tmpShoot->next;
+		  //cout << "noch nich null" << endl;
+		}
+	      else 
+		{
+		  lastRef = null;
+		  tmpShoot = null;
+		  lastShoot = null;
+		  //cout << "endl null" << endl;
+		}
+	      
+	      //cout << "garbage collection: firtst el in queue left" << endl;
+	    }
+	}
+      else 
+	{
+	  lastRef = tmpShoot;
+	  tmpShoot = tmpShoot->next;
+	}
+    }
+  //cout << "ShootLaser::drawShoot - finished" << endl;
+}
+
+
+void ShootLaser::addShoot(shoot* sh) 
+{
+  sh->next = null;
+  lastShoot = sh;
+}
+
+void ShootLaser::addShoot(float x, float y, float z)
+{
+  //cout << "ShootLaser::addShoot" << endl;
+  shoot* sh = new shoot;
+  sh->xCor = x; sh->yCor = y; sh->zCor = z;
+  sh->xVel = 0; sh->yVel = .4/step; sh->zVel = 0;
+  sh->next = lastShoot;
+  lastShoot = sh;
+}
+
+void ShootLaser::addShootExt(float x, float y, float z, 
+			     float xVel, float yVel, float zVel)
+{
+  //cout << "ShootLaser::addShootExtended" << endl;
+  shoot* sh = new shoot;
+  sh->xCor = x; sh->yCor = y; sh->zCor = z;
+  sh->xVel = xVel/step; sh->yVel = yVel/step; sh->zVel = zVel/step;
+  sh->next = lastShoot;
+  lastShoot = sh;
+}
+
+void ShootLaser::setShootStep(float step) 
+{
+  cout << "ShootLaser::setShootStep to " << step << endl;
+  this->step = step;
+}
+
+
+/* Exterminate shoot from game, implement this method  */
+/* if you like to add animatiion */
+void ShootLaser::removeShoot(shoot* sh)
+{
+  glPushMatrix(); 
+  glTranslatef(sh->xCor, sh->yCor, sh->zCor);
+  glutWireCube(1.0);
+  glPopMatrix();
+}
Index: orxonox/branches/dave/core/shoot_laser.h
===================================================================
--- orxonox/branches/dave/core/shoot_laser.h	(revision 1995)
+++ orxonox/branches/dave/core/shoot_laser.h	(revision 1995)
@@ -0,0 +1,48 @@
+
+#ifndef SHOOT_LASER_H
+#define SHOOT_LASER_H
+
+/* openGL Headers */
+#include <GL/glut.h>
+
+#include "stdincl.h"
+#include "data_tank.h"
+
+class ShootLaser {
+
+
+ public:
+  
+  /* a list of all shoot-amental objects */
+  struct shoot {
+    shoot *next;
+    float xCor;
+    float yCor;
+    float zCor;    
+    float xVel;
+    float yVel;
+    float zVel;
+    float collisionRadius;
+  };
+  shoot* lastShoot;
+
+  ShootLaser ();
+  ~ShootLaser ();
+
+  int inhibitor;
+
+  void drawShoot(void);
+  void addShoot(shoot* sh);
+  void addShoot(float x, float y, float z);
+  void addShootExt(float x, float y, float z, float xVel, float yVel, float zVel);
+  void setShootStep(float step);
+  void removeShoot(shoot* sh);
+
+
+ private:
+
+  float step;
+
+};
+
+#endif
Index: orxonox/branches/dave/core/shoot_rocket.cc
===================================================================
--- orxonox/branches/dave/core/shoot_rocket.cc	(revision 1995)
+++ orxonox/branches/dave/core/shoot_rocket.cc	(revision 1995)
@@ -0,0 +1,208 @@
+
+
+/* 
+   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: Patrick Boenzli
+   co-programmer:  Benjamin Grauer
+*/
+
+
+#include "shoot_rocket.h"
+
+#include <iostream>
+
+
+using namespace std;
+
+
+
+ShootRocket::ShootRocket ()
+{
+  lastShoot = null;
+  step = 1.0;
+  inhibitor =0;
+  rotateAngle = 0.0;
+}
+
+
+ShootRocket::~ShootRocket () {}
+
+
+void ShootRocket::drawShoot() 
+{
+
+  //cout << "ShootRocket::drawShoot" << endl;
+  /* now draw all the shoots (many) */
+  shoot* tmpShoot = lastShoot;
+  shoot* lastRef = null;
+  while( tmpShoot != null )
+    {
+      glPushMatrix(); 
+      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
+      switch (tmpShoot->type)
+	{
+	case BACKPARABLE:
+	  tmpShoot->xCor+=tmpShoot->xVel;
+	  tmpShoot->yCor+=tmpShoot->yVel;
+	  tmpShoot->xVel+=tmpShoot->xAcc;
+	  tmpShoot->yVel+=tmpShoot->yAcc;
+	  break;
+	
+	case SIDEACC:
+	  if (tmpShoot->xVel >= .01 || tmpShoot->xVel <= -.01)
+	    {
+	      tmpShoot->xCor+=tmpShoot->xVel;
+	      tmpShoot->yCor+=tmpShoot->yVel;
+	      tmpShoot->xVel*=tmpShoot->xAcc;
+	    }
+	  else
+	    {
+	      tmpShoot->xCor+=tmpShoot->xVel;
+	      tmpShoot->yCor+=tmpShoot->yVel;
+	      tmpShoot->yVel+=tmpShoot->yVel*tmpShoot->yAcc;
+	    }
+	  break;
+	
+	case ROTATER:
+	  tmpShoot->xCor+=tmpShoot->xVel;
+	  tmpShoot->yCor+=tmpShoot->yVel;
+	  tmpShoot->zCor+=tmpShoot->zVel;
+	  break;
+	
+	}
+      
+      glScalef(0.1, 0.1, 0.1);
+      glutWireCube(1.0);
+      glPopMatrix();
+
+      /* garbage collection: look if shoot is outside world */
+      /* fix1: weak boundaries check all four sides */
+      /* fix2: conditions, that a struct tree can be cut off */
+      /* fix3: more efficent and nicer please */
+      if (tmpShoot->yCor - DataTank::yOffset > 20) 
+	{
+	  /* normal case: delete one element, link the others */
+	  if (lastRef != null) 
+	    {
+	      //cout << "garbage collection" << endl;
+	      lastRef->next = tmpShoot->next;
+	      delete tmpShoot;
+	      tmpShoot = lastRef->next;
+	      //cout << "garbage collection left" << endl;
+	    }
+	  else
+	    {
+	      /* special case: first element to be processed */
+	      //cout << "garbage collecton: first el in queue" << endl;
+	      lastRef = tmpShoot->next;
+	      delete tmpShoot;
+	      tmpShoot = lastRef;
+	      lastShoot = tmpShoot;
+	      if (tmpShoot != null) 
+		{
+		  tmpShoot = tmpShoot->next;
+		  //cout << "noch nich null" << endl;
+		}
+	      else 
+		{
+		  lastRef = null;
+		  tmpShoot = null;
+		  lastShoot = null;
+		  //cout << "endl null" << endl;
+		}
+	      
+	      //cout << "garbage collection: firtst el in queue left" << endl;
+	    }
+	}
+      else 
+	{
+	  lastRef = tmpShoot;
+	  tmpShoot = tmpShoot->next;
+	}
+    }
+  //cout << "ShootRocket::drawShoot - finished" << endl;
+}
+
+
+void ShootRocket::addShoot(shoot* sh) 
+{
+  sh->next = null;
+  lastShoot = sh;
+}
+
+void ShootRocket::addBackParable(float x, float y, float z)
+{
+  
+  //cout << "ShootRocket::addShoot" << endl;
+  shoot* sh = new shoot;
+  sh->type = BACKPARABLE;
+  sh->xCor = x; sh->yCor = y; sh->zCor = z;
+  sh->xVel = (-1+(float)random() / 1000000000/step)/5; 
+  sh->yVel = -.3;
+  sh->zVel = (1-(float)random() / 1000000000/step)/5;
+  sh->xAcc = 0; sh->yAcc = .01/step; sh->zAcc = 0;
+  sh->next = lastShoot;
+  lastShoot = sh;
+  }
+void ShootRocket::addSideAcc(float x, float y, float z, enum RocketDirection direction)
+{
+  //cout << "ShootRocket::addShoot" << endl;
+  shoot* sh = new shoot;
+  sh->type = SIDEACC;
+  sh->xCor = x; sh->yCor = y; sh->zCor = z;
+  switch (direction)
+    {
+    case LEFT:
+      sh->xVel = -.5; sh->yVel = .05; sh->zVel = 0;
+      break;
+    case RIGHT:
+      sh->xVel = .5; sh->yVel = .05; sh->zVel = 0;
+      break;
+    }
+  sh->xAcc = .9; sh->yAcc = .02; sh->zAcc = 0;
+  sh->next = lastShoot;
+  lastShoot = sh;
+}
+
+void ShootRocket::addRotater(float x, float y, float z)
+{
+  
+  static float radius = 2;
+  rotateAngle+=.1;
+  //cout << "ShootRocket::addShoot" << endl;
+  shoot* sh = new shoot;
+  sh->type = ROTATER;
+  sh->xCor = x+radius*sin(rotateAngle); sh->yCor = y; sh->zCor = z+radius*cos(rotateAngle);
+  sh->xVel = .1*cos(rotateAngle)/step;
+  sh->yVel = 0.4/step;
+  sh->zVel = .1*sin(rotateAngle)/step;
+  sh->xAcc = 1.01; sh->yAcc = 1.01/step; sh->zAcc = 1.01;
+  sh->next = lastShoot;
+  lastShoot = sh;
+}
+
+void ShootRocket::setShootStep(float step) 
+{
+  cout << "ShootRocket::setShootStep to " << step << endl;
+  this->step = step;
+}
+
+
+/* Exterminate shoot from game, implement this method  */
+/* if you like to add animatiion */
+void ShootRocket::removeShoot(shoot* sh)
+{
+  glPushMatrix(); 
+  glTranslatef(sh->xCor, sh->yCor, sh->zCor);
+  glutWireCube(1.0);
+  glPopMatrix();
+}
Index: orxonox/branches/dave/core/shoot_rocket.h
===================================================================
--- orxonox/branches/dave/core/shoot_rocket.h	(revision 1995)
+++ orxonox/branches/dave/core/shoot_rocket.h	(revision 1995)
@@ -0,0 +1,61 @@
+
+#ifndef SHOOT_ROCKET_H
+#define SHOOT_ROCKET_H
+
+/* openGL Headers */
+#include <GL/glut.h>
+#include <math.h>
+
+#include "stdincl.h"
+#include "data_tank.h"
+#include "npc.h"
+
+enum RocketType { HOMING, SIDEACC, BACKPARABLE, ROTATER};
+enum RocketDirection {LEFT, RIGHT, UP, DOWN};
+
+class ShootRocket {
+
+
+ public:
+  
+  /* a list of all shoot-amental objects */
+  struct shoot {
+    enum RocketType type;
+    shoot *next;
+    float xCor;
+    float yCor;
+    float zCor;    
+    float xVel;
+    float yVel;
+    float zVel;
+    float xAcc;
+    float yAcc;
+    float zAcc;
+    float age;
+    float collisionRadius;
+  };
+  shoot* lastShoot;
+  
+  ShootRocket ();
+  ~ShootRocket ();
+  
+  int inhibitor;
+  float rotateAngle;
+
+  void drawShoot(void);
+  void addShoot(shoot* sh);
+  void addBackParable(float x, float y, float z);
+  void addSideAcc(float x, float y, float z, enum RocketDirection direction);
+  void addRotater(float x, float y, float z);
+
+  void setShootStep(float step);
+  void removeShoot(shoot* sh);
+
+
+ private:
+
+  float step;
+
+};
+
+#endif
