Index: code/trunk/src/orxonox/objects/worldentities/Billboard.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 2826)
@@ -34,8 +34,9 @@
 #include "util/Math.h"
 #include "tools/BillboardSet.h"
+#include "objects/Teamcolourable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Billboard : public StaticEntity
+    class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable
     {
         public:
@@ -61,4 +62,7 @@
                 { return this->colour_; }
 
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setColour(colour); }
+
         protected:
             inline BillboardSet& getBillboardSet()
Index: code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2826)
@@ -19,4 +19,8 @@
   Planet.cc
   SpawnPoint.cc
+  TeamSpawnPoint.cc
+  PongCenterpoint.cc
+  PongBall.cc
+  PongBat.cc
 )
 
Index: code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2826)
@@ -44,4 +44,5 @@
         this->bDrag_ = false;
         this->bAllowMouseLook_ = false;
+        this->bAbsolute_ = false;
 
         this->setObjectMode(0x0);
@@ -58,4 +59,5 @@
         XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
         XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/CameraPosition.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2826)
@@ -54,4 +54,9 @@
                 { return this->bAllowMouseLook_; }
 
+            inline void setIsAbsolute(bool bAbsolute)
+                { this->bAbsolute_ = bAbsolute; }
+            inline bool getIsAbsolute() const
+                { return this->bAbsolute_; }
+
             void attachCamera(Camera* camera);
 
@@ -59,4 +64,5 @@
             bool bDrag_;
             bool bAllowMouseLook_;
+            bool bAbsolute_;
     };
 }
Index: code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2826)
@@ -144,8 +144,17 @@
     void ControllableEntity::addCameraPosition(CameraPosition* position)
     {
-        if (position->getAllowMouseLook())
-            position->attachToNode(this->cameraPositionRootNode_);
+        if (!position->getIsAbsolute())
+        {
+            if (position->getAllowMouseLook())
+                position->attachToNode(this->cameraPositionRootNode_);
+            else
+                this->attach(position);
+        }
         else
-            this->attach(position);
+        {
+            WorldEntity* parent = this->getParent();
+            if (parent)
+                parent->attach(position);
+        }
         this->cameraPositions_.push_back(position);
     }
Index: code/trunk/src/orxonox/objects/worldentities/Light.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Light.h	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/Light.h	(revision 2826)
@@ -37,8 +37,9 @@
 
 #include "util/Math.h"
