Index: branches/single_player_map/src/world_entities/WorldEntities.am
===================================================================
--- branches/single_player_map/src/world_entities/WorldEntities.am	(revision 8869)
+++ branches/single_player_map/src/world_entities/WorldEntities.am	(revision 8870)
@@ -33,4 +33,5 @@
                 world_entities/projectiles/guided_missile.cc \
                 world_entities/projectiles/hyperblast.cc \
+                world_entities/projectiles/fps_sniper_rifle.cc \
                 \
                 world_entities/power_ups/turret_power_up.cc \
@@ -91,4 +92,5 @@
                 projectiles/guided_missile.h \
                 projectiles/hyperblast.h \
+                projectiles/fps_sniper_rifle.h \
                 \
                 power_ups/turret_power_up.h \
Index: branches/single_player_map/src/world_entities/door.cc
===================================================================
--- branches/single_player_map/src/world_entities/door.cc	(revision 8870)
+++ branches/single_player_map/src/world_entities/door.cc	(revision 8870)
@@ -0,0 +1,135 @@
+
+
+/*
+   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:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "executor/executor.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "kill.h"
+#include "game_rules.h"
+
+#include "test_entity.h"
+
+
+#include "interactive_model.h"
+#include "md2/md2Model.h"
+
+#include "state.h"
+
+using namespace std;
+
+
+CREATE_FACTORY(Door, CL_DOOR);
+
+
+Door::Door ()
+{
+  this->init();
+  this->md2Model = new MD2Model("models/droidika.md2", "models/droideka.pcx");
+}
+
+
+Door::Door(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+Door::~Door ()
+{}
+
+
+
+void Door::init()
+{
+  this->setClassID(CL_DOOR, "Door");
+  this->toList(OM_GROUP_00);
+
+  this->lastCollided = NULL;
+  this->bDeath = false;
+}
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void Door::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "md2animation", this, Door, setAnim)
+      .describe("sets the animation of the md2 model")
+      .defaultValues(1);
+
+}
+
+
+void  Door::setAnim(int animationIndex, int animPlaybackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode);
+}
+
+
+void Door::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+}
+
+
+void Door::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if( this->lastCollided != entity)
+  {
+    this->destroy();
+    this->lastCollided = entity;
+
+    if(State::getGameRules())
+      State::getGameRules()->registerKill(Kill(entity, this));
+  }
+}
+
+
+
+void Door::destroy()
+{
+  if( this->bDeath)
+    return;
+
+  this->bDeath = true;
+  int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
+
+  PRINTF(0)("randi = %i\n", randi);
+
+  if( randi == 1)
+    this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
+  else if( randi == 2)
+    this->setAnim(DEATH_FALLFORWARD, MD2_ANIM_ONCE);
+  else if( randi == 3)
+    this->setAnim(DEATH_FALLBACKSLOW, MD2_ANIM_ONCE);
+  else if( randi == 4)
+    this->setAnim(CROUCH_DEATH, MD2_ANIM_ONCE);
+  else
+    this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);
+}
+
Index: branches/single_player_map/src/world_entities/door.h
===================================================================
--- branches/single_player_map/src/world_entities/door.h	(revision 8870)
+++ branches/single_player_map/src/world_entities/door.h	(revision 8870)
@@ -0,0 +1,43 @@
+#ifndef _TEST_ENTITY_H
+#define _TEST_ENTITY_H
+
+#include "world_entity.h"
+#include "physics_interface.h"
+
+class MD2Loader;
+class MD2Model;
+class MD2Model2;
+struct t3DModel;
+class Material;
+class TiXmlElement;
+class WorldEntity;
+
+class TestEntity : public WorldEntity, public PhysicsInterface
+{
+ public:
+  TestEntity ();
+  TestEntity(const TiXmlElement* root);
+  virtual ~TestEntity ();
+
+  void init();
+  virtual void loadParams(const TiXmlElement* root);
+
+  void setAnim(int animationIndex, int animPlaybackMode);
+
+  virtual void destroy();
+
+  virtual void tick (float time);
+  virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+ private:
+  /* TESTING TESTING TESTING */
+  t3DModel* model;
+  MD2Model* md2Model;
+  Material* material;
+
+  WorldEntity* lastCollided;
+
+  bool bDeath;
+};
+
+#endif /* _TEST_ENTITY_H */
Index: branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc
===================================================================
--- branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 8870)
+++ branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 8870)
@@ -0,0 +1,152 @@
+
+
+/*
+   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:
+
+
+   @todo: direction in which the projectile flights
+   @todo: a target to set/hit
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "fast_factory.h"
+
+#include "fps_sniper_rifle.h"
+
+
+using namespace std;
+
+CREATE_FACTORY(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);
+
+/**
+ *  standard constructor
+
+   creates a new weapon
+*/
+FPSSniperRifle::FPSSniperRifle ( int leftRight)
+  : Weapon()
+{
+  this->init();
+
+  this->leftRight = leftRight;
+}
+
+
+FPSSniperRifle::FPSSniperRifle(const TiXmlElement* root)
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+FPSSniperRifle::~FPSSniperRifle ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+
+void FPSSniperRifle::init()
+{
+  this->setClassID(CL_FPS_SNIPER_RIFLE, "FPSSniperRifle");
+
+//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
+
+  this->loadModel("models/guns/test_gun.obj");
+
+  this->setStateDuration(WS_SHOOTING, .1);
+  this->setStateDuration(WS_RELOADING, .1);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(100000);
+  this->increaseEnergy(100000);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->setProjectileType(CL_LASER);
+  this->prepareProjectiles(20);
+
+}
+
+
+void FPSSniperRifle::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+
+}
+
+
+/**
+ *  this activates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the
+   activation can be connected with an animation. for example the weapon is
+   been armed out.
+*/
+void FPSSniperRifle::activate()
+{
+}
+
+
+/**
+ *  this deactivates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the
+   activation can be connected with an animation. for example the weapon is
+   been armed out.
+*/
+void FPSSniperRifle::deactivate()
+{
+}
+
+
+/**
+ *  fires the weapon
+
+   this is called from the player.cc, when fire-button is been pushed
+   @todo: the ObjectManager deliveres Projectiles not TestBullets! this should be diffrent
+*/
+void FPSSniperRifle::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  pj->setParent(PNode::getNullParent());
+
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+}
+
+
Index: branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h
===================================================================
--- branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h	(revision 8870)
+++ branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h	(revision 8870)
@@ -0,0 +1,57 @@
+/*!
+    @file weapon.h
+  *  a weapon that a player can use
+
+    A Player has a list of weapons, that can be choosen to shoot projectiles
+    (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially
+    or (if able) combined. Therefore you can choose the weapon mode = choose
+    a weapon.
+
+    A weapon is characterized by:
+     o firing-rate: the initial firing rate of a weapon (1/s = Herz)
+     o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
+     o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
+
+    Furthermore there are some other attributes, that will help to represent a firing
+    weapon in this world:
+     o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
+     o shooting animation
+
+*/
+
+
+#ifndef _TEST_GUN_H
+#define _TEST_GUN_H
+
+#include "weapon.h"
+
+
+//! a weapon can be left or right sided
+/**
+ * @todo this will be reset with mirror X/Y/Z
+ */
+#define    W_LEFT        0
+#define    W_RIGHT       1
+
+
+class FPSSniperRifle : public Weapon
+  {
+  public:
+    FPSSniperRifle (int leftRight);
+    FPSSniperRifle (const TiXmlElement* root);
+    virtual ~FPSSniperRifle ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+
+  private:
+    int leftRight;   // this will become an enum
+
+  };
+#endif /* _TEST_GUN_H */