+#include "objects/Teamcolourable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Light : public StaticEntity
+    class _OrxonoxExport Light : public StaticEntity, public Teamcolourable
     {
         public:
@@ -68,4 +69,7 @@
             inline const ColourValue& getSpecularColour() const
                 { return this->specular_; }
+
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setDiffuseColour(colour); this->setSpecularColour(colour); }
 
             /**
Index: code/trunk/src/orxonox/objects/worldentities/PongBall.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBall.cc	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongBall.cc	(revision 2826)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "PongBall.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/worldentities/PongBat.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    CreateFactory(PongBall);
+
+    PongBall::PongBall(BaseObject* creator) : MovableEntity(creator)
+    {
+        RegisterObject(PongBall);
+
+        this->speed_ = 0;
+        this->bat_ = 0;
+    }
+
+    void PongBall::tick(float dt)
+    {
+        SUPER(PongBall, tick, dt);
+
+        if (Core::isMaster())
+        {
+            Vector3 position = this->getPosition();
+            Vector3 velocity = this->getVelocity();
+
+            if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
+            {
+                velocity.z = -velocity.z;
+
+                if (position.z > this->fieldHeight_ / 2)
+                    position.z = this->fieldHeight_ / 2;
+                if (position.z < -this->fieldHeight_ / 2)
+                    position.z = -this->fieldHeight_ / 2;
+            }
+
+            if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
+            {
+                velocity.x = -velocity.x;
+                float distance = 0;
+
+                if (position.x > this->fieldWidth_ / 2)
+                {
+                    position.x = this->fieldWidth_ / 2;
+                    if (this->bat_ && this->bat_[1])
+                    {
+                        distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * this->batlength_ / 2);
+                        if (this->getGametype() && this->bat_[0] && fabs(distance) > 1)
+                        {
+                            this->getGametype()->playerScored(this->bat_[0]->getPlayer());
+                            return;
+                        }
+                    }
+                }
+                if (position.x < -this->fieldWidth_ / 2)
+                {
+                    position.x = -this->fieldWidth_ / 2;
+                    if (this->bat_ && this->bat_[0])
+                    {
+                        distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * this->batlength_ / 2);
+                        if (this->getGametype() && this->bat_[1] && fabs(distance) > 1)
+                        {
+                            this->getGametype()->playerScored(this->bat_[1]->getPlayer());
+                            return;
+                        }
+                    }
+                }
+
+                velocity.z = distance * distance * sgn(distance) * 1.5 * this->speed_;
+            }
+
+            if (velocity != this->getVelocity())
+                this->setVelocity(velocity);
+            if (position != this->getPosition())
+                this->setPosition(position);
+        }
+    }
+
+    void PongBall::setSpeed(float speed)
+    {
+        if (speed != this->speed_)
+        {
+            this->speed_ = speed;
+
+            Vector3 velocity = this->getVelocity();
+            if (velocity.x != 0)
+                velocity.x = sgn(velocity.x) * this->speed_;
+            else
+                velocity.x = this->speed_ * sgn(rnd(-1,1));
+
+            this->setVelocity(velocity);
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/PongBall.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBall.h	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongBall.h	(revision 2826)
@@ -0,0 +1,72 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PongBall_H__
+#define _PongBall_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/MovableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongBall : public MovableEntity
+    {
+        public:
+            PongBall(BaseObject* creator);
+            virtual ~PongBall() {}
+
+            virtual void tick(float dt);
+
+            void setFieldDimension(float width, float height)
+                { this->fieldWidth_ = width; this->fieldHeight_ = height; }
+            void setFieldDimension(const Vector2& dimension)
+                { this->setFieldDimension(dimension.x, dimension.y); }
+
+            void setSpeed(float speed);
+            float getSpeed() const
+                { return this->speed_; }
+
+            void setBatLength(float batlength)
+                { this->batlength_ = batlength; }
+            float getBatLength() const
+                { return this->batlength_; }
+
+            void setBats(PongBat** bats)
+                { this->bat_ = bats; }
+
+        private:
+            float fieldWidth_;
+            float fieldHeight_;
+            float speed_;
+            float batlength_;
+            PongBat** bat_;
+    };
+}
+
+#endif /* _PongBall_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/PongBat.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBat.cc	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongBat.cc	(revision 2826)
@@ -0,0 +1,100 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "PongBat.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(PongBat);
+
+    PongBat::PongBat(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(PongBat);
+
+        this->movement_ = 0;
+        this->bMoveLocal_ = false;
+        this->speed_ = 60;
+        this->length_ = 0.25;
+        this->fieldHeight_ = 100;
+
+        this->registerVariables();
+    }
+
+    void PongBat::registerVariables()
+    {
+        registerVariable(this->speed_);
+        registerVariable(this->speed_);
+        registerVariable(this->speed_);
+    }
+
+    void PongBat::tick(float dt)
+    {
+        if (this->hasLocalController())
+        {
+            this->movement_ = clamp(this->movement_, -1.0f, 1.0f) * this->speed_;
+
+            if (this->bMoveLocal_)
+                this->setVelocity(this->getOrientation() * Vector3(this->movement_, 0, 0));
+            else
+                this->setVelocity(0, 0, this->movement_);
+
+            this->movement_ = 0;
+        }
+
+        SUPER(PongBat, tick, dt);
+
+        if (this->hasLocalController())
+        {
+            Vector3 position = this->getPosition();
+
+            if (position.z > this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2)
+                position.z = this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2;
+            if (position.z < -this->fieldHeight_ / 2 + this->fieldHeight_ * this->length_ / 2)
+                position.z = -this->fieldHeight_ / 2 + this->fieldHeight_ * this->length_ / 2;
+
+            if (position != this->getPosition())
+                this->setPosition(position);
+        }
+    }
+
+    void PongBat::moveFrontBack(const Vector2& value)
+    {
+        this->bMoveLocal_ = false;
+        this->movement_ -= value.x;
+    }
+
+    void PongBat::moveRightLeft(const Vector2& value)
+    {
+        this->bMoveLocal_ = true;
+        this->movement_ = value.x;
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/PongBat.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBat.h	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongBat.h	(revision 2826)
@@ -0,0 +1,74 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PongBat_H__
+#define _PongBat_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongBat : public ControllableEntity
+    {
+        public:
+            PongBat(BaseObject* creator);
+            virtual ~PongBat() {}
+
+            void registerVariables();
+            virtual void tick(float dt);
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+
+            void setSpeed(float speed)
+                { this->speed_ = speed; }
+            float getSpeed() const
+                { return this->speed_; }
+
+            void setFieldHeight(float height)
+                { this->fieldHeight_ = height; }
+            float getFieldHeight() const
+                { return this->fieldHeight_; }
+
+            void setLength(float length)
+                { this->length_ = length; }
+            float getLength() const
+                { return this->length_; }
+
+        private:
+            float movement_;
+            bool bMoveLocal_;
+            float speed_;
+            float length_;
+            float fieldHeight_;
+    };
+}
+
+#endif /* _PongBat_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.cc	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.cc	(revision 2826)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "PongCenterpoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/gametypes/Pong.h"
+
+namespace orxonox
+{
+    CreateFactory(PongCenterpoint);
+
+    PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(PongCenterpoint);
+
+        this->width_ = 200;
+        this->height_ = 120;
+        this->ballspeed_ = 100;
+        this->batspeed_ = 60;
+        this->batlength_ = 0.25;
+
+        this->checkGametype();
+    }
+
+    void PongCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PongCenterpoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PongCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
+    }
+
+    void PongCenterpoint::changedGametype()
+    {
+        SUPER(PongCenterpoint, changedGametype);
+
+        this->checkGametype();
+    }
+
+    void PongCenterpoint::checkGametype()
+    {
+        if (this->getGametype() && this->getGametype()->isA(Class(Pong)))
+        {
+            Pong* pong_gametype = dynamic_cast<Pong*>(this->getGametype());
+            pong_gametype->setCenterpoint(this);
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.h	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/PongCenterpoint.h	(revision 2826)
@@ -0,0 +1,93 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PongCenterpoint_H__
+#define _PongCenterpoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongCenterpoint : public StaticEntity
+    {
+        public:
+            PongCenterpoint(BaseObject* creator);
+            virtual ~PongCenterpoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void changedGametype();
+
+            void setBalltemplate(const std::string& balltemplate)
+                { this->balltemplate_ = balltemplate; }
+            const std::string& getBalltemplate() const
+                { return this->balltemplate_; }
+
+            void setBattemplate(const std::string& battemplate)
+                { this->battemplate_ = battemplate; }
+            const std::string& getBattemplate() const
+                { return this->battemplate_; }
+
+            void setFieldDimension(const Vector2& dimension)
+                { this->width_ = dimension.x; this->height_ = dimension.y; }
+            Vector2 getFieldDimension() const
+                { return Vector2(this->width_, this->height_); }
+
+            void setBallSpeed(float ballspeed)
+                { this->ballspeed_ = ballspeed; }
+            float getBallSpeed() const
+                { return this->ballspeed_; }
+
+            void setBatSpeed(float batspeed)
+                { this->batspeed_ = batspeed; }
+            float getBatSpeed() const
+                { return this->batspeed_; }
+
+            void setBatLength(float batlength)
+                { this->batlength_ = batlength; }
+            float getBatLength() const
+                { return this->batlength_; }
+
+        private:
+            void checkGametype();
+
+            std::string balltemplate_;
+            std::string battemplate_;
+
+            float ballspeed_;
+            float batspeed_;
+            float batlength_;
+
+            float width_;
+            float height_;
+    };
+}
+
+#endif /* _PongCenterpoint_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.cc	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.cc	(revision 2826)
@@ -0,0 +1,52 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "TeamSpawnPoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(TeamSpawnPoint);
+
+    TeamSpawnPoint::TeamSpawnPoint(BaseObject* creator) : SpawnPoint(creator)
+    {
+        RegisterObject(TeamSpawnPoint);
+
+        this->teamNumber_ = 0;
+    }
+
+    void TeamSpawnPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TeamSpawnPoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TeamSpawnPoint, "team", setTeamNumber, getTeamNumber, xmlelement, mode).defaultValues(0);
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.h	(revision 2826)
+++ code/trunk/src/orxonox/objects/worldentities/TeamSpawnPoint.h	(revision 2826)
@@ -0,0 +1,56 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamSpawnPoint_H__
+#define _TeamSpawnPoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "SpawnPoint.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamSpawnPoint : public SpawnPoint
+    {
+        public:
+            TeamSpawnPoint(BaseObject* creator);
+            virtual ~TeamSpawnPoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void setTeamNumber(unsigned int team)
+                { this->teamNumber_ = team; }
+            unsigned int getTeamNumber() const
+                { return this->teamNumber_; }
+
+        private:
+            unsigned int teamNumber_;
+    };
+}
+
+#endif /* _TeamSpawnPoint_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2826)
@@ -133,4 +133,20 @@
     }
 
+    void Pawn::setPlayer(PlayerInfo* player)
+    {
+        ControllableEntity::setPlayer(player);
+
+        if (this->getGametype())
+            this->getGametype()->playerStartsControllingPawn(player, this);
+    }
+
+    void Pawn::removePlayer()
+    {
+        if (this->getGametype())
+            this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
+
+        ControllableEntity::removePlayer();
+    }
+
     void Pawn::setHealth(float health)
     {
@@ -140,16 +156,22 @@
     void Pawn::damage(float damage, Pawn* originator)
     {
-        this->setHealth(this->health_ - damage);
-        this->lastHitOriginator_ = originator;
-
-        // play damage effect
+        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
+        {
+            this->setHealth(this->health_ - damage);
+            this->lastHitOriginator_ = originator;
+
+            // play damage effect
+        }
     }
 
     void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
     {
-        this->damage(damage, originator);
-        this->setVelocity(this->getVelocity() + force);
-
-        // play hit effect
+        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))
+        {
+            this->damage(damage, originator);
+            this->setVelocity(this->getVelocity() + force);
+
+            // play hit effect
+        }
     }
 
@@ -176,17 +198,22 @@
     void Pawn::death()
     {
-        // Set bAlive_ to false and wait for PawnManager to do the destruction
-        this->bAlive_ = false;
-
-        this->setDestroyWhenPlayerLeft(false);
-
-        if (this->getGametype())
-            this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
-
-        if (this->getPlayer())
-            this->getPlayer()->stopControl(this);
-
-        if (Core::isMaster())
-            this->deatheffect();
+        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
+        {
+            // Set bAlive_ to false and wait for PawnManager to do the destruction
+            this->bAlive_ = false;
+
+            this->setDestroyWhenPlayerLeft(false);
+
+            if (this->getGametype())
+                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
+
+            if (this->getPlayer())
+                this->getPlayer()->stopControl(this);
+
+            if (Core::isMaster())
+                this->deatheffect();
+        }
+        else
+            this->setHealth(1);
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2809)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2826)
@@ -47,4 +47,7 @@
             virtual void tick(float dt);
             void registerVariables();
+
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void removePlayer();
 
             inline bool isAlive() const
