Index: code/trunk/cmake/tools/BuildUnits.cmake
===================================================================
--- code/trunk/cmake/tools/BuildUnits.cmake	(revision 9347)
+++ code/trunk/cmake/tools/BuildUnits.cmake	(revision 9348)
Index: code/trunk/data/gui/layouts/GUILayout.xsd
===================================================================
--- code/trunk/data/gui/layouts/GUILayout.xsd	(revision 9347)
+++ code/trunk/data/gui/layouts/GUILayout.xsd	(revision 9348)
@@ -2,61 +2,61 @@
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 
-	<xsd:element name="GUILayout" type="GUILayoutType"/>
-	
-	<xsd:complexType name="GUILayoutType">
-		<xsd:sequence>
-			<xsd:element name="Window" type="WindowType" />
-		</xsd:sequence>
-		<xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
-	</xsd:complexType>
-	
-	<xsd:complexType name="WindowType">
-		<xsd:sequence>
-			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:choice minOccurs="0" maxOccurs="unbounded">
-				<xsd:element name="Window" type="WindowType" />
-				<xsd:element name="AutoWindow" type="AutoWindowType" />
-			</xsd:choice>
-			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:attribute name="Type" type="xsd:string" use="required"/>
-		<xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
-	</xsd:complexType>
+    <xsd:element name="GUILayout" type="GUILayoutType"/>
 
-	<xsd:complexType name="AutoWindowType">
-		<xsd:sequence>
-			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
-			<xsd:choice minOccurs="0" maxOccurs="unbounded">
-				<xsd:element name="Window" type="WindowType" />
-				<xsd:element name="AutoWindow" type="AutoWindowType" />
-			</xsd:choice>
-			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
-	</xsd:complexType>
+    <xsd:complexType name="GUILayoutType">
+        <xsd:sequence>
+            <xsd:element name="Window" type="WindowType" />
+        </xsd:sequence>
+        <xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+    </xsd:complexType>
 
-	<xsd:complexType name="PropertyType">
-		<xsd:simpleContent>
-			<xsd:extension base="xsd:string">
-				<xsd:attribute name="Name" type="xsd:string" use="required"/>
-				<xsd:attribute name="Value" type="xsd:string" use="optional"/>
-			</xsd:extension>
-		</xsd:simpleContent> 
-	</xsd:complexType>
+    <xsd:complexType name="WindowType">
+        <xsd:sequence>
+            <xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Window" type="WindowType" />
+                <xsd:element name="AutoWindow" type="AutoWindowType" />
+            </xsd:choice>
+            <xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+        </xsd:sequence>
+        <xsd:attribute name="Type" type="xsd:string" use="required"/>
+        <xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
 
-	<xsd:complexType name="LayoutImportType">
-		<xsd:attribute name="Filename" type="xsd:string" use="required"/>
-		<xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
-		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
-	</xsd:complexType>
+    <xsd:complexType name="AutoWindowType">
+        <xsd:sequence>
+            <xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Window" type="WindowType" />
+                <xsd:element name="AutoWindow" type="AutoWindowType" />
+            </xsd:choice>
+            <xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+        </xsd:sequence>
+        <xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
+    </xsd:complexType>
 
-	<xsd:complexType name="EventType">
-		<xsd:attribute name="Name" type="xsd:string" use="required"/>
-		<xsd:attribute name="Function" type="xsd:string" use="required"/>
-	</xsd:complexType>
+    <xsd:complexType name="PropertyType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+                <xsd:attribute name="Name" type="xsd:string" use="required"/>
+                <xsd:attribute name="Value" type="xsd:string" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="LayoutImportType">
+        <xsd:attribute name="Filename" type="xsd:string" use="required"/>
+        <xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+    </xsd:complexType>
+
+    <xsd:complexType name="EventType">
+        <xsd:attribute name="Name" type="xsd:string" use="required"/>
+        <xsd:attribute name="Function" type="xsd:string" use="required"/>
+    </xsd:complexType>
 
 </xsd:schema>
Index: code/trunk/data/gui/layouts/InGamePickupHUD.layout
===================================================================
--- code/trunk/data/gui/layouts/InGamePickupHUD.layout	(revision 9347)
+++ code/trunk/data/gui/layouts/InGamePickupHUD.layout	(revision 9348)
@@ -2,52 +2,48 @@
 
 <GUILayout>
-	<Window Type="DefaultWindow" Name="orxonox/InGamePickupHUD_RootWindow" >
-		<Property Name="InheritsAlpha" Value="False" />
-		<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-		<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
-		<Window Type="TaharezLook/StaticImage" Name="orxonox/InGamePickupHUD_Overview" >
-			<Property Name="Font" Value="BlueHighway-12" />
-			<Property Name="Text" Value="Pickup List" />
-			<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-			<Property Name="UnifiedAreaRect" Value="{{0,5},{0.15,0},{0.2,0},{0.45,0}}" />
-			<Property Name="Alpha" Value="0.3" />
-			<!--Event Name="Clicked" Function="InGameMenu.button_return_clicked"/-->
-			<Window Type="TaharezLook/StaticText" Name="orxonox/InGamePickupHUD_PickupTitle" >
-				<Property Name="Alpha" Value="0.8"/>
-				<Property Name="Text" Value="Pickup List" />
-				<Property Name="Font" Value="BlueHighway-10" />
-				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-				<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,-20},{0,20}}" />
-			</Window>
-			<Window Type="TaharezLook/Button" Name="orxonox/InGamePickupHUD_closeButton" >
-			        <Property Name="Alpha" Value="0.8" />
-				<Property Name="Font" Value="BlueHighway-12" />
-				<Property Name="Text" Value="X" />
-				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-				<Property Name="UnifiedAreaRect" Value="{{1,-20},{0,0},{1,0},{0,20}}" />
-				<!-- alle Grössen / anordnungen angepasst - da überschneidungen von absoluten
-				und relativen Positionsangaben (problematisch bei kleinen auflösungen) -->
-				<Event Name="Clicked" Function="InGamePickupHUD.close_button_clicked"/>
-			</Window>
-			<Window Type="TaharezLook/Listbox" Name="orxonox/InGamePickupHUD_PickupListBox">
-			        <Property Name="Alpha" Value="0.8" />
-				<Property Name="Font" Value="BlueHighway-12" />
-				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-				<Property Name="UnifiedAreaRect" Value="{{0,5},{0,25},{1,-5},{1,-5}}" />	
-				<!--
-				<Window Type="TaharezLook/ListboxItem" Name="orxonox/InGamePickupHUD_TestPickupOne">
-					<Property Name="Alpha" Value="0.8" />
-					<Property Name="Font" Value="BlueHighway-12" />
-					<Property Name="Text" Value="First Pickup" />
-					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-					<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,30},{1,0}}" />	
-				</Window>
-				-->
-			</Window>
-			
-		</Window>
-		
-	
-	</Window>
-	
+    <Window Type="DefaultWindow" Name="orxonox/InGamePickupHUD_RootWindow" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/StaticImage" Name="orxonox/InGamePickupHUD_Overview" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Text" Value="Pickup List" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,5},{0.15,0},{0.2,0},{0.45,0}}" />
+            <Property Name="Alpha" Value="0.3" />
+            <!--Event Name="Clicked" Function="InGameMenu.button_return_clicked"/-->
+            <Window Type="TaharezLook/StaticText" Name="orxonox/InGamePickupHUD_PickupTitle" >
+                <Property Name="Alpha" Value="0.8"/>
+                <Property Name="Text" Value="Pickup List" />
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,-20},{0,20}}" />
+            </Window>
+            <Window Type="TaharezLook/Button" Name="orxonox/InGamePickupHUD_closeButton" >
+                <Property Name="Alpha" Value="0.8" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="X" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{1,-20},{0,0},{1,0},{0,20}}" />
+                <!-- alle Grössen / anordnungen angepasst - da überschneidungen von absoluten
+                und relativen Positionsangaben (problematisch bei kleinen auflösungen) -->
+                <Event Name="Clicked" Function="InGamePickupHUD.close_button_clicked"/>
+            </Window>
+            <Window Type="TaharezLook/Listbox" Name="orxonox/InGamePickupHUD_PickupListBox">
+                <Property Name="Alpha" Value="0.8" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,5},{0,25},{1,-5},{1,-5}}" />
+                <!--
+                <Window Type="TaharezLook/ListboxItem" Name="orxonox/InGamePickupHUD_TestPickupOne">
+                    <Property Name="Alpha" Value="0.8" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="First Pickup" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,30},{1,0}}" />
+                </Window>
+                -->
+            </Window>
+        </Window>
+    </Window>
 </GUILayout>
Index: code/trunk/data/gui/layouts/ShipSelectionMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/ShipSelectionMenu.layout	(revision 9348)
+++ code/trunk/data/gui/layouts/ShipSelectionMenu.layout	(revision 9348)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+
+    <Window Type="MenuWidgets/StaticImage" Name="orxonox/ShipSelectionBackground" >
+        <Property Name="FrameEnabled" Value="False" />
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Property Name="BackgroundEnabled" Value="False" />
+        <!-- -->
+        <Window Type="MenuWidgets/StaticText" Name="orxonox/ShipSelectionWindow" >
+            <Property Name="Text" Value="ShipSelection" />
+            <Property Name="Alpha" Value="0.8" />
+            <Property Name="InheritsAlpha" Value="False" />
+            <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="VertFormatting" Value="TopAligned" />
+            <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.15,0},{0.8,0},{0.7,0}}" />
+            <Window Type="MenuWidgets/TabControl" Name="orxonox/ShipSelectionTabControl" >
+                <Property Name="TabHeight" Value="{0,26.4388}" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TabPanePosition" Value="Top" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" />
+
+            </Window>
+
+            <!-- TODO: Ship Description and Image
+            <Window Type="MenuWidgets/StaticImage" Name="orxonox/ShipSelectionShipImage" >
+                <Property Name="AlwaysOnTop" Value="True" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0.675,0}}" />
+            </Window>
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/ShipSelectionLevelDescription" >
+                <Property Name="AlwaysOnTop" Value="True" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="VertScrollbar" Value="True" />
+                <Property Name="HorzScrollbar" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" />
+            </Window>-->
+
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionStartButton" >
+            <Property Name="Text" Value="Start" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionStartButton_clicked"/>
+        </Window>
+        <!-- TODO: set ship properties
+        <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionConfigButton" >
+            <Property Name="Text" Value="Configure" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.725,0},{0.575,0},{0.775,0}}" />
+            <Property Name="Disabled" Value="True" />
+            <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionConfigButton_clicked"/>
+        </Window> -->
+        <Window Type="MenuWidgets/Button" Name="orxonox/ShipSelectionBackButton" >
+            <Property Name="Text" Value="Back" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" />
+            <Event Name="Clicked" Function="ShipSelectionMenu.ShipSelectionBackButton_clicked"/>
+        </Window>
+    </Window>
+</GUILayout>
Index: code/trunk/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/AudioMenu.lua	(revision 9347)
+++ code/trunk/data/gui/scripts/AudioMenu.lua	(revision 9348)
@@ -34,4 +34,5 @@
     table.insert(themeList, "8-Bit Style")
     table.insert(themeList, "Corny Jazz")
+    table.insert(themeList, "Metal")
     for k,v in pairs(themeList) do
         item = CEGUI.createListboxTextItem(v)
@@ -45,4 +46,6 @@
     elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
         listboxwindow:setItemSelectState(3,true)
+    elseif orxonox.getConfig("MoodManager", "mood_") == "metal" then
+        listboxwindow:setItemSelectState(4,true)
     else
         listboxwindow:setItemSelectState(0,true)
@@ -178,4 +181,6 @@
     elseif listboxwindow:isItemSelected(3) then
         orxonox.config("MoodManager", "mood_", "jazzy")
+    elseif listboxwindow:isItemSelected(4) then
+        orxonox.config("MoodManager", "mood_", "metal")
     else
         orxonox.config("MoodManager", "mood_", "default")
Index: code/trunk/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/trunk/data/gui/scripts/PickupInventory.lua	(revision 9347)
+++ code/trunk/data/gui/scripts/PickupInventory.lua	(revision 9348)
@@ -108,5 +108,5 @@
 
 function P.createPickupEntry(index, pickup)
-    local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup)
+    local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName)
 
     local name = "orxonox/PickupInventory/Box/Pickup" .. index
@@ -176,5 +176,5 @@
     for k,v in pairs(P.detailsWindows) do
         if v ~= nil then
-            winMgr:destroyWindow(v)
+            P.destroyDetailWindow(k)
         end
     end
@@ -193,5 +193,5 @@
 function P.createDetailsWindow(pickupIndex)
     local pickup = P.pickupsList[pickupIndex]
-    local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup)
+    local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName)
 
     local index = P.getNewDetailNumber()
@@ -323,4 +323,8 @@
     local detailNr = tonumber(match())
     
+    P.destroyDetailWindow(detailNr)
+end
+
+function P.destroyDetailWindow(detailNr)
     local window = P.detailsWindows[detailNr]
     winMgr:destroyWindow(window)
Index: code/trunk/data/gui/scripts/ShipSelectionMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/ShipSelectionMenu.lua	(revision 9348)
+++ code/trunk/data/gui/scripts/ShipSelectionMenu.lua	(revision 9348)
@@ -0,0 +1,132 @@
+-- ShipSelectionMenu.lua
+
+local P = createMenuSheet("ShipSelectionMenu")
+P.activeTabIndexes = {}
+P.scrollbarWidth = 13
+P.shipList = {}
+function P.onLoad()
+    orxonox.execute("set shipmodelsfile [open {../levels/templates/.shipmodels} w+]")
+    orxonox.execute("foreach line [glob -directory ../levels/templates/ spaceship*] { regexp {.*/(.*)\\..*} $line matchall match1; puts $shipmodelsfile $match1 }")
+    orxonox.execute("close $shipmodelsfile")
+    P.createFilterTab("All Ships")
+end
+
+function P.createShipList() --generates list with tagged shipmodels
+    P.shipList = {}
+    file = io.open("../levels/templates/.shipmodels")
+    if file ~= nil then
+        for line in file:lines() do  --checks if shipmodel is included in level file
+            if selectedlevel:hasStartingShip(string.lower(line)) then
+                P.shipList[#P.shipList+1] = string.lower(line)
+            end
+        end
+        --file.close() -- TODO: investigate why close() seems to crash?
+    end
+end
+
+function P.update() --updates listbox with found models
+    P.createShipList()
+    listbox:resetList()
+    --orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
+    local tabIndexes = {}
+    for k,v in pairs(P.shipList) do
+        --TODO: only add ship if is in the right filter tab
+        --if tag == nil or v:hasStartingShip(tag) then
+            local item = CEGUI.createListboxTextItem(v)
+            item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+            listbox:addItem(item)
+            table.insert(tabIndexes, k)
+            --orxonox.GUIManager:setTooltipTextHelper(item, v:getDescription())
+        --end
+    end
+    table.insert(P.activeTabIndexes, tabIndexes)
+end
+
+function P.createFilterTab(name) -- generates filter tab and list box, sets handler for selection changes
+    tabName = "orxonox/ShipSelectionLevelTab"
+    -- create new tab window with desired name
+    listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
+    listbox:setText(name)
+    listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
+    --[[TODO: smaller list if image and description is implemented.
+    listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") --]]
+    listbox:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
+    -- fill listbox with items
+    P.update()
+    -- listen to selection changes
+    orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".ShipSelectionSelectionChanged")
+    local tabControl = winMgr:getWindow("orxonox/ShipSelectionTabControl")
+    orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".ShipSelectionSelectionChanged")
+    if listbox:getItemCount() > 0 then
+        tabControl:addChildWindow(tabName)
+    end
+end
+
+function P.ShipSelectionGetSelectedModel() --returns selected model, if available.
+    -- choose the active listbox
+    local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/ShipSelectionTabControl"))
+    local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
+    local choice = listbox:getFirstSelectedItem()
+    if choice ~= nil then
+        -- get the right tab and the right index
+        local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
+        local index = tabIndexes[listbox:getItemIndex(choice)+1]
+        return P.shipList[index]
+    else
+        return nil
+    end
+end
+
+function P.ShipSelectionSelectionChanged(e)
+    --[[ TODO: Get image and description from template file
+    local levelImage = winMgr:getWindow("orxonox/ShipSelectionLevelImage")
+    local levelDescription = winMgr:getWindow("orxonox/ShipSelectionLevelDescription")
+    local configButton = winMgr:getWindow("orxonox/ShipSelectionConfigButton")
+    local level = P.ShipSelectionGetSelectedModel()
+    if level ~= nil then
+        --local levelXMLFilename = selectedlevel:getXMLFilename()
+        --local imageName = selectedlevel:getScreenshot()
+        -- set the screenshot and the description for the selected level
+        --levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
+        --levelDescription:setText(level:getDescription())
+        -- only enable config button for "gametype" levels
+        --if level:hasTag("gametype") then
+         --   configButton:setProperty("Disabled", "False")
+        --else
+        --    configButton:setProperty("Disabled", "True")
+        --end
+    else
+        -- also take care of "no level selected"
+        levelImage:setProperty("Image", nil)
+        levelDescription:setText("")
+    end
+   --]]
+end
+
+function P.ShipSelectionStartButton_clicked(e)
+
+    if (selectedlevel ~= nil and P.ShipSelectionGetSelectedModel() ~= nil)  then
+    selectedlevel:selectStartingShip(P.ShipSelectionGetSelectedModel())
+        orxonox.execute("startGame " .. "_temp.oxw")
+        hideAllMenuSheets()
+    else
+    orxonox.execute("orxout user_warning no ship model selected or no tagged shipmodel installed")
+    end
+end
+
+--[[ TODO: function P.ShipSelectionConfigButton_clicked(e)
+
+    local level = P.ShipSelectionGetSelectedModel()
+    if level ~= nil then
+        local configMenu = showMenuSheet("ShipSelectionConfigMenu")
+        configMenu:loadConfig(level)
+    end
+end
+--]]
+
+
+function P.ShipSelectionBackButton_clicked(e)
+    orxonox.execute("keyESC")
+end
+
+return P
Index: code/trunk/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 9347)
+++ code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 9348)
@@ -2,12 +2,13 @@
 
 local P = createMenuSheet("SingleplayerMenu")
-
+P.loadAlong = {"ShipSelectionMenu"}
 P.levelList = {}
 P.activeTabIndexes = {}
 P.scrollbarWidth = 13
+selectedlevel = {} -- level for ship selection
 
 function P.onLoad()
     P.createLevelList()
-    
+
     -- create tabs with desired tab as argument (nil for all)
     P.createFilterTab("Gametypes", "gametype")
@@ -18,8 +19,8 @@
     P.createFilterTab("Tests", "test")
     P.createFilterTab("Show All", nil)
-    
+
     -- update description and screenshot boxes
     P.SingleplayerSelectionChanged()
-    
+
     --buttons are arranged in a 1x3 matrix
     P:setButton(1, 1, {
@@ -46,5 +47,5 @@
     while index < size do
         level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
-        if level ~= nil then
+        if (level ~= nil and level:getXMLFilename() ~= "_temp.oxw") then
             local levelXMLFilename = level:getXMLFilename()
             -- create an imageset for each screenshot
@@ -141,8 +142,13 @@
 
 function P.SingleplayerStartButton_clicked(e)
-    local level = P.SingleplayerGetSelectedLevel()
-    if level ~= nil then
-        orxonox.execute("startGame " .. level:getXMLFilename())
-        hideAllMenuSheets()
+    selectedlevel = P.SingleplayerGetSelectedLevel()
+    if selectedlevel ~= nil then
+        if selectedlevel:hasTag("shipselection") then
+            local shipSelectionMenu = showMenuSheet("ShipSelectionMenu", true)
+            shipSelectionMenu:update()
+        else
+            orxonox.execute("startGame " .. selectedlevel:getXMLFilename())
+            hideAllMenuSheets()
+        end
     end
 end
Index: code/trunk/data/levels/FPSTest.oxw
===================================================================
--- code/trunk/data/levels/FPSTest.oxw	(revision 9347)
+++ code/trunk/data/levels/FPSTest.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.1, 0.1, 0.1"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
    gravity      = "0,-1000,0"
    negativeWorldRange = "-100000, -100000, -100000"
Index: code/trunk/data/levels/Spacerace2.oxw
===================================================================
--- code/trunk/data/levels/Spacerace2.oxw	(revision 9347)
+++ code/trunk/data/levels/Spacerace2.oxw	(revision 9348)
@@ -12,5 +12,5 @@
 
   include("templates/spaceshipAssff.oxt")
- 
+
 ?>
 
@@ -37,59 +37,59 @@
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
 
-	
-	<SpaceRaceManager>
-<checkpoints>	
-	<RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="1,2,-1">
-        <attached>
-            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
-        </attached>
-        <collisionShapes>
-            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
-            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
-        </collisionShapes>
-    </RaceCheckPoint>
-
-<RaceCheckPoint name="checkpoint2" position="0,2100,2300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
-        <attached>
-            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
-        </attached>
-        <collisionShapes>
-            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
-            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
-        </collisionShapes>
-    </RaceCheckPoint>
-
-<RaceCheckPoint name="checkpoint3" position="0,700,2700" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
-        <attached>
-            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
-        </attached>
-        <collisionShapes>
-            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
-            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
-        </collisionShapes>
-    </RaceCheckPoint>
-
-<RaceCheckPoint name="checkpoint4" position="0,-400,300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="true">
-        <attached>
-            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
-        </attached>
-        <collisionShapes>
-            <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
-            <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
-            <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
-        </collisionShapes>
-    </RaceCheckPoint>
-</checkpoints>
-</SpaceRaceManager>
-
- 
-<SpaceShip position="0,0,200" lookat="0,0,0">
+
+    <SpaceRaceManager>
+        <checkpoints>
+            <RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="1,2,-1">
+                <attached>
+                    <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+                </attached>
+                <collisionShapes>
+                    <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+                    <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+                </collisionShapes>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint2" position="0,2100,2300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
+                <attached>
+                    <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+                </attached>
+                <collisionShapes>
+                    <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+                    <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+                </collisionShapes>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint3" position="0,700,2700" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+                <attached>
+                    <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+                </attached>
+                <collisionShapes>
+                    <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+                    <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+                </collisionShapes>
+            </RaceCheckPoint>
+
+            <RaceCheckPoint name="checkpoint4" position="0,-400,300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="true">
+                <attached>
+                    <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+                </attached>
+                <collisionShapes>
+                    <BoxCollisionShape position="0,0,55"      halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="0,0,-55"     halfExtents="55, 10, 10" />
+                    <BoxCollisionShape position="55,0,0"      halfExtents="10, 10, 55" />
+                    <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
+                </collisionShapes>
+            </RaceCheckPoint>
+        </checkpoints>
+    </SpaceRaceManager>
+
+
+    <SpaceShip position="0,0,200" lookat="0,0,0">
       <templates>
         <Template link=spaceshipassff />
@@ -202,5 +202,5 @@
 
 
-    
+
   </Scene>
 </Level>
Index: code/trunk/data/levels/SurfaceRacePresentation.oxw
===================================================================
--- code/trunk/data/levels/SurfaceRacePresentation.oxw	(revision 9348)
+++ code/trunk/data/levels/SurfaceRacePresentation.oxw	(revision 9348)
@@ -0,0 +1,376 @@
+<LevelInfo
+ name = "Surface Race Presentation"
+ description = "just awesome 2.0"
+ screenshot = "surfaceRace.png"
+ tags = "gametype, shipselection"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser, spaceshiprace"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/spaceshipRace.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipGhost.oxt")
+  include("templates/spaceshipSpacecruiser.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+<Level
+gametype = SpaceRace
+>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "2.0, 2.0, 2.0"
+    skybox       = "Orxonox/skyBoxClouds"
+    gravity      = "0,-75,0"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+    hasPhysics   = true
+  >
+
+    <Template name=PortalDefault>
+        <PortalEndPoint>
+            <attached>
+                <Model mesh="Spacegate.mesh" scale="3"/>
+            </attached>
+        </PortalEndPoint>
+    </Template>
+
+    <PortalEndPoint position="6000,8050,2500" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+    <PortalEndPoint position="6100,8050,-4500" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+    <PortalLink fromID="1" toID="2" />
+    <PortalLink fromID="2" toID="1" />
+
+  <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile01.mesh" shadow=true />
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile02.mesh" shadow=true />
+    <Model position="4200,8050,-1000" scale=10 mesh="debris-pile03.mesh" shadow=true />
+
+    <MovableEntity position="-700,8090,-300" velocity="80,0,0" rotationaxis="1,0,1" rotationrate=200>
+      <attached>
+        <Model position="0,0,-20" scale=10 mesh="cokebottle.mesh" />
+      </attached>
+    </MovableEntity>
+
+
+<SpaceRaceManager>
+ <checkpoints>
+    <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+    <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+           <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+         <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+
+    <RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+        </collisionShapes>
+    </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=shipselection />
+
+
+    <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90"  scale="4" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+    <!--
+                <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+        <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+    -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,320,2400"            halfExtents="360,72,2400" />
+        <BoxCollisionShape position="0,-320,2400"      halfExtents="360,72,2400" />
+        <BoxCollisionShape position="320,0,2400"            halfExtents="72,360,2400" />
+        <BoxCollisionShape position="-320,0,2400"     halfExtents="72,360,2400" />
+
+
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+
+
+
+    <!-- ------------------Boden----------------- -->
+  <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+     <attached>
+        <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+      </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+   <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60"  maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+    max = 15
+    for i = 0, max, 1
+    do
+    x=-12000
+    y=10000
+    z=-12000
+
+    ?>
+    <?lua
+    for k = 1, 15, 1
+    do
+    j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+      collisionType = "dynamic"
+      linearDamping = "0.5"
+      angularDamping = "0.5"
+      collisiondamage = "100"
+      enablecollisiondamage = "true"
+      scale="<?lua print(j * 5) ?>" >
+      <attached>
+        <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+      <?lua if k == 0 then ?><attached><!-- ---------asteroid fog----- -->
+            <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+          </attached> <?lua end ?>
+        </Model>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+    <?lua
+    end
+    ?>
+    <?lua end ?>
+
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/asteroidField.oxw
===================================================================
--- code/trunk/data/levels/asteroidField.oxw	(revision 9347)
+++ code/trunk/data/levels/asteroidField.oxw	(revision 9348)
@@ -39,9 +39,9 @@
 
     <!-- Belt that's far away  *** TURNED OFF FOR PERFORMANCE REASONS *** -->
-    <!-- Generate asteroid field and asteroid belt -->    
+    <!-- Generate asteroid field and asteroid belt -->
     <!--
     <?lua
-    	dofile("includes/asteroidField.lua")
-    	asteroidBelt(0, 0, 0, -48, -34, 70, 100, 200, 219900, 210000, 900, 1)
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(0, 0, 0, -48, -34, 70, 100, 200, 219900, 210000, 900, 1)
     ?>
     -->
@@ -50,14 +50,14 @@
     <!-- triple large belt around the planet  -->
     <?lua
-    	dofile("includes/asteroidField.lua")
-    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
     ?>
     <?lua
-    	dofile("includes/asteroidField.lua")
-    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
     ?>
     <?lua
-    	dofile("includes/asteroidField.lua")
-    	asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
     ?>
 
@@ -95,5 +95,5 @@
 
 
-    
+
   </Scene>
 </Level>
Index: code/trunk/data/levels/asteroids.oxw
===================================================================
--- code/trunk/data/levels/asteroids.oxw	(revision 9347)
+++ code/trunk/data/levels/asteroids.oxw	(revision 9348)
@@ -149,8 +149,8 @@
 
 
-    <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=30 />
-
-
-    <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=17>
+    <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=24 />
+
+
+    <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=20>
       <events>
         <activity>
@@ -203,5 +203,5 @@
 
 
-    <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=16>
+    <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
       <events>
         <activity>
@@ -254,5 +254,5 @@
 
 
-    <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=17>
+    <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
       <events>
         <activity>
@@ -305,5 +305,5 @@
 
 
-    <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=16>
+    <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
       <events>
         <activity>
@@ -356,5 +356,5 @@
 
 
-    <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=22>
+    <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=15>
       <events>
         <activity>
Index: code/trunk/data/levels/docking.oxw
===================================================================
--- code/trunk/data/levels/docking.oxw	(revision 9347)
+++ code/trunk/data/levels/docking.oxw	(revision 9348)
@@ -21,5 +21,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
 
Index: code/trunk/data/levels/dynamicMatch.oxw
===================================================================
--- code/trunk/data/levels/dynamicMatch.oxw	(revision 9347)
+++ code/trunk/data/levels/dynamicMatch.oxw	(revision 9348)
@@ -10,4 +10,6 @@
   include("stats.oxo")
   include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipSwallow.oxt")
+  include("templates/spaceshipPirate.oxt")
   include("templates/spaceshipGhost.oxt")
   include("dynamicMatchHUD.oxo")
@@ -39,17 +41,17 @@
 <!-- -----------12-Spawnpoints around the planet------------- -->
 <!-- inner Spawnpoints -->
-<TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,-1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,-1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+<TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,-1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,-1000" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
 <!--outer Spawnpoints -->
-<TeamSpawnPoint team=0 position="2000,0,0" lookat="0,0,1" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="-2000,0,0" lookat="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,2000,0" lookat="0,1,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,-2000,0" lookat="0,-1,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,2000" lookat="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-<TeamSpawnPoint team=0 position="0,0,-2000" lookat="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+<TeamSpawnPoint team=0 position="2000,0,0" lookat="0,0,1" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="-2000,0,0" lookat="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,2000,0" lookat="0,1,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,-2000,0" lookat="0,-1,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,2000" lookat="1,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+<TeamSpawnPoint team=0 position="0,0,-2000" lookat="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
 
 <?lua
@@ -64,7 +66,7 @@
                 createSpaceStationPar(0,2,1,2,1,4,1,50)
               ?>
-                <TeamSpawnPoint team=2 position="20,20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-                <TeamSpawnPoint team=2 position="-20,-20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
-                <TeamSpawnPoint team=2 position="-10,10,20" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
+                <TeamSpawnPoint team=2 position="20,20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+                <TeamSpawnPoint team=2 position="-20,-20,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
+                <TeamSpawnPoint team=2 position="-10,10,20" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate/>
             </attached>
           </StaticEntity>
@@ -90,8 +92,8 @@
       <attached>
         <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
-	  <attached><!-- ---------asteroid fog----- -->
+          <attached><!-- ---------asteroid fog----- -->
             <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
           </attached>
-	</Model>
+        </Model>
       </attached>
       <?lua if i == 5 then ?><collisionShapes>
Index: code/trunk/data/levels/events.oxw
===================================================================
--- code/trunk/data/levels/events.oxw	(revision 9347)
+++ code/trunk/data/levels/events.oxw	(revision 9348)
@@ -22,5 +22,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/fightInOurBack.oxw
===================================================================
--- code/trunk/data/levels/fightInOurBack.oxw	(revision 9347)
+++ code/trunk/data/levels/fightInOurBack.oxw	(revision 9348)
@@ -121,5 +121,5 @@
     <Scene
      ambientlight="0.8,0.8,0.8"
-     skybox="Orxonox/skypanoramagen1"
+     skybox="Orxonox/skyBoxBasic"
     >
 
Index: code/trunk/data/levels/includes/CuboidSpaceStation.lua
===================================================================
--- code/trunk/data/levels/includes/CuboidSpaceStation.lua	(revision 9347)
+++ code/trunk/data/levels/includes/CuboidSpaceStation.lua	(revision 9348)
@@ -1,18 +1,18 @@
 ----------------------------------------------------------------------------------------------------
 -- This lua script creates a totally random generated space station for the orxonox computer game!--
--- (c) Wallah 2008, published under GPL licence!												  --
+-- (c) Wallah 2008, published under GPL licence!                                                  --
 ----------------------------------------------------------------------------------------------------
 
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- IMPORTANT: If you need more parameters, do the following: copy the actual function (just the headline and the end statement) to the end of the file,			  --
+-- IMPORTANT: If you need more parameters, do the following: copy the actual function (just the headline and the end statement) to the end of the file,           --
 -- like I did with createSpaceStation() and let that function call the new function where you can modify the parameters. For all parameters which the old function--
 -- doesn't have you just give the standard default values, which I have defined. This is to make sure, that anyone else who uses the old function can still use it--
--- the same way he/she always did. If you want a function with less parameters, just create a new one at the end of the file and call this function with some	  --
--- default values. REMEMBER: Function overloading is not possible, be sure to call your function differently from others already existing ones.					  --
+-- the same way he/she always did. If you want a function with less parameters, just create a new one at the end of the file and call this function with some     --
+-- default values. REMEMBER: Function overloading is not possible, be sure to call your function differently from others already existing ones.                   --
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 -- This function creates a randomly generated space station.
 -- The first argument ranSeed, must be 0, or a positive Integer, if it is 0 your space station is always chosen randomly, if you give an integer,
---	your space station will be generated randomly, but once you have the space station it will always be the same.
+--  your space station will be generated randomly, but once you have the space station it will always be the same.
 -- The argument xLength defines how large the space station will be into the x-direction.
 -- The argument xVar defines how much the space station will vary at the ends in x-direction, this is so that the station is no cube.
@@ -37,7 +37,7 @@
 -- Create a randomseed, so that the math.random() function is actually random.
 if ranSeed == 0 then
-	math.randomseed(os.time())
+    math.randomseed(os.time())
 else
-	math.randomseed(ranSeed)
+    math.randomseed(ranSeed)
 end
 -- End create randomseed.
@@ -52,9 +52,9 @@
 sSSize=30
 if xLength>=yLength and xLength>=zLength then
-	sSSize=xLength+20
+    sSSize=xLength+20
 elseif yLength>=xLength and yLength>=zLength then
-	sSSize=yLength+20
+    sSSize=yLength+20
 elseif zLength>=xLength and zLength>=yLength then
-	sSSize=zLength+20
+    sSSize=zLength+20
 end
 -- Define how many parts the space station has, this value has to be exact, so be sure to increment it if you're adding a new part.
@@ -78,5 +78,5 @@
 pDim=6
 -- Define the griddimension, be sure this value matches the size of a single space station part plus the size of a connection part, which means your parts must be:
---	integer*(gridDim-connectionSize), then integer tells you how many griddimensions your part is.
+--  integer*(gridDim-connectionSize), then integer tells you how many griddimensions your part is.
 gridDim=2.25
 -- End define global parameters.
@@ -89,24 +89,24 @@
 -- The parameters x,y,z are the axis of the space station, which iterate to sSSize, the maximal size of the space station.
 -- The griddimension, this word I will use later, means that the distance of a point to the next point is gridDim in the game, so the absolute x-axis is x*gridDim*sSScale,
---	and so on for the other dimensions y and z.
+--  and so on for the other dimensions y and z.
 -- grid[x][y][z][0] contains 0 if there is no part at the position (x,y,z), otherwise 1.
 -- grid[x][y][z][1] contains 0 if there is no connection from (x,y,z) in x-direction, "+" if there is one in the positive x-direction,
---	"-" if there is one in the negative x-direction, "+-" if there are in both x-directions.
+--  "-" if there is one in the negative x-direction, "+-" if there are in both x-directions.
 -- grid[x][y][z][2] contains 0 if there is no connection from (x,y,z) in y-direction, "+" if there is one in the positive y-direction,
---	"-" if there is one in the negative y-direction, "+-" if there are in both y-directions.
+--  "-" if there is one in the negative y-direction, "+-" if there are in both y-directions.
 -- grid[x][y][z][3] contains 0 if there is no connection from (x,y,z) in z-direction, "+" if there is one in the positive z-direction,
---	"-" if there is one in the negative z-direction, "+-" if there are in both z-directions.
+--  "-" if there is one in the negative z-direction, "+-" if there are in both z-directions.
 grid = {}
 for x=-math.floor(sSSize/2),math.floor(sSSize/2) do
-	grid[x] = {}
-	for y=-math.floor(sSSize/2),math.floor(sSSize/2) do
-		grid[x][y]= {}
-		for z=-math.floor(sSSize/2),math.floor(sSSize/2) do
-			grid[x][y][z]={}
-			for i=0,3 do
-				grid[x][y][z][i]=0
-			end
-		end
-	end
+    grid[x] = {}
+    for y=-math.floor(sSSize/2),math.floor(sSSize/2) do
+        grid[x][y]= {}
+        for z=-math.floor(sSSize/2),math.floor(sSSize/2) do
+            grid[x][y][z]={}
+            for i=0,3 do
+                grid[x][y][z][i]=0
+            end
+        end
+    end
 end
 -- End create 4-dim grid.
@@ -119,37 +119,37 @@
 -- The first parameter i, tells us how many parts fit into the array, so it iterates from 1 to sSParts, each part has his own value i.
 -- The second, third and fourth parameters are the relative coordinates of the part, you have to start at (0,0,0) and be sure you fill the array into the right direction.
---	A short example: your part is 2 griddimensions long and you place it in the game, that the relative coordinate point is at (0,0,0) and the part lies in the positive
---	z-axis, then you have to use the coordinate point (0,0,1).
+--  A short example: your part is 2 griddimensions long and you place it in the game, that the relative coordinate point is at (0,0,0) and the part lies in the positive
+--  z-axis, then you have to use the coordinate point (0,0,1).
 -- The fifth parameter is an array with size 4, at index=0, you have to set 1 if your part covers the gridpoint at (x,y,z), otherwise 0.
---	At index=1,2,3 you define the possible connection directions (1 for x, 2 for y and 3 for z), be sure to use the notation from above (0, "+-", "+", "-").
+--  At index=1,2,3 you define the possible connection directions (1 for x, 2 for y and 3 for z), be sure to use the notation from above (0, "+-", "+", "-").
 bodyParts={}
 for i=1,sSParts do
-	bodyParts[i]={}
-	for x=-math.floor(pDim/2),math.floor(pDim/2) do
-		bodyParts[i][x]={}
-		for y=-math.floor(pDim/2),math.floor(pDim/2) do
-			bodyParts[i][x][y]={}
-			for z=-math.floor(pDim/2),math.floor(pDim/2) do
-				bodyParts[i][x][y][z]={}
-				for k=0,3 do
-					bodyParts[i][x][y][z][k]=0
-				end
-			end
-		end
-	end
-	-- This contains the name of the mesh file.
-	bodyParts[i][0][0][0][4]=""
-	-- This contains the first possible rotation of your part, pitch=... yaw=... roll=... .
-	bodyParts[i][0][0][0][5]=""
-	-- This contains the second possible rotation of your part, pitch=... yaw=... roll=... .
-	bodyParts[i][0][0][0][6]=""
-	-- This contains the third possible rotation of your part, pitch=... yaw=... roll=... .
-	bodyParts[i][0][0][0][7]=""
-	-- Contains the movement rotation, rotationaxis=... rotationrate=... .
-	bodyParts[i][0][0][0][8]=""
-	-- Contains the attachment, if your part has an attachment, e.g. <ParticleEmitter .../>.
-	bodyParts[i][0][0][0][9]=""
-	-- Contains how many of this part you want to attach to your space station.
-	bodyParts[i][0][0][0][10]=1
+    bodyParts[i]={}
+    for x=-math.floor(pDim/2),math.floor(pDim/2) do
+        bodyParts[i][x]={}
+        for y=-math.floor(pDim/2),math.floor(pDim/2) do
+            bodyParts[i][x][y]={}
+            for z=-math.floor(pDim/2),math.floor(pDim/2) do
+                bodyParts[i][x][y][z]={}
+                for k=0,3 do
+                    bodyParts[i][x][y][z][k]=0
+                end
+            end
+        end
+    end
+    -- This contains the name of the mesh file.
+    bodyParts[i][0][0][0][4]=""
+    -- This contains the first possible rotation of your part, pitch=... yaw=... roll=... .
+    bodyParts[i][0][0][0][5]=""
+    -- This contains the second possible rotation of your part, pitch=... yaw=... roll=... .
+    bodyParts[i][0][0][0][6]=""
+    -- This contains the third possible rotation of your part, pitch=... yaw=... roll=... .
+    bodyParts[i][0][0][0][7]=""
+    -- Contains the movement rotation, rotationaxis=... rotationrate=... .
+    bodyParts[i][0][0][0][8]=""
+    -- Contains the attachment, if your part has an attachment, e.g. <ParticleEmitter .../>.
+    bodyParts[i][0][0][0][9]=""
+    -- Contains how many of this part you want to attach to your space station.
+    bodyParts[i][0][0][0][10]=1
 end
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -193,5 +193,5 @@
 
 -- Insert the CuboidConnectionBody, it is three griddimensions long and one wide and high and can have only connections at griddimension 1
---	(except the side in direction of griddimension 2) and griddimension 3 (except the side in direction of griddimension 2).
+--  (except the side in direction of griddimension 2) and griddimension 3 (except the side in direction of griddimension 2).
 bodyParts[3][0][0][0][4]="CuboidConnBody.mesh"
 bodyParts[3][0][0][0][5]="pitch=-90"
@@ -373,15 +373,15 @@
 --This function actualizes the grid, which I have to call always after I have added a new part to the space station.
 function actualizeGrid(Index,x,y,z)
-	for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-		for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-			for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-				if bodyParts[Index][i][j][k][0] == 1 then
-					for l=0,3 do
-						grid[x+i][y+j][z+k][l] = bodyParts[Index][i][j][k][l]
-					end
-				end
-			end
-		end
-	end
+    for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+        for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+            for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+                if bodyParts[Index][i][j][k][0] == 1 then
+                    for l=0,3 do
+                        grid[x+i][y+j][z+k][l] = bodyParts[Index][i][j][k][l]
+                    end
+                end
+            end
+        end
+    end
 end
 -- End actualizeGrid.
@@ -390,17 +390,17 @@
 -- If the part fits there it returns 1, otherwise 0.
 function checkPart(Index,x,y,z)
-	check=1
-	for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-		for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-			for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
-				-- If the part occupies the position (i,j,k), the grid must be empty there ((x+i, y+j, z+k)==0), if not, check is zero,
-				--	which means that the part doesn't fit there.
-				if bodyParts[Index][i][j][k][0] == 1 and grid[x+i][y+j][z+k][0] == 1 then
-					check=0
-				end
-			end
-		end
-	end
-	return check
+    check=1
+    for i=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+        for j=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+            for k=math.floor(-pDim/2)+1,math.floor(pDim/2) do
+                -- If the part occupies the position (i,j,k), the grid must be empty there ((x+i, y+j, z+k)==0), if not, check is zero,
+                --  which means that the part doesn't fit there.
+                if bodyParts[Index][i][j][k][0] == 1 and grid[x+i][y+j][z+k][0] == 1 then
+                    check=0
+                end
+            end
+        end
+    end
+    return check
 end
 -- End checkPart function.
@@ -408,36 +408,36 @@
 -- This function prints the model with tempPartIndex in the bodyParts array at position lx,ly,lz.
 -- If you need to rotate the model around his own axis, then you have to set movEntity true and define the details of the rotation in
---	bodyParts[tempPartIndex][0][0][0][8].
+--  bodyParts[tempPartIndex][0][0][0][8].
 -- If your model needs to be rotated like bodyParts[tempPartIndex][0][0][0][5], then side must be 1, for bodyParts[tempPartIndex][0][0][0][6] side must be 2,
---	for bodyParts[tempPartIndex][0][0][0][7] side must be 3.
+--  for bodyParts[tempPartIndex][0][0][0][7] side must be 3.
 function printModel(lx,ly,lz,tempPartIndex,movEntity,side)
-	if movEntity == true then
-		print("<MovableEntity scale=1 position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale) print("\" ")
-		print(bodyParts[tempPartIndex][0][0][0][8]) print(">")
-		print("<attached>")
-		lx=0 ly=0 lz=0
-	end
-
-	print("<Model position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale)
-	print("\" scale=") print(sSScale) print(" mesh= \"") print(bodyParts[tempPartIndex][0][0][0][4]) print("\"")
-
-		if side == 1 then
-			print(bodyParts[tempPartIndex][0][0][0][5]) print(">")
-		elseif side == 2 then
-			print(bodyParts[tempPartIndex][0][0][0][6]) print(">")
-		elseif side == 3 then
-			print(bodyParts[tempPartIndex][0][0][0][7]) print(">")
-		end
-
-		print("<attached>")
-			print(bodyParts[tempPartIndex][0][0][0][9])
-		print("</attached>")
-
-	print("</Model>")
-
-	if movEntity == true then
-		print("</attached>")
-		print("</MovableEntity>")
-	end
+    if movEntity == true then
+        print("<MovableEntity scale=1 position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale) print("\" ")
+        print(bodyParts[tempPartIndex][0][0][0][8]) print(">")
+        print("<attached>")
+        lx=0 ly=0 lz=0
+    end
+
+    print("<Model position=\"") print(lx*gridDim*sSScale) print(",") print(ly*gridDim*sSScale) print(",") print(lz*gridDim*sSScale)
+    print("\" scale=") print(sSScale) print(" mesh= \"") print(bodyParts[tempPartIndex][0][0][0][4]) print("\"")
+
+        if side == 1 then
+            print(bodyParts[tempPartIndex][0][0][0][5]) print(">")
+        elseif side == 2 then
+            print(bodyParts[tempPartIndex][0][0][0][6]) print(">")
+        elseif side == 3 then
+            print(bodyParts[tempPartIndex][0][0][0][7]) print(">")
+        end
+
+        print("<attached>")
+            print(bodyParts[tempPartIndex][0][0][0][9])
+        print("</attached>")
+
+    print("</Model>")
+
+    if movEntity == true then
+        print("</attached>")
+        print("</MovableEntity>")
+    end
 end
 -- End function printModel().
@@ -446,40 +446,40 @@
 -- The arguments lx,ly,lz are the coordinates of the grid, where you want to set the part.
 -- The arguments xAxis,yAxis,zAxis can be 0 or 1, but only one argument out of the three can be 1. This means two of them must always be zero. You have to set xAxis to one,
---	if your part is attached to a side, which faces into the x-direction (negative or positive, this is later specified with Dir), that means the x-Axis is a normal vector
---	of the side to which you want to attach the part. The same for yAxis and zAxis.
+--  if your part is attached to a side, which faces into the x-direction (negative or positive, this is later specified with Dir), that means the x-Axis is a normal vector
+--  of the side to which you want to attach the part. The same for yAxis and zAxis.
 -- The argument Dir must be 1 if your side, where you want to attach the part, faces into the positive direction, -1 if the side faces into the negative direction. The side
---	faces into the positive direction means, that the side of the side where the part will be attached is directed into the direction of the positive direction of the
---	corresponding axis.
+--  faces into the positive direction means, that the side of the side where the part will be attached is directed into the direction of the positive direction of the
+--  corresponding axis.
 -- The argument index is the index of the part for the bodyParts array.
 -- The argument printMovEnt must be false if your part doesn't need to be attached to an extra MovableEntity. If your part must be attached to an extra MovableEntity
---	this argument must be true. The extra MovableEntity is used to rotate the part around his own axis, or something like that.
+--  this argument must be true. The extra MovableEntity is used to rotate the part around his own axis, or something like that.
 -- The argument printSide is like the argument side of the printModel() function. It defines how your part will be rotated. Read the commentary there.
 -- The function returns 0 if the part couldn't be set, because it did not fit there or there was no side to attach the part. It returns 1 if the part is successfully set.
 function setPart(lx,ly,lz,xAxis,yAxis,zAxis,Dir,index,printMovEnt,printSide)
 
-	partSet=0
-	-- For the bodyParts array I use 1 as x-, 2 as y- and 3 as z-Axis for the definition in which directions a part can have connections.
-	coord=1*xAxis+2*yAxis+3*zAxis
-	-- If I try to attach the part from the positive direction to the side of the space station, the part of the station (where I want to attach the new part) must have
-	--	a connection into the positive direction. Otherwise I look from the negative side and so the part of the station must have a connection into the negative direction.
-	if Dir==1 then
-		conn="+"
-	elseif Dir==-1 then
-		conn="-"
-	end
-	-- I look from the direction defined through Dir, and here I check, whether I have reached a side of the space station, which means at position lx,ly,lz is nothing and
-	--	at the next position is a part which can have a connection into the direction from where I look.
-	if grid[lx][ly][lz][0] == 0 and grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][0] == 1 and (grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]=="+-" or grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]==conn) then
-		-- This checks whether the part fits at that position or not.
-		check=checkPart(index,lx,ly,lz)
-		if check == 1 then
-			-- This prints the part.
-			printModel(lx,ly,lz,index,printMovEnt,printSide)
-			partSet=1
-			-- This actualizes the grid array with the values of the array bodyParts at the position index.
-			actualizeGrid(index,lx,ly,lz)
-		end
-	end
-	return partSet
+    partSet=0
+    -- For the bodyParts array I use 1 as x-, 2 as y- and 3 as z-Axis for the definition in which directions a part can have connections.
+    coord=1*xAxis+2*yAxis+3*zAxis
+    -- If I try to attach the part from the positive direction to the side of the space station, the part of the station (where I want to attach the new part) must have
+    --  a connection into the positive direction. Otherwise I look from the negative side and so the part of the station must have a connection into the negative direction.
+    if Dir==1 then
+        conn="+"
+    elseif Dir==-1 then
+        conn="-"
+    end
+    -- I look from the direction defined through Dir, and here I check, whether I have reached a side of the space station, which means at position lx,ly,lz is nothing and
+    --  at the next position is a part which can have a connection into the direction from where I look.
+    if grid[lx][ly][lz][0] == 0 and grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][0] == 1 and (grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]=="+-" or grid[lx+(-1*xAxis*Dir)][ly+(-1*yAxis*Dir)][lz+(-1*zAxis*Dir)][coord]==conn) then
+        -- This checks whether the part fits at that position or not.
+        check=checkPart(index,lx,ly,lz)
+        if check == 1 then
+            -- This prints the part.
+            printModel(lx,ly,lz,index,printMovEnt,printSide)
+            partSet=1
+            -- This actualizes the grid array with the values of the array bodyParts at the position index.
+            actualizeGrid(index,lx,ly,lz)
+        end
+    end
+    return partSet
 end
 -- End function setPart().
@@ -490,45 +490,45 @@
 -- The argument parts is the number of different parts which you want to attach to a side.
 function spiralSet(xAxis,yAxis,zAxis,Dir,index,parts,printMovEnt,printSide)
-	if index[0] ~= false then
-		-- The array vector contains the actual position where you try to set the part. vector[0],vector[1] and vector[3] contains the x,y,z-coordinate.
-		vector={}
-		-- This must be done, because there are different sides from where I try to attach a part.
-		coord1=1*yAxis+2*zAxis
-		coord2=math.mod(coord1+1,3)
-		coord3=math.mod(coord2+1,3)
-
-		for pc=1,parts do
-			tempIndex = index[pc]
-			for eachPart=1,bodyParts[tempIndex][0][0][0][10] do
-				partSet=0
-				vector[coord1]=math.floor(Dir*sSSize/2)-2*Dir
-				while vector[coord1]~=math.floor(-1*Dir*sSSize/2)+2*Dir and partSet==0 do
-					round=0
-					while round<=math.floor(sSSize/2)-2 and partSet==0 do
-						vector[coord2]=round
-						vector[coord3]=-round
-						while vector[coord3]<=round and partSet==0 do
-							partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
-							vector[coord3]=vector[coord3]+1
-						end
-						while vector[coord2]>=-round and partSet==0 do
-							partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
-							vector[coord2]=vector[coord2]-1
-						end
-						while vector[coord3]>-round and partSet==0 do
-							partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
-							vector[coord3]=vector[coord3]-1
-						end
-						while vector[coord2]<=round and partSet==0 do
-							partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
-							vector[coord2]=vector[coord2]+1
-						end
-						round=round+1
-					end
-					vector[coord1]=vector[coord1]-Dir
-				end
-			end
-		end
-	end
+    if index[0] ~= false then
+        -- The array vector contains the actual position where you try to set the part. vector[0],vector[1] and vector[3] contains the x,y,z-coordinate.
+        vector={}
+        -- This must be done, because there are different sides from where I try to attach a part.
+        coord1=1*yAxis+2*zAxis
+        coord2=math.mod(coord1+1,3)
+        coord3=math.mod(coord2+1,3)
+
+        for pc=1,parts do
+            tempIndex = index[pc]
+            for eachPart=1,bodyParts[tempIndex][0][0][0][10] do
+                partSet=0
+                vector[coord1]=math.floor(Dir*sSSize/2)-2*Dir
+                while vector[coord1]~=math.floor(-1*Dir*sSSize/2)+2*Dir and partSet==0 do
+                    round=0
+                    while round<=math.floor(sSSize/2)-2 and partSet==0 do
+                        vector[coord2]=round
+                        vector[coord3]=-round
+                        while vector[coord3]<=round and partSet==0 do
+                            partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+                            vector[coord3]=vector[coord3]+1
+                        end
+                        while vector[coord2]>=-round and partSet==0 do
+                            partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+                            vector[coord2]=vector[coord2]-1
+                        end
+                        while vector[coord3]>-round and partSet==0 do
+                            partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+                            vector[coord3]=vector[coord3]-1
+                        end
+                        while vector[coord2]<=round and partSet==0 do
+                            partSet=setPart(vector[0],vector[1],vector[2],xAxis,yAxis,zAxis,Dir,tempIndex,printMovEnt,printSide)
+                            vector[coord2]=vector[coord2]+1
+                        end
+                        round=round+1
+                    end
+                    vector[coord1]=vector[coord1]-Dir
+                end
+            end
+        end
+    end
 end
 -- End function spiralSet().
@@ -554,35 +554,35 @@
 xMax=math.random(math.floor(xLength/2),math.floor(xLength/2)+xVar)
 while x<xMax do
-	-- The same for the y- and z-direction.
-	y=math.random(-math.floor(yLength/2),-math.floor(yLength/2)+yVar)
-	yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
-	while y<yMax do
-		yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
-		z=math.random(-math.floor(zLength/2),-math.floor(zLength/2)+zVar)
-		zMax=math.random(math.floor(zLength/2),math.floor(zLength/2)+zVar)
-		while z<zMax do
-			-- This loop choses a bodypart, which fits at position (x,y,z).
-			-- If after the fifth time the part does still not fit we terminate the loop and set no part at postition (x,y,z).
-			partSet=0
-			counter=0
-			while counter<5 and partSet==0 do
-				-- This choses randomly a bodyPartIndex, which is the index used for the parts in the array bodyParts.
-				tempBodyPartIndex=math.random(1,sSBodyParts)
-				check=checkPart(tempBodyPartIndex,x,y,z)
-				-- If check == 1, this means that the part fits there, so we put it there and break the while true loop, to go on.
-				if check == 1 then
-					-- This prints the chosen part at position (x*gridDim*sSScale,y*gridDim*sSScale,z*gridDim*sSScale).
-					printModel(x,y,z,tempBodyPartIndex,false,1)
-					-- This actualizes the grid array with the values of the array bodyParts at the position tempBodyPartIndex, which is our randomly chosen part.
-					actualizeGrid(tempBodyPartIndex,x,y,z)
-					partSet=1
-				end
-				counter=counter+1
-			end
-			z=z+1
-		end
-		y=y+1
-	end
-	x=x+1
+    -- The same for the y- and z-direction.
+    y=math.random(-math.floor(yLength/2),-math.floor(yLength/2)+yVar)
+    yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
+    while y<yMax do
+        yMax=math.random(math.floor(yLength/2),math.floor(yLength/2)+yVar)
+        z=math.random(-math.floor(zLength/2),-math.floor(zLength/2)+zVar)
+        zMax=math.random(math.floor(zLength/2),math.floor(zLength/2)+zVar)
+        while z<zMax do
+            -- This loop choses a bodypart, which fits at position (x,y,z).
+            -- If after the fifth time the part does still not fit we terminate the loop and set no part at postition (x,y,z).
+            partSet=0
+            counter=0
+            while counter<5 and partSet==0 do
+                -- This choses randomly a bodyPartIndex, which is the index used for the parts in the array bodyParts.
+                tempBodyPartIndex=math.random(1,sSBodyParts)
+                check=checkPart(tempBodyPartIndex,x,y,z)
+                -- If check == 1, this means that the part fits there, so we put it there and break the while true loop, to go on.
+                if check == 1 then
+                    -- This prints the chosen part at position (x*gridDim*sSScale,y*gridDim*sSScale,z*gridDim*sSScale).
+                    printModel(x,y,z,tempBodyPartIndex,false,1)
+                    -- This actualizes the grid array with the values of the array bodyParts at the position tempBodyPartIndex, which is our randomly chosen part.
+                    actualizeGrid(tempBodyPartIndex,x,y,z)
+                    partSet=1
+                end
+                counter=counter+1
+            end
+            z=z+1
+        end
+        y=y+1
+    end
+    x=x+1
 end
 -- End attach all bodyparts.
@@ -593,5 +593,5 @@
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -- Attach backParts, if there are some.
-	spiralSet(0,0,1,1,backPartsIndex,backParts,false,1)
+    spiralSet(0,0,1,1,backPartsIndex,backParts,false,1)
 -- End attach backParts.
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -599,5 +599,5 @@
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -- Attach frontParts, if there are.
-	spiralSet(0,0,1,-1,frontPartsIndex,frontParts,false,1)
+    spiralSet(0,0,1,-1,frontPartsIndex,frontParts,false,1)
 -- End attach frontParts.
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -605,5 +605,5 @@
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -- Attach parts on the left side of the space station.
-	spiralSet(1,0,0,-1,leftSidePartsIndex,leftSideParts,true,1)
+    spiralSet(1,0,0,-1,leftSidePartsIndex,leftSideParts,true,1)
 -- End attach left side parts.
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -611,5 +611,5 @@
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -- Attach parts on the right side of the space station.
-	spiralSet(1,0,0,1,rightSidePartsIndex,rightSideParts,true,2)
+    spiralSet(1,0,0,1,rightSidePartsIndex,rightSideParts,true,2)
 -- End attach right side parts.
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -617,5 +617,5 @@
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -- Attach parts on top of the space station.
-	spiralSet(0,1,0,1,topPartsIndex,topParts,true,1)
+    spiralSet(0,1,0,1,topPartsIndex,topParts,true,1)
 -- End attach top parts.
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -627,26 +627,26 @@
 -- This iterates through the whole grid array.
 if connPartsIndex[0] ~= false then
-	for x=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
-		for y=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
-			for z=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
-				tempConnPartIndex=connPartsIndex[math.random(1,connParts)]
-				-- This checks whether there has to be a connection part between (x,y,z) and (x+1,y,z) or not. First it checks if there is a part at (x,y,z) and
-				--	then it checks if that part can have a connection into the positive x-direction, if it can, it checks if there is a part at (x+1,y,z) and
-				--	if that part can have a connection into the negative x-direction, if both can, it prints the xml code to set a connection part.
-				if grid[x][y][z][0]==1 and (grid[x][y][z][1]=="+" or grid[x][y][z][1]=="+-") and grid[x+1][y][z][0]==1 and (grid[x+1][y][z][1]=="-" or grid[x+1][y][z][1]=="+-") then
-					-- This prints the connection part, the +1/2 is because the connection is set exactly in the middle of two gridpoints.
-					printModel(x+1/2,y,z,tempConnPartIndex,false,1)
-				end
-				-- The same as in the x-direction, but for the y-direction.
-				if grid[x][y][z][0]==1 and ( grid[x][y][z][2]=="+" or grid[x][y][z][2]=="+-" ) and grid[x][y+1][z][0]==1 and ( grid[x][y+1][z][2]=="-" or grid[x][y+1][z][2]=="+-" ) then
-					printModel(x,y+1/2,z,tempConnPartIndex,false,2)
-				end
-				-- The same as in the x-direction, but for the z-direction.
-				if grid[x][y][z][0]==1 and ( grid[x][y][z][3]=="+" or grid[x][y][z][3]=="+-" ) and grid[x][y][z+1][0]==1 and ( grid[x][y][z+1][3]=="-" or grid[x][y][z+1][3]=="+-" ) then
-					printModel(x,y,z+1/2,tempConnPartIndex,false,3)
-				end
-			end
-		end
-	end
+    for x=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+        for y=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+            for z=math.floor(-sSSize/2)+2,math.floor(sSSize/2)-2 do
+                tempConnPartIndex=connPartsIndex[math.random(1,connParts)]
+                -- This checks whether there has to be a connection part between (x,y,z) and (x+1,y,z) or not. First it checks if there is a part at (x,y,z) and
+                --  then it checks if that part can have a connection into the positive x-direction, if it can, it checks if there is a part at (x+1,y,z) and
+                --  if that part can have a connection into the negative x-direction, if both can, it prints the xml code to set a connection part.
+                if grid[x][y][z][0]==1 and (grid[x][y][z][1]=="+" or grid[x][y][z][1]=="+-") and grid[x+1][y][z][0]==1 and (grid[x+1][y][z][1]=="-" or grid[x+1][y][z][1]=="+-") then
+                    -- This prints the connection part, the +1/2 is because the connection is set exactly in the middle of two gridpoints.
+                    printModel(x+1/2,y,z,tempConnPartIndex,false,1)
+                end
+                -- The same as in the x-direction, but for the y-direction.
+                if grid[x][y][z][0]==1 and ( grid[x][y][z][2]=="+" or grid[x][y][z][2]=="+-" ) and grid[x][y+1][z][0]==1 and ( grid[x][y+1][z][2]=="-" or grid[x][y+1][z][2]=="+-" ) then
+                    printModel(x,y+1/2,z,tempConnPartIndex,false,2)
+                end
+                -- The same as in the x-direction, but for the z-direction.
+                if grid[x][y][z][0]==1 and ( grid[x][y][z][3]=="+" or grid[x][y][z][3]=="+-" ) and grid[x][y][z+1][0]==1 and ( grid[x][y][z+1][3]=="-" or grid[x][y][z+1][3]=="+-" ) then
+                    printModel(x,y,z+1/2,tempConnPartIndex,false,3)
+                end
+            end
+        end
+    end
 end
 -- End attach all connectionparts.
@@ -671,5 +671,5 @@
 -- This function is for the lazy guys, which do not care how the space station looks like, so I use some good standard values.
 function createSpaceStation()
-	createSpaceStationPar(0,4,1,2,1,6,1,100)
+    createSpaceStationPar(0,4,1,2,1,6,1,100)
 end
 -- End createSpaceStaion() function.
Index: code/trunk/data/levels/includes/asteroidField.lua
===================================================================
--- code/trunk/data/levels/includes/asteroidField.lua	(revision 9347)
+++ code/trunk/data/levels/includes/asteroidField.lua	(revision 9348)
@@ -1,66 +1,65 @@
 --[[ fog generator
 generates fog
-	posX, posY, posZ - position in space
-	size - size of billboard
-	brightness - [0,1] fog brightness
+    posX, posY, posZ - position in space
+    size - size of billboard
+    brightness - [0,1] fog brightness
 --]]
 function generateFog(posX, posY, posZ, size, brightness)
-		print("<Billboard ")
-			print("position = \"") 
-				print(posX) print(",") 
-				print(posY) print(",") 
-				print(posZ) print("\" ") 
-			print("colour=\"")
-				print(brightness) print(",") 
-				print(brightness) print(",") 
-				print(brightness) print("\" ") 
-			print("material=\"Smoke/Smoke\" scale=")
-			print(size)
-			print(" />")
+    print("<Billboard ")
+        print("position = \"")
+            print(posX) print(",")
+            print(posY) print(",")
+            print(posZ) print("\" ")
+        print("colour=\"")
+            print(brightness) print(",")
+            print(brightness) print(",")
+            print(brightness) print("\" ")
+        print("material=\"Smoke/Smoke\" scale=")
+        print(size)
+    print(" />")
 end
 
 --[[ asteroid field generator
 generates asteroid field
-	posX, posY, posZ - position in space
-	minSize, maxSize - size boundaries of each asteroid
-	radius - size of the cube around position in space
-	count - number of asteroids
-	fog - enable fog 0/1
+    posX, posY, posZ - position in space
+    minSize, maxSize - size boundaries of each asteroid
+    radius - size of the cube around position in space
+    count - number of asteroids
+    fog - enable fog 0/1
 --]]
 function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count, fog)
-	for i = 1, count, 1
-	do
-		size = (math.random() * (maxSize - minSize)) + minSize
-		pX = (2 * math.random() * radius) - radius + posX
-		pY = (2 * math.random() * radius) - radius + posY
-		pZ = (2 * math.random() * radius) - radius + posZ
-		print("<StaticEntity ")
-		
-		print("position = \"") 
-		print(pX) print(",") 
-		print(pY) print(",") 
-		print(pZ) print("\" ")
-		
-		print("scale = \"") print(size) print("\" ")
-		
-		print("collisionType = static linearDamping = 0.8 angularDamping = 1 ") 
-		print("collisiondamage = 1000 enablecollisiondamage = true>")
-		
-		print("<attached>")
-			print("<Model mass=\"") print(size * 10) print("\" ")
-			print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
-		print("</attached>")
-		
-		print("<collisionShapes> ")
-			print("<SphereCollisionShape radius=\"") 
-			print(size * 2.5) print("\" />")
-		print("</collisionShapes>")
-		
-		print("</StaticEntity>")
-		
-		if fog == 1 and i % 5 == 0 then
-			generateFog(pX, pY, pZ, radius*0.04, 0.2)
-		end
-	end
+    for i = 1, count, 1 do
+        size = (math.random() * (maxSize - minSize)) + minSize
+        pX = (2 * math.random() * radius) - radius + posX
+        pY = (2 * math.random() * radius) - radius + posY
+        pZ = (2 * math.random() * radius) - radius + posZ
+        print("<StaticEntity ")
+
+        print("position = \"")
+        print(pX) print(",")
+        print(pY) print(",")
+        print(pZ) print("\" ")
+
+        print("scale = \"") print(size) print("\" ")
+
+        print("collisionType = static linearDamping = 0.8 angularDamping = 1 ")
+        print("collisiondamage = 1000 enablecollisiondamage = true>")
+
+        print("<attached>")
+            print("<Model mass=\"") print(size * 10) print("\" ")
+            print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
+        print("</attached>")
+
+        print("<collisionShapes> ")
+            print("<SphereCollisionShape radius=\"")
+            print(size * 2.5) print("\" />")
+        print("</collisionShapes>")
+
+        print("</StaticEntity>")
+
+        if fog == 1 and i % 5 == 0 then
+            generateFog(pX, pY, pZ, radius*0.04, 0.2)
+        end
+    end
 end
 
@@ -68,36 +67,35 @@
 --[[ asteroid belt generator
 generates asteroid belt
-	posX, posY, posZ - position in space
-	yaw, pitch - rotation
-	minSize, maxSize - size boundaries of each asteroid
-	radius0, radius1 - inner/outer radius
-	count - number of asteroids
-	fog - enable fog 0/1
+    posX, posY, posZ - position in space
+    yaw, pitch - rotation
+    minSize, maxSize - size boundaries of each asteroid
+    radius0, radius1 - inner/outer radius
+    count - number of asteroids
+    fog - enable fog 0/1
 --]]
 function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog)
-	dPhi = (2 * math.pi) / segments
-	width = math.abs(radius1 - radius0)
-	radius = (radius1 + radius0) / 2
-	segmentCount = count / segments
-	
-	print("<StaticEntity collisionType=static yaw=") print(yaw) 
-	print(" pitch=") print(pitch)
-	
-	print(" position = \"") 
-		print(centerX) print(",") 
-		print(centerY) print(",") 
-		print(centerZ) print("\"") 
-	print(">")
-	
-	print("<attached>")
-	
-	for i = 0, segments - 1, 1
-	do
-		asteroidField((radius * math.cos(i * dPhi)),
-					(radius * math.sin(i * dPhi)),
-					0, minSize, maxSize, width, segmentCount, fog)
-	end
-	
-	print("</attached>")
-	print("</StaticEntity>")
+    dPhi = (2 * math.pi) / segments
+    width = math.abs(radius1 - radius0)
+    radius = (radius1 + radius0) / 2
+    segmentCount = count / segments
+
+    print("<StaticEntity collisionType=static yaw=") print(yaw)
+    print(" pitch=") print(pitch)
+
+    print(" position = \"")
+        print(centerX) print(",")
+        print(centerY) print(",")
+        print(centerZ) print("\"")
+    print(">")
+
+    print("<attached>")
+
+    for i = 0, segments - 1, 1 do
+        asteroidField((radius * math.cos(i * dPhi)),
+                    (radius * math.sin(i * dPhi)),
+                    0, minSize, maxSize, width, segmentCount, fog)
+    end
+
+    print("</attached>")
+    print("</StaticEntity>")
 end
Index: code/trunk/data/levels/includes/pickups.oxi
===================================================================
--- code/trunk/data/levels/includes/pickups.oxi	(revision 9347)
+++ code/trunk/data/levels/includes/pickups.oxi	(revision 9348)
@@ -3,244 +3,206 @@
 
 <PickupRepresentation
+    name = "smallshieldpickup"
     pickupName = "Small Shield Pickup"
     pickupDescription = "Gives you a small-sized shield for 30 seconds."
     inventoryRepresentation = "SmallShield"
     spawnerTemplate = "smallshieldpickupRepresentation"
->
-    <pickup>
-        <ShieldPickup template=smallshieldpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "mediumshieldpickup"
     pickupName = "Medium Shield Pickup"
     pickupDescription = "Gives you a medium-sized shield for 30 seconds."
     inventoryRepresentation = "MediumShield"
     spawnerTemplate = "mediumshieldpickupRepresentation"
->
-    <pickup>
-        <ShieldPickup template=mediumshieldpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "hugeshieldpickup"
     pickupName = "Huge Shield Pickup"
     pickupDescription = "Gives you a big shield for 60 seconds."
     inventoryRepresentation = "HugeShield"
     spawnerTemplate = "hugeshieldpickupRepresentation"
->
-    <pickup>
-        <ShieldPickup template=hugeshieldpickup />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Health pickups -->
 
 <PickupRepresentation
+    name = "smallhealthpickup"
     pickupName = "Small Health Boost"
     pickupDescription = "Adds a small amout of health to the ship."
     inventoryRepresentation = "SmallHealth"
     spawnerTemplate = "smallhealthpickupRepresentation"
->
-    <pickup>
-        <HealthPickup template=smallhealthpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "mediumhealthpickup"
     pickupName = "Medium Health Boost"
     pickupDescription = "Adds a medium amout of health to the ship."
     spawnerTemplate = "mediumhealthpickupRepresentation"
     inventoryRepresentation = "MediumHealth"
->
-    <pickup>
-        <HealthPickup template=mediumhealthpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "hugehealthpickup"
     pickupName = "Huge Health Boost"
     pickupDescription = "Adds a huge amout of health to the ship."
     spawnerTemplate = "hugehealthpickupRepresentation"
     inventoryRepresentation = "HugeHealth"
->
-    <pickup>
-        <HealthPickup template=hugehealthpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "crazyhealthpickup"
     pickupName = "Crazy Madness Health Boost"
     pickupDescription = "Adds a crazy amout of health to the ship."
     spawnerTemplate = "crazyhealthpickupRepresentation"
     inventoryRepresentation = "CrazyMadnessHealth"
->
-    <pickup>
-        <HealthPickup template=crazyhealthpickup />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Meta pickups -->
 
 <PickupRepresentation
+    name = "use"
     pickupName = "Use Pickup"
     pickupDescription = "Uses all pickups you have."
     spawnerTemplate = "usepickupRepresentation"
     inventoryRepresentation = "usePickup"
->
-    <pickup>
-        <MetaPickup metaType="use" />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "drop"
     pickupName = "Drop Pickup"
     pickupDescription = "Drops all pickups you have."
     spawnerTemplate = "droppickupRepresentation"
     inventoryRepresentation = "dropPickup"
->
-    <pickup>
-        <MetaPickup metaType="drop" />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Speed pickups -->
 
 <PickupRepresentation
+    name = "smallspeedpickup"
     pickupName = "Small Speed Boost"
     pickupDescription = "Multiplies Speed of the Ship by a small amount."
     spawnerTemplate = "smallspeedpickupRepresentation"
     inventoryRepresentation = "SmallSpeed"
->
-    <pickup>
-        <SpeedPickup template=smallspeedpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "mediumspeedpickup"
     pickupName = "Medium Speed Boost"
     pickupDescription = "Multiplies Speed of the Ship by a bigger amount."
     spawnerTemplate = "mediumspeedpickupRepresentation"
     inventoryRepresentation = "MediumSpeed"
->
-    <pickup>
-        <SpeedPickup template=mediumspeedpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "hugespeedpickup"
     pickupName = "Huge Speed Boost"
     pickupDescription = "Multiplies Speed of the Ship by a huge amount."
     spawnerTemplate = "hugespeedpickupRepresentation"
     inventoryRepresentation = "HugeSpeed"
->
-    <pickup>
-        <SpeedPickup template=hugespeedpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "smalljumppickup"
     pickupName = "Small Jump Boost"
     pickupDescription = "Boosts the Ship with a massive amount for a very short time."
     spawnerTemplate = "smalljumppickupRepresentation"
     inventoryRepresentation = "SmallSpeed"
->
-    <pickup>
-        <SpeedPickup template=smalljumppickup />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Invisible pickups -->
 
 <PickupRepresentation
+    name = "smallinvisiblepickup"
     pickupName = "Small Invisibility"
     pickupDescription = "Makes you invisible for 5 seconds."
     spawnerTemplate = "smallinvisiblepickupRepresentation"
     inventoryRepresentation = "SmallInvisible"
->
-    <pickup>
-        <InvisiblePickup template=smallinvisiblepickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "mediuminvisiblepickup"
     pickupName = "Medium Invisibility"
     pickupDescription = "Makes you invisible for 10 seconds."
     spawnerTemplate = "mediuminvisiblepickupRepresentation"
     inventoryRepresentation = "MediumInvisible"
->
-    <pickup>
-        <InvisiblePickup template=mediuminvisiblepickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "hugeinvisiblepickup"
     pickupName = "Huge Invisibility"
     pickupDescription = "Makes you invisible for 20 seconds."
     spawnerTemplate = "hugeinvisiblepickupRepresentation"
     inventoryRepresentation = "HugeInvisible"
->
-    <pickup>
-        <InvisiblePickup template=hugeinvisiblepickup />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Pickup Collection pickups -->
 
 <PickupRepresentation
+    name = "triplehealthspeedinvisibilitypickup"
     pickupName = "Tri Pickup"
     pickupDescription = "Adds health, speed and invisibility."
     spawnerTemplate = "triplehealthspeedinvisibilitypickupRepresentation"
->
-    <pickup>
-        <PickupCollection template=triplehealthspeedinvisibilitypickup />
-    </pickup>
-</PickupRepresentation>
+/>
 
 <!-- Drone Pickup -->
 
 <PickupRepresentation
+    name = "dronepickup"
     pickupName = "Drone Pickup"
     pickupDescription = "Adds a Drone to the Player's Spaceship"
     spawnerTemplate = "dronepickupRepresentation"
->
-    <pickup>
-        <DronePickup template=dronepickup />
-    </pickup>
-</PickupRepresentation>
+/>
+
+<!-- DamageBoost Pickup -->
+
+<PickupRepresentation
+    name = "smalldamageboostpickup"
+    pickupName = "Small DamageBoost Pickup"
+    pickupDescription = "Multiplies the ship damage with 2."
+    spawnerTemplate = "smalldamageboostpickupRepresentation"
+    inventoryRepresentation = "SmallDamageBoost"
+/>
+
+<PickupRepresentation
+    name = "mediumdamageboostpickup"
+    pickupName = "Medium DamageBoost Pickup"
+    pickupDescription = "Multiplies the ship damage with 5."
+    spawnerTemplate = "mediumdamageboostpickupRepresentation"
+    inventoryRepresentation = "MediumDamageBoost"
+/>
+
+<PickupRepresentation
+    name = "largedamageboostpickup"
+    pickupName = "Large DamageBoost Pickup"
+    pickupDescription = "Multiplies the ship damage with 7."
+    spawnerTemplate = "largedamageboostpickupRepresentation"
+    inventoryRepresentation = "LargeDamageBoost"
+/>
 
 <!-- Shrink Pickup -->
 
 <PickupRepresentation
+    name = "smallshrinkpickup"
     pickupName = "Small Shrink"
     pickupDescription = "Shrinks the Ship by a bit"
     spawnerTemplate = "smallshrinkpickupRepresentation"
     inventoryRepresentation = "SmallShrink"
->
-    <pickup>
-        <ShrinkPickup template=smallshrinkpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "mediumshrinkpickup"
     pickupName = "Medium Shrink"
     pickupDescription = "Shrinks the Ship"
     spawnerTemplate = "mediumshrinkpickupRepresentation"
     inventoryRepresentation = "MediumShrink"
->
-    <pickup>
-        <ShrinkPickup template=mediumshrinkpickup />
-    </pickup>
-</PickupRepresentation>
-
-<PickupRepresentation
+/>
+
+<PickupRepresentation
+    name = "hugeshrinkpickup"
     pickupName = "Huge Shrink"
     pickupDescription = "Shrinks the Ship considerably"
     spawnerTemplate = "hugeshrinkpickupRepresentation"
     inventoryRepresentation = "HugeShrink"
->
-    <pickup>
-        <ShrinkPickup template=hugeshrinkpickup />
-    </pickup>
-</PickupRepresentation>
-
+/>
Index: code/trunk/data/levels/includes/towerWeaponSettings.oxi
===================================================================
--- code/trunk/data/levels/includes/towerWeaponSettings.oxi	(revision 9348)
+++ code/trunk/data/levels/includes/towerWeaponSettings.oxi	(revision 9348)
@@ -0,0 +1,55 @@
+     <weaponslots>
+      <WeaponSlot position="-15.0,-1.5,0" />
+      <WeaponSlot position=" 15.0,-1.5,0" />
+      <WeaponSlot position="    0,   0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+      <WeaponSet firemode=1 />
+      <WeaponSet firemode=2 />
+      <WeaponSet firemode=3 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+          <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+          <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+        </links>
+        <Weapon>
+          <attached>
+            <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,200" scale=1/>
+            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,200" scale=1 />
+            <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=10 />
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=314.159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+        </Weapon>
+        
+        <Weapon>
+          <attached>
+            <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+            <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+        </Weapon>
+        <Weapon>
+          <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+          <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+        </Weapon>
+        
+      </WeaponPack>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+        </links>
+        <!--Weapon>
+          <EnergyDrink mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
+        </Weapon-->
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/includes/weaponSettingsFPS.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFPS.oxi	(revision 9347)
+++ code/trunk/data/levels/includes/weaponSettingsFPS.oxi	(revision 9348)
@@ -1,7 +1,9 @@
     <weaponslots>
       <WeaponSlot position="0,0,0" yaw=0 pitch=0 roll=0 />
- <!--      <WeaponSlot position="-0.5,0.8,2.5" yaw=0 pitch=0 roll=0 />
+<!--
+      <WeaponSlot position="-0.5,0.8,2.5" yaw=0 pitch=0 roll=0 />
       <WeaponSlot position="15,-1.5,-25" yaw=0 pitch=0 roll=0 />
-      <WeaponSlot position="0,0,-45" yaw=0 pitch=0 roll=0 /> -->
+      <WeaponSlot position="0,0,-45" yaw=0 pitch=0 roll=0 />
+-->
     </weaponslots>
     <weaponsets>
@@ -11,12 +13,12 @@
     <weapons>
       <WeaponPack firemode=0>
-	<links>
+        <links>
           <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
           <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
           <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
         </links>
-	<Weapon>
-	   <HsW01 mode=0 munitionpershot=0 delay=0.0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.7, -0.3, -3" />
-           <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
+        <Weapon>
+          <HsW01 mode=0 munitionpershot=0 delay=0.0 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.7, -0.3, -3" />
+          <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
         </Weapon>
         <LaserGun
@@ -28,5 +30,5 @@
             unlimitedMunition=true
         />
-  <!--       <LaserGun
+        <!--LaserGun
             position="0,0,0"
             munitionType="LaserGunMunition"
@@ -45,5 +47,5 @@
             speed="600"
             unlimitedMunition=true
-        /> -->
+        /-->
       </WeaponPack>
     </weapons>
Index: code/trunk/data/levels/lastManStanding.oxw
===================================================================
--- code/trunk/data/levels/lastManStanding.oxw	(revision 9347)
+++ code/trunk/data/levels/lastManStanding.oxw	(revision 9348)
@@ -33,5 +33,5 @@
     ?>
 
-<!----- Spawnpoints 
+<!----- Spawnpoints
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
     <SpawnPoint team=0 position="-1150,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
@@ -44,5 +44,5 @@
 
 <!-- ------------ middle asteroid -------------- -->
-    <StaticEntity position="0,0,0" collisionType=static>    
+    <StaticEntity position="0,0,0" collisionType=static>
         <attached>
             <MovableEntity position="0,20,0" rotationrate="-4.5" rotationaxis="0,1,0" >
@@ -50,9 +50,5 @@
                     <Model position="0,0,0" scale=140 mesh="asteroid_UV.mesh" shadow=true />
                     <Model position="-160,40,28.4" scale=1 mesh="sphere.mesh" /><!--EasterEgg indicator-->
-                    <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
-                        <pickup>
-                            <InvisiblePickup template=hugeinvisiblepickup />
-                        </pickup>
-                    </PickupSpawner>
+                    <PickupSpawner pickup=hugeinvisiblepickup position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15" /><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
                 </attached>
             </MovableEntity>
@@ -79,5 +75,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -89,5 +85,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i+3,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -99,5 +95,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*5,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -109,5 +105,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*13+1,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -119,5 +115,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*17,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -130,5 +126,5 @@
       <attached>
         <Model position="0,0,0" scale=25 mesh="ast6.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
Index: code/trunk/data/levels/lastTeamStanding.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStanding.oxw	(revision 9347)
+++ code/trunk/data/levels/lastTeamStanding.oxw	(revision 9348)
@@ -18,5 +18,5 @@
  name         = "Last Team Standing"
  description  = "testmap for gametype last team standing"
- gametype     =  "TeamGametype"
+ gametype     =  "LastTeamStanding"
 >
   <templates>
@@ -27,7 +27,6 @@
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/skypanoramagen1"
+    skybox       = "Orxonox/skyBoxBasic"
   >
-  <?lua include("includes/notifications.oxi") ?>
 
     <?lua
@@ -48,9 +47,5 @@
     </StaticEntity>
 
-    <PickupSpawner position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
-      <pickup>
-        <InvisiblePickup template=hugeinvisiblepickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugeinvisiblepickup position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10" /><!--EasterEgg-->
     <StaticEntity position="-160,60,28.4"><!--EasterEgg-Indicator-->
       <attached>
@@ -74,5 +69,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -84,5 +79,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i+3,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -94,5 +89,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*5,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -104,5 +99,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*13+1,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -114,5 +109,5 @@
       <attached>
         <Model position="0,0,0" scale=15 mesh="ast<?lua print( math.mod(i*17,6) + 1) ?>.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
@@ -125,5 +120,5 @@
       <attached>
         <Model position="0,0,0" scale=25 mesh="ast6.mesh">
-	</Model>
+        </Model>
       </attached>
       <collisionShapes>
Index: code/trunk/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStandingII.oxw	(revision 9347)
+++ code/trunk/data/levels/lastTeamStandingII.oxw	(revision 9348)
@@ -25,5 +25,5 @@
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/skypanoramagen1"
+    skybox       = "Orxonox/skyBoxBasic"
   >
 <!-- TODO:
Index: code/trunk/data/levels/missionOne.oxw
===================================================================
--- code/trunk/data/levels/missionOne.oxw	(revision 9347)
+++ code/trunk/data/levels/missionOne.oxw	(revision 9348)
@@ -1153,9 +1153,5 @@
 
 <!-- @Objects: Pickup - find better place !! -->
-    <PickupSpawner position="-48650,700,100" triggerDistance="70" respawnTime="30" maxSpawnedItems="1">
-      <pickup>
-        <ShieldPickup template=hugeshieldpickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugeshieldpickup position="-48650,700,100" triggerDistance="70" respawnTime="30" maxSpawnedItems="1" />
 
 
Index: code/trunk/data/levels/notifications.oxw
===================================================================
--- code/trunk/data/levels/notifications.oxw	(revision 9347)
+++ code/trunk/data/levels/notifications.oxw	(revision 9348)
@@ -21,5 +21,5 @@
     <Scene
         ambientlight = "0.5, 0.5, 0.5"
-        skybox       = "Orxonox/skypanoramagen1"
+        skybox       = "Orxonox/skyBoxBasic"
     >
 
Index: code/trunk/data/levels/old/CuboidSpaceStation.oxw
===================================================================
--- code/trunk/data/levels/old/CuboidSpaceStation.oxw	(revision 9347)
+++ code/trunk/data/levels/old/CuboidSpaceStation.oxw	(revision 9348)
@@ -1,18 +1,18 @@
 <?lua
-	include("HUDTemplates3.oxo")
+    include("HUDTemplates3.oxo")
 ?>
 
 <?lua
-	include("templates/spaceshipAssff.oxt")
+    include("templates/spaceshipAssff.oxt")
 ?>
 
 <Level
-	name = "SpaceStation test Space!"
-	description = "All the new SpaceStations are created here!"
+    name = "SpaceStation test Space!"
+    description = "All the new SpaceStations are created here!"
 >
-	<Scene
-		ambientlight = "0.5, 0.5, 0.5"
-		skybox = "Orxonox/Starbox"
-	>
+    <Scene
+        ambientlight = "0.5, 0.5, 0.5"
+        skybox = "Orxonox/Starbox"
+    >
 
 
@@ -20,5 +20,5 @@
 <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
 <?lua
-	dofile("includes/CuboidSpaceStation.lua")
+    dofile("includes/CuboidSpaceStation.lua")
 ?>
 
@@ -29,5 +29,5 @@
 --->
 <?lua
-	createSpaceStation()
+    createSpaceStation()
 ?>
 
@@ -37,9 +37,9 @@
 --->
 <PositionableEntity scale=1 position="0,0,-5000">
-	<attached>
-		<?lua
-			createSpaceStation()
-		?>
-	</attached>
+    <attached>
+        <?lua
+            createSpaceStation()
+        ?>
+    </attached>
 </PositionableEntity>
 
@@ -49,9 +49,9 @@
 --->
 <MovableEntity scale=1 position="5000,0,0" velocity="50,0,0" yaw=-90>
-	<attached>
-		<?lua
-			createSpaceStation()
-		?>
-	</attached>
+    <attached>
+        <?lua
+            createSpaceStation()
+        ?>
+    </attached>
 </MovableEntity>
 
@@ -61,9 +61,9 @@
 --->
 <MovableEntity scale=1 position="-5000,0,0" rotationaxis="0,1,0" rotationrate=5>
-	<attached>
-		<?lua
-			createSpaceStation()
-		?>
-	</attached>
+    <attached>
+        <?lua
+            createSpaceStation()
+        ?>
+    </attached>
 </MovableEntity>
 
@@ -77,14 +77,14 @@
 --->
 <MovableEntity scale=1 position="0,0,0" rotationaxis="0,1,0" rotationrate=3>
-	<attached>
-		<MovableEntity scale=1 position="10000,0,0" rotationaxis="0,0,1" rotationrate=2>
-			<attached>
-				<?lua
-					-- Here I use the createSpaceStationPar(...) function, which has 8 arguments, see the .lua file at the top to understand them.
-					createSpaceStationPar(0,2,1,2,1,2,1,50)
-				?>
-			</attached>
-		</MovableEntity>
-	</attached>
+    <attached>
+        <MovableEntity scale=1 position="10000,0,0" rotationaxis="0,0,1" rotationrate=2>
+            <attached>
+                <?lua
+                    -- Here I use the createSpaceStationPar(...) function, which has 8 arguments, see the .lua file at the top to understand them.
+                    createSpaceStationPar(0,2,1,2,1,2,1,50)
+                ?>
+            </attached>
+        </MovableEntity>
+    </attached>
 </MovableEntity>
 
@@ -95,5 +95,5 @@
 
 
-	<ParticleSpawner position="0,0,0" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
+    <ParticleSpawner position="0,0,0" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
       <events>
         <spawn>
Index: code/trunk/data/levels/old/presentationPhysics.oxw
===================================================================
--- code/trunk/data/levels/old/presentationPhysics.oxw	(revision 9347)
+++ code/trunk/data/levels/old/presentationPhysics.oxw	(revision 9348)
@@ -12,5 +12,5 @@
   <Scene
    ambientlight = "0.8, 0.8, 0.8"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
    gravity      = "0, -10, 0"
   >
Index: code/trunk/data/levels/old/princessAeryn.oxw
===================================================================
--- code/trunk/data/levels/old/princessAeryn.oxw	(revision 9347)
+++ code/trunk/data/levels/old/princessAeryn.oxw	(revision 9348)
@@ -15,5 +15,5 @@
     <Scene
         ambientlight = "0.3, 0.3, 0.3"
-        skybox       = "Orxonox/skypanoramagen1"
+        skybox       = "Orxonox/skyBoxBasic"
     >
 
Index: code/trunk/data/levels/pickups.oxw
===================================================================
--- code/trunk/data/levels/pickups.oxw	(revision 9347)
+++ code/trunk/data/levels/pickups.oxw	(revision 9348)
@@ -37,135 +37,64 @@
     <!-- Shield pickups -->
 
-    <PickupSpawner position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <ShieldPickup template=smallshieldpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="0,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <ShieldPickup template=mediumshieldpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <ShieldPickup template=hugeshieldpickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smallshieldpickup position="-25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=mediumshieldpickup position="0,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=hugeshieldpickup position="25,-25,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- Health pickups -->
 
-    <PickupSpawner position="-25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <HealthPickup template=smallhealthpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="0,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <HealthPickup template=mediumhealthpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <HealthPickup template=hugehealthpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <HealthPickup template=crazyhealthpickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smallhealthpickup position="-25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    <PickupSpawner pickup=mediumhealthpickup position="0,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    <PickupSpawner pickup=hugehealthpickup position="25,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    <PickupSpawner pickup=crazyhealthpickup position="50,0,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
 
     <!-- Speed pickups -->
 
-    <PickupSpawner position="-25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=smallspeedpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="0,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=mediumspeedpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=hugespeedpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="50,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=smalljumppickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smallspeedpickup position="-25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+    <PickupSpawner pickup=mediumspeedpickup position="0,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+    <PickupSpawner pickup=hugespeedpickup position="25,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+    <PickupSpawner pickup=smalljumppickup position="50,25,-125" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
 
     <!-- Invisible pickups -->
 
-    <PickupSpawner position="-25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <InvisiblePickup template=smallinvisiblepickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="0,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <InvisiblePickup template=mediuminvisiblepickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <InvisiblePickup template=hugeinvisiblepickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smallinvisiblepickup position="-25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=mediuminvisiblepickup position="0,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=hugeinvisiblepickup position="25,50,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- Meta pickups -->
 
-    <PickupSpawner position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <MetaPickup metaType="use" />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <MetaPickup metaType="drop" />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <MetaPickup metaType="destroy" />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <MetaPickup metaType="destroyCarrier" />
-      </pickup>
-    </PickupSpawner>
+    <Template name=usemetapickup baseclass=MetaPickup>
+      <MetaPickup representation="use" metaType="use" />
+    </Template>
+    
+    <Template name=dropmetapickup baseclass=MetaPickup>
+      <MetaPickup representation="drop" metaType="drop" />
+    </Template>
+    
+    <Template name=destroymetapickup baseclass=MetaPickup>
+      <MetaPickup metaType="destroy" />
+    </Template>
+    
+    <Template name=destroycarriermetapickup baseclass=MetaPickup>
+      <MetaPickup metaType="destroyCarrier" />
+    </Template>
+    
+    <PickupSpawner pickup=usemetapickup position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=dropmetapickup position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=destroymetapickup position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=destroycarriermetapickup position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- Pickup Collection pickups -->
 
-    <PickupSpawner position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <PickupCollection template=triplehealthspeedinvisibilitypickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=triplehealthspeedinvisibilitypickup position="-50,25,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
     
     <!-- Drone pickup -->
     
-    <PickupSpawner position="-50,50,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <DronePickup template=dronepickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=dronepickup position="-50,50,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    
+    <!-- DamageBoost pickup -->
+    
+    <PickupSpawner pickup=smalldamageboostpickup position="-50,75,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    <PickupSpawner pickup=mediumdamageboostpickup position="-50,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+    <PickupSpawner pickup=largedamageboostpickup position="-50,125,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
     
     <!-- Other pickups -->
@@ -173,37 +102,77 @@
     <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     <PickupRepresentation
+      name = "MediumHealth"
       pickupName = "Medium Health Pack"
       pickupDescription = "Once used adds a medium amout of health to the ship."
       spawnerTemplate = "mediumhealthpickupRepresentation"
       inventoryRepresentation = "MediumHealth"
-    >
-      <pickup>
-        <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
-      </pickup>
-    </PickupRepresentation>
+    />
 
-    <PickupSpawner position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
-      </pickup>
-    </PickupSpawner>
+    <Template name=continuoushealthpickup baseclass=HealthPickup>
+      <HealthPickup representation="MediumHealth" health=500 activationType=immediate healthRate=10 durationType=continuous />
+    </Template>
+    
+    <PickupSpawner pickup=continuoushealthpickup position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
 
-    <PickupSpawner position="-25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <ShrinkPickup template ="smallshrinkpickup"/>
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup="smallshrinkpickup" position="-25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+    <PickupSpawner pickup="mediumshrinkpickup" position="0,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+    <PickupSpawner pickup="hugeshrinkpickup" position="25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+    
+    <!-- @Objects: 4 boxes (uncontrolled pawns) -->
+    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
 
-    <PickupSpawner position="0,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <ShrinkPickup template ="mediumshrinkpickup"/>
-      </pickup>
-    </PickupSpawner>
+    <Pawn team=1 health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
 
-    <PickupSpawner position="25,-50,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <ShrinkPickup template ="hugeshrinkpickup"/>
-      </pickup>
-    </PickupSpawner>
+    <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+           <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
+
+    <Pawn health=30 position="0,400,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+           <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
 
     <!--StaticEntity position="0,-200,0" direction="0,-1,0" collisionType=static mass=500 friction=0.01 >
Index: code/trunk/data/levels/pirateAttack.oxw
===================================================================
--- code/trunk/data/levels/pirateAttack.oxw	(revision 9347)
+++ code/trunk/data/levels/pirateAttack.oxw	(revision 9348)
@@ -39,5 +39,5 @@
     <Scene
         ambientlight = "0.3, 0.3, 0.3"
-        skybox       = "Orxonox/skypanoramagen1"
+        skybox       = "Orxonox/skyBoxBasic"
     >
 
Index: code/trunk/data/levels/planets.oxw
===================================================================
--- code/trunk/data/levels/planets.oxw	(revision 9347)
+++ code/trunk/data/levels/planets.oxw	(revision 9348)
@@ -21,5 +21,5 @@
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/skypanoramagen1"
+    skybox       = "Orxonox/skyBoxBasic"
   >
 
Index: code/trunk/data/levels/pong.oxw
===================================================================
--- code/trunk/data/levels/pong.oxw	(revision 9347)
+++ code/trunk/data/levels/pong.oxw	(revision 9348)
@@ -57,11 +57,10 @@
   <?lua include("includes/notifications.oxi") ?>
 
-  <WorldAmbientSound source="Ganymede.ogg" playOnLoad=true looping=true />
-
+  <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
   <PongBot />
 
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
@@ -92,5 +91,7 @@
             <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
 
-            <WorldSound name="scoreSound" position="0,0,0" source="sounds/pong_score.wav" >
+<!-- TODO: Create a Pong Score Sound and include it here.
+This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
+            <!--WorldSound name="scoreSound" position="0,0,0" source="ambient/default/Earth.ogg" >
               <events>
                 <play>
@@ -98,5 +99,5 @@
                 </play>
               </events>
-            </WorldSound>
+            </WorldSound-->
 
             <?lua
Index: code/trunk/data/levels/portals.oxw
===================================================================
--- code/trunk/data/levels/portals.oxw	(revision 9347)
+++ code/trunk/data/levels/portals.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
 
@@ -29,5 +29,5 @@
         <PortalEndPoint>
             <attached>
-                <Billboard material="Portals/Default" />
+                <Model mesh="Spacegate.mesh" yaw="90"/>
             </attached>
         </PortalEndPoint>
@@ -39,9 +39,5 @@
     <PortalLink fromID="2" toID="1" />
 
-    <!--PickupSpawner position="-200,0,0" triggerDistance="10" respawnTime="10" maxSpawnedItems="10">
-      <pickup>
-        <DronePickup template=dronepickup />
-      </pickup>
-    </PickupSpawner-->
+    <!--PickupSpawner pickup=dronepickup position="-200,0,0" triggerDistance="10" respawnTime="10" maxSpawnedItems="10" /-->
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/presentation09.oxw
===================================================================
--- code/trunk/data/levels/presentation09.oxw	(revision 9347)
+++ code/trunk/data/levels/presentation09.oxw	(revision 9348)
@@ -22,5 +22,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
   
Index: code/trunk/data/levels/presentation09b.oxw
===================================================================
--- code/trunk/data/levels/presentation09b.oxw	(revision 9347)
+++ code/trunk/data/levels/presentation09b.oxw	(revision 9348)
@@ -26,5 +26,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen2"
+   skybox       = "Orxonox/skyBoxSomeNebula"
   >
 
@@ -94,33 +94,22 @@
     </SpaceShip>
 
-    <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <SpeedPickup template=smalljumppickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smalljumppickup position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
 
     <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     <PickupRepresentation
+      name = "MediumHealth"
       pickupName = "Medium Health Pack"
       pickupDescription = "Once used adds a medium amout of health to the ship."
       spawnerTemplate = "mediumhealthpickupRepresentation"
       inventoryRepresentation = "MediumHealth"
-    >
-      <pickup>
-        <HealthPickup health=100 activationType="onUse" durationType="once" />
-      </pickup>
-    </PickupRepresentation>
-
-    <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <HealthPickup health=100 activationType=onUse durationType=once />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
-      <pickup>
-        <HealthPickup template=mediumhealthpickup />
-      </pickup>
-    </PickupSpawner>
+    />
+
+    <Template name=onusehealthpickup baseclass=HealthPickup>
+      <HealthPickup representation="MediumHealth" health=100 activationType=onUse durationType=once />
+    </Template>
+
+    <PickupSpawner pickup=onusehealthpickup position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+
+    <PickupSpawner pickup=mediumhealthpickup position="2300, 4300, 2400" respawnTime="5" triggerDistance="20" />
 
     <Billboard position="-2500, 2400, 1500" material="Examples/Flare" />
Index: code/trunk/data/levels/presentationDM.oxw
===================================================================
--- code/trunk/data/levels/presentationDM.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationDM.oxw	(revision 9348)
@@ -24,5 +24,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/presentationFS10.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationFS10.oxw	(revision 9348)
@@ -102,65 +102,37 @@
     <?lua end ?>
 
-    <PickupSpawner position="500,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <DronePickup template=dronepickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=dronepickup position="500,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- Shield pickups -->
 
-    <PickupSpawner position="-25,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <ShieldPickup template=hugeshieldpickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugeshieldpickup position="-25,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- Health pickups -->
 
-    <PickupSpawner position="0,-75,-500" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
-      <pickup>
-        <HealthPickup template=hugehealthpickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugehealthpickup position="0,-75,-500" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
 
     <!-- Speed pickups -->
 
-    <PickupSpawner position="25,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=hugespeedpickup />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="50,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99">
-      <pickup>
-        <SpeedPickup template=smalljumppickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugespeedpickup position="25,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
+    <PickupSpawner pickup=smalljumppickup position="50,-50,-500" triggerDistance="10" respawnTime="10" maxSpawnedItems="99" />
 
     <!-- Invisible pickups -->
 
-    <PickupSpawner position="0,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
-      <pickup>
-        <InvisiblePickup template=hugeinvisiblepickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=hugeinvisiblepickup position="0,-50,-500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
 
     <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     <PickupRepresentation
+      name = "MediumHealth"
       pickupName = "Medium Health Pack"
       pickupDescription = "Once used adds a medium amout of health to the ship."
       spawnerTemplate = "mediumhealthpickupRepresentation"
       inventoryRepresentation = "MediumHealth"
-    >
-      <pickup>
-        <HealthPickup health=50 activationType="onUse" durationType="once" />
-      </pickup>
-    </PickupRepresentation>
+    />
 
-    <PickupSpawner position="25,-75,-500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <HealthPickup health=50 activationType=onUse durationType=once />
-      </pickup>
-    </PickupSpawner>
+    <Template name=onusehealthpickup baseclass=HealthPickup>
+      <HealthPickup representation="MediumHealth" health=50 activationType=onUse durationType=once />
+    </Template>
+
+    <PickupSpawner pickup=onusehealthpickup position="25,-75,-500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
 
   </Scene>
Index: code/trunk/data/levels/presentationFS102.oxw
===================================================================
--- code/trunk/data/levels/presentationFS102.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationFS102.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.1, 0.1, 0.1"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
    gravity      = "0,-1000,0"
    negativeWorldRange = "-100000, -100000, -100000"
Index: code/trunk/data/levels/presentationFS10Ed.oxw
===================================================================
--- code/trunk/data/levels/presentationFS10Ed.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationFS10Ed.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.1, 0.1, 0.1"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
    gravity      = "0,-1000,0"
    negativeWorldRange = "-100000, -100000, -100000"
@@ -39,5 +39,5 @@
       </collisionShapes>
   </Pawn>
- 
+
   <Pawn health=100 position="0,-35,0" direction="0,-1,0" collisionType=dynamic mass=100000>
       <attached>
@@ -48,5 +48,5 @@
       </collisionShapes>
   </Pawn>
- 
+
   <StaticEntity position="0,-50,0" direction="0,-1,0" collisionType=static mass=100000 >
       <attached>
@@ -66,5 +66,5 @@
       </collisionShapes>
   </StaticEntity>
- 
+
    <StaticEntity position="600,-20,0" direction="0,-1,0" collisionType=static mass=100000 >
       <attached>
@@ -84,5 +84,5 @@
       </collisionShapes>
   </StaticEntity>
- 
+
   <StaticEntity position="600,40,250" direction="0,-1,0" collisionType=static mass=100000 >
       <attached>
@@ -93,6 +93,6 @@
       </collisionShapes>
   </StaticEntity>
- 
- 
+
+
    <StaticEntity position="6000,0,10250" direction="0,0,0" collisionType=static mass=100000 >
       <attached>
@@ -103,5 +103,5 @@
       </collisionShapes>
   </StaticEntity>
-  
+
   <Pawn health=100 position="530,70,1450" direction="-1,0,0" collisionType=dynamic mass=1 >
       <attached>
@@ -112,5 +112,5 @@
       </collisionShapes>
   </Pawn>
-  
+
   <Pawn health=100 position="670,70,1450" direction="-1,0,0" collisionType=dynamic mass=1 >
       <attached>
@@ -121,5 +121,5 @@
       </collisionShapes>
   </Pawn>
-  
+
    <Pawn health=100 position="600,70,1500" direction="0,0,-1" collisionType=dynamic mass=1 >
       <attached>
@@ -130,5 +130,5 @@
       </collisionShapes>
   </Pawn>
-  
+
    <Pawn health=100 position="600,150,1450" direction="0,-1,0" collisionType=dynamic mass=1 >
       <attached>
@@ -139,5 +139,5 @@
       </collisionShapes>
   </Pawn>
-  
+
   <Pawn health=100 position="600,35,1450" direction="0,-1,0" collisionType=dynamic mass=1 >
       <attached>
@@ -148,5 +148,5 @@
       </collisionShapes>
   </Pawn>
- 
+
 
   <SpawnPoint position="0,300,0" direction="0, 0, 0" lookat="0,0,100000000" spawnclass=FpsPlayer pawndesign=fps />
@@ -163,8 +163,8 @@
       <attached>
         <Model position="0,0,0" scale3D="<?lua print(j*100) ?>,<?lua print(g*100) ?>,<?lua print(h*100) ?>" mesh="cube<?lua
-	if math.mod(i,4)==0 then print('_green') end
-	if math.mod(i,4)==1 then print('_red') end
-	if math.mod(i,4)==2 then print('_orange') end
-	?>.mesh" /> <!--if it's 3, cube.mesh is taken -> yellow -->
+        if math.mod(i,4)==0 then print('_green') end
+        if math.mod(i,4)==1 then print('_red') end
+        if math.mod(i,4)==2 then print('_orange') end
+        ?>.mesh" /> <!--if it's 3, cube.mesh is taken -> yellow -->
       </attached>
       <collisionShapes>
Index: code/trunk/data/levels/presentationFS11.oxw
===================================================================
--- code/trunk/data/levels/presentationFS11.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationFS11.oxw	(revision 9348)
@@ -422,8 +422,5 @@
     </SimpleNotification>
 
-    <PickupSpawner position="-72487,420,-63" respawnTime="10" triggerDistance="20" maxSpawnedItems="5" active="false">
-      <pickup>
-        <ShrinkPickup template ="smallshrinkpickup"/>
-      </pickup>
+    <PickupSpawner pickup="smallshrinkpickup" position="-72487,420,-63" respawnTime="10" triggerDistance="20" maxSpawnedItems="5" active="false">
       <events>
         <activity>
Index: code/trunk/data/levels/presentationHS09.oxw
===================================================================
--- code/trunk/data/levels/presentationHS09.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationHS09.oxw	(revision 9348)
@@ -27,5 +27,5 @@
   <Scene
    ambientlight = "0.6, 0.4, 0.4"
-   skybox       = "Orxonox/skypanoramagen2"
+   skybox       = "Orxonox/skyBoxSomeNebula"
   >
 
@@ -97,33 +97,22 @@
     <Billboard material="Test/Fog" position="-3800, 2500, 1500" alpha="0.1" color="1, 1, 1, 0.1" scale="0.5" />
 
-    <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <SpeedPickup template=smalljumppickup />
-      </pickup>
-    </PickupSpawner>
+    <PickupSpawner pickup=smalljumppickup position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
 
     <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     <PickupRepresentation
+      name = "MediumHealth"
       pickupName = "Medium Health Pack"
       pickupDescription = "Once used adds a medium amout of health to the ship."
       spawnerTemplate = "mediumhealthpickupRepresentation"
       inventoryRepresentation = "MediumHealth"
-    >
-      <pickup>
-        <HealthPickup health=100 activationType="onUse" durationType="once" />
-      </pickup>
-    </PickupRepresentation>
-
-    <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
-      <pickup>
-        <HealthPickup health=100 activationType=onUse durationType=once />
-      </pickup>
-    </PickupSpawner>
-
-    <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
-      <pickup>
-        <HealthPickup template=mediumhealthpickup />
-      </pickup>
-    </PickupSpawner>
+    />
+
+    <Template name=onusehealthpickup baseclass=HealthPickup>
+      <HealthPickup representation="MediumHealth" health=100 activationType=onUse durationType=once />
+    </Template>
+
+    <PickupSpawner pickup=onusehealthpickup position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5" />
+
+    <PickupSpawner pickup=mediumhealthpickup position="2300, 4300, 2400" respawnTime="5" triggerDistance="20" />
 
     <Billboard position="-2500, 2400, 1500" material="Examples/Flare" />
Index: code/trunk/data/levels/presentationHS11.oxw
===================================================================
--- code/trunk/data/levels/presentationHS11.oxw	(revision 9347)
+++ code/trunk/data/levels/presentationHS11.oxw	(revision 9348)
@@ -1,5 +1,8 @@
+<!--  -->
+
+
 <LevelInfo
  name = "Presentation HS 2011"
- description = "Oxonox Proudly Presents New Features From HS 2011"
+ description = "New Features: Asteroid field/belt generator; Formationflight; HUD (Enemyhealthbar, displaying Names)"
  tags = "presentation"
 />
@@ -79,4 +82,6 @@
         </events>
     </SimpleNotification>
+
+
 
 
@@ -131,15 +136,103 @@
 <?lua end ?>
 
-
-
-
-
-
+<!-- @Triggers: "hintX" <->  delayed LetsGo -->
+    <EventTrigger name="hint1" activations="1" stayactive="true" delay=4.2>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint2" activations="1" stayactive="true" delay=8.4>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint3" activations="1" stayactive="true" delay=12.6>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint4" activations="1" stayactive="true" delay=16.8>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint5" activations="1" stayactive="true" delay=21>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+    <EventTrigger name="hint6" activations="1" stayactive="true" delay=25.2>
+      <events>
+        <trigger>
+          <EventListener event="LetsGo" />
+        </trigger>
+      </events>
+    </EventTrigger>
+
+
+
+    <SimpleNotification message="Make bots follow you: Press (1)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint1 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Toggle group behaviour: Press (1)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint2 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Tell the bots to defend you: Press (2)"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint3 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Make them attack opponents: Press (2) again"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint4 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Let the bots behave 'normal': Press (2) again"  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint5 />
+            </trigger>
+        </events>
+    </SimpleNotification>
+
+    <SimpleNotification message="Have a look at the console to verify this."  broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event=hint6 />
+            </trigger>
+        </events>
+    </SimpleNotification>
 
 <!-- Generate asteroid field and asteroid belt -->
-<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) --> 
+<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
     <?lua
-    	dofile("includes/asteroidField.lua")
-    	asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1)
 
     ?>
Index: code/trunk/data/levels/princessAeryn.oxw
===================================================================
--- code/trunk/data/levels/princessAeryn.oxw	(revision 9347)
+++ code/trunk/data/levels/princessAeryn.oxw	(revision 9348)
@@ -26,5 +26,5 @@
   <Scene
     ambientlight = "0.3, 0.3, 0.3"
-    skybox     = "Orxonox/skypanoramagen1"
+    skybox     = "Orxonox/skyBoxBasic"
   >
 
Index: code/trunk/data/levels/screenshot.oxw
===================================================================
--- code/trunk/data/levels/screenshot.oxw	(revision 9347)
+++ code/trunk/data/levels/screenshot.oxw	(revision 9348)
@@ -25,5 +25,5 @@
   <Scene
    ambientlight = "0.7, 0.6, 0.6"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <!--Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" /-->
Index: code/trunk/data/levels/surfaceRace.oxw
===================================================================
--- code/trunk/data/levels/surfaceRace.oxw	(revision 9348)
+++ code/trunk/data/levels/surfaceRace.oxw	(revision 9348)
@@ -0,0 +1,450 @@
+<!-- 
+TODO:
+    Replace bottom's texture. It just does not look good.
+-->
+
+<LevelInfo
+ name = "Surface Race"
+ description = "Race on a planet's surface. Try to reach the goal in 70 Seconds."
+ screenshot = "surfaceRace.png"
+ tags = "gametype"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/spaceshipRace.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+
+<Level
+  gametype = SpaceRace
+>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "2.0, 2.0, 2.0"
+    skybox       = "Orxonox/skyBoxClouds"
+    gravity      = "0,-75,0"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+    hasPhysics   = true
+  >
+
+    <?lua
+      include("includes/pickups.oxi")
+    ?>
+
+  <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+
+
+<SpaceRaceManager>
+ <checkpoints>
+    <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+
+<!--
+        <Model position="0,0,55" mesh="testcube.mesh" scale3D="110,20,20" />
+        <Model position="0,0,-55" mesh="testcube.mesh" scale3D="110,20,20" />
+        <Model position="55,0,0" mesh="testcube.mesh" scale3D="20,20,110" />
+        <Model position="-55,0,0" mesh="testcube.mesh" scale3D="20,20,110" />
+
+-->
+
+
+        </attached>
+
+
+
+    <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+
+
+
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+
+
+           <collisionShapes>
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+         <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+            <BoxCollisionShape position="0,0,220"     halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="0,0,-220"      halfExtents="220, 40, 40" />
+            <BoxCollisionShape position="220,0,0"      halfExtents="40, 40, 220" />
+            <BoxCollisionShape position="-220,0,0"       halfExtents="40, 40, 220" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=spaceshiprace />
+
+
+    <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90"  scale="4" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+    <!--
+                <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+        <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+        <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+    -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,320,2400"            halfExtents="360,72,2400" />
+        <BoxCollisionShape position="0,-320,2400"      halfExtents="360,72,2400" />
+        <BoxCollisionShape position="320,0,2400"            halfExtents="72,360,2400" />
+        <BoxCollisionShape position="-320,0,2400"     halfExtents="72,360,2400" />
+
+
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0"   scale="1" collisionType=static mass=100000 friction=0.01 >
+      <attached>
+    <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+                <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+        -->
+
+      </attached>
+
+
+    <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,0"            halfExtents="450,600,50" />
+
+        </collisionShapes>
+
+  </StaticEntity>
+
+
+
+
+    <!-- ------------------Boden----------------- -->
+  <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+     <attached>
+        <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+      </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+   <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+   <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60"  maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+    max = 15
+    for i = 0, max, 1
+    do
+    x=-12000
+    y=10000
+    z=-12000
+
+    ?>
+    <?lua
+    for k = 1, 15, 1
+    do
+    j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+      collisionType = "dynamic"
+      linearDamping = "0.5"
+      angularDamping = "0.5"
+      collisiondamage = "100"
+      enablecollisiondamage = "true"
+      scale="<?lua print(j * 5) ?>" >
+      <attached>
+        <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+      <?lua if k == 0 then ?><attached><!-- ---------asteroid fog----- -->
+            <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+          </attached> <?lua end ?>
+        </Model>
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+      </collisionShapes>
+    </MovableEntity>
+    <?lua
+    end
+    ?>
+    <?lua end ?>
+
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/teamBaseMatch.oxw
===================================================================
--- code/trunk/data/levels/teamBaseMatch.oxw	(revision 9347)
+++ code/trunk/data/levels/teamBaseMatch.oxw	(revision 9348)
@@ -26,5 +26,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/teamDeathMatch.oxw
===================================================================
--- code/trunk/data/levels/teamDeathMatch.oxw	(revision 9347)
+++ code/trunk/data/levels/teamDeathMatch.oxw	(revision 9348)
@@ -25,5 +25,5 @@
   <Scene
    ambientlight = "0.7, 0.6, 0.6"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/templates/FPS.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS.oxt	(revision 9347)
+++ code/trunk/data/levels/templates/FPS.oxt	(revision 9348)
@@ -17,6 +17,6 @@
    linearDamping     = 0.7
    angularDamping    = 0.9999999
-   friction	     = 0.01
-   
+   friction          = 0.01
+
    weapon            = "hs-w01.mesh"
   >
@@ -24,11 +24,11 @@
       <BoxCollisionShape position="0,-20,0" halfExtents="15,25,15" />
     </collisionShapes>
-    
+
     <camerapositions>
       <CameraPosition position="-1,1,2.2" drag=false mouselook=true />
     </camerapositions>
-    
+
     <?lua
-	include("../includes/weaponSettingsFPS.oxi")
+        include("../includes/weaponSettingsFPS.oxi")
     ?>
 
@@ -40,5 +40,5 @@
     <camerapositions>
       <CameraPosition position="0,0,20" drag=false mouselook=true />
-      
+
       <!--
       CameraPosition position="0,150,-25" pitch=-90 drag=true />
@@ -47,5 +47,5 @@
       <CameraPosition position="-50,5,-8" yaw=-90 drag=true />
       <CameraPosition position="50,5,-8" yaw=90 drag=true /
-      
+
     </camerapositions>
   </FpsPlayer>
Index: code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt
===================================================================
--- code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt	(revision 9347)
+++ code/trunk/data/levels/templates/pickupRepresentationTemplates.oxt	(revision 9348)
@@ -17,6 +17,7 @@
 </Template>
 
-<Template name=smallshieldpickup>
+<Template name=smallshieldpickup baseclass=ShieldPickup>
   <ShieldPickup
+    representation = "smallshieldpickup"
     duration = 10
     shieldabsorption = 0.7
@@ -43,6 +44,7 @@
 </Template>
 
-<Template name=mediumshieldpickup>
+<Template name=mediumshieldpickup baseclass=ShieldPickup>
   <ShieldPickup
+    representation = "mediumshieldpickup"
     duration = 30
     shieldabsorption = 0.8
@@ -70,6 +72,7 @@
 </Template>
 
-<Template name=hugeshieldpickup>
+<Template name=hugeshieldpickup baseclass=ShieldPickup>
   <ShieldPickup
+    representation = "hugeshieldpickup"
     duration = 60
     shieldabsorption = 0.95
@@ -98,6 +101,7 @@
 </Template>
 
-<Template name=smallhealthpickup>
+<Template name=smallhealthpickup baseclass=HealthPickup>
   <HealthPickup
+    representation = "smallhealthpickup"
     health = 10
     healthType = "limited"
@@ -123,6 +127,7 @@
 </Template>
 
-<Template name=mediumhealthpickup>
+<Template name=mediumhealthpickup baseclass=HealthPickup>
   <HealthPickup
+    representation = "mediumhealthpickup"
     health = 50
     healthType = "limited"
@@ -148,6 +153,7 @@
 </Template>
 
-<Template name=hugehealthpickup>
+<Template name=hugehealthpickup baseclass=HealthPickup>
   <HealthPickup
+    representation = "hugehealthpickup"
     health = 100
     healthType = "limited"
@@ -173,6 +179,7 @@
 </Template>
 
-<Template name=crazyhealthpickup>
+<Template name=crazyhealthpickup baseclass=HealthPickup>
   <HealthPickup
+    representation = "crazyhealthpickup"
     health = 1000
     healthType = "permanent"
@@ -216,4 +223,85 @@
 </Template>
 
+<!-- DamageBoost pickups -->
+
+<Template name=smalldamageboostpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+                        <attached>
+                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageSmall" scale=0.7 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=smalldamageboostpickup baseclass=DamageBoostPickup>
+  <DamageBoostPickup
+    representation = "smalldamageboostpickup"
+    duration = 10.0
+    damageMultiplier = 2.0
+    activationType = "immediate"
+    durationType = "continuous"
+  />
+</Template>
+
+<Template name=mediumdamageboostpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+                        <attached>
+                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageMedium" scale=0.7 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=mediumdamageboostpickup baseclass=DamageBoostPickup>
+  <DamageBoostPickup
+    representation = "mediumdamageboostpickup"
+    duration = 10.0
+    damageMultiplier = 5.0
+    activationType = "immediate"
+    durationType = "continuous"
+  />
+</Template>
+
+<Template name=largedamageboostpickupRepresentation>
+    <PickupRepresentation>
+        <spawner-representation>
+            <StaticEntity>
+                <attached>
+                    <Billboard position="0,0,0" colour="0.95,0.10,0.05" material="Sphere2" scale=0.1 >
+                        <attached>
+                            <Billboard position="0,0,0" colour="0.30,0.30,0.30" material="damageLarge" scale=0.7 />
+                        </attached>
+                    </Billboard>
+                </attached>
+            </StaticEntity>
+        </spawner-representation>
+    </PickupRepresentation>
+</Template>
+
+<Template name=largedamageboostpickup baseclass=DamageBoostPickup>
+  <DamageBoostPickup
+    representation = "largedamageboostpickup"
+    duration = 10.0
+    damageMultiplier = 7.0
+    activationType = "immediate"
+    durationType = "continuous"
+  />
+</Template>
+
+
 <!-- Speed pickups -->
 
@@ -234,6 +322,7 @@
 </Template>
 
-<Template name=smallspeedpickup>
+<Template name=smallspeedpickup baseclass=SpeedPickup>
   <SpeedPickup
+    representation = "smallspeedpickup"
     duration = 10.0
     speedAdd = 0.0
@@ -260,6 +349,7 @@
 </Template>
 
-<Template name=mediumspeedpickup>
+<Template name=mediumspeedpickup baseclass=SpeedPickup>
   <SpeedPickup
+    representation = "mediumspeedpickup"
     duration = 10.0
     speedAdd = 0.0
@@ -286,6 +376,7 @@
 </Template>
 
-<Template name=hugespeedpickup>
+<Template name=hugespeedpickup baseclass=SpeedPickup>
   <SpeedPickup
+    representation = "hugespeedpickup"
     duration = 10.0
     speedAdd = 0.0
@@ -312,6 +403,7 @@
 </Template>
 
-<Template name=smalljumppickup>
+<Template name=smalljumppickup baseclass=SpeedPickup>
   <SpeedPickup
+    representation = "smalljumppickup"
     duration = 0.7
     speedAdd = 5000.0
@@ -340,6 +432,7 @@
 </Template>
 
-<Template name=smallinvisiblepickup>
+<Template name=smallinvisiblepickup baseclass=InvisiblePickup>
   <InvisiblePickup 
+    representation = "smallinvisiblepickup"
     duration = 5.0
     activaionType = "immediate"
@@ -364,6 +457,7 @@
 </Template>
 
-<Template name=mediuminvisiblepickup>
+<Template name=mediuminvisiblepickup baseclass=InvisiblePickup>
   <InvisiblePickup 
+    representation = "mediuminvisiblepickup"
     duration = 10.0
     activaionType = "immediate"
@@ -388,6 +482,7 @@
 </Template>
 
-<Template name=hugeinvisiblepickup>
+<Template name=hugeinvisiblepickup baseclass=InvisiblePickup>
   <InvisiblePickup 
+    representation = "hugeinvisiblepickup"
     duration = 20.0
     activaionType = "immediate"
@@ -412,6 +507,7 @@
 </Template>
 
-<Template name=smallshrinkpickup>
-  <InvisiblePickup 
+<Template name=smallshrinkpickup baseclass=ShrinkPickup>
+  <ShrinkPickup 
+    representation = "smallshrinkpickup"
     duration = 10.0
     shrinkFactor = 2.5
@@ -437,6 +533,7 @@
 </Template>
 
-<Template name=mediumshrinkpickup>
-  <InvisiblePickup 
+<Template name=mediumshrinkpickup baseclass=ShrinkPickup>
+  <ShrinkPickup 
+    representation = "mediumshrinkpickup"
     duration = 30.0
     shrinkFactor = 5.0
@@ -462,6 +559,7 @@
 </Template>
 
-<Template name=hugeshrinkpickup>
-  <InvisiblePickup 
+<Template name=hugeshrinkpickup baseclass=ShrinkPickup>
+  <ShrinkPickup 
+    representation = "hugeshrinkpickup"
     duration = 60.0
     shrinkFactor = 10.0
@@ -491,6 +589,8 @@
 </Template>
 
-<Template name=triplehealthspeedinvisibilitypickup>
-    <PickupCollection>
+<Template name=triplehealthspeedinvisibilitypickup baseclass=PickupCollection>
+    <PickupCollection
+        representation = "triplehealthspeedinvisibilitypickup"
+    >
         <pickupables>
             <HealthPickup template=mediumhealthpickup />
@@ -551,6 +651,6 @@
 </Template>
 
-<Template name=dronepickup>
-    <DronePickup droneTemplate=droneTemplate />
-</Template>
-
+<Template name=dronepickup baseclass=DronePickup>
+    <DronePickup representation=dronepickup droneTemplate=droneTemplate />
+</Template>
+
Index: code/trunk/data/levels/templates/spaceshipRace.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipRace.oxt	(revision 9348)
+++ code/trunk/data/levels/templates/spaceshipRace.oxt	(revision 9348)
@@ -0,0 +1,119 @@
+<Template name=spaceshiprace>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+    </attached>
+    <collisionShapes>
+
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+
+    </collisionShapes>
+<?lua
+  include("../includes/weaponSettingsAssff.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipassffcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,10, 40" drag=true mouselook=true />
+      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2
+
+   speedfront     = 2500
+   speedback      =  50
+   speedleftright =  50
+   speedupdown    =  50
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 500
+   accelerationbrake     = 500
+   accelerationback      =  125
+   accelerationleftright =  125
+   accelerationupdown    =  125
+  >
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+    </EffectContainer>
+    <EffectContainer condition="not idle">
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+    <EffectContainer condition="normal or brake">
+
+    </EffectContainer>
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+<!--    <EffectContainer condition="brake">
+      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+-->
+  </MultiStateEngine>
+</Template>
Index: code/trunk/data/levels/templates/tower.oxt
===================================================================
--- code/trunk/data/levels/templates/tower.oxt	(revision 9348)
+++ code/trunk/data/levels/templates/tower.oxt	(revision 9348)
@@ -0,0 +1,37 @@
+<Template name=tower>
+  <Tower
+
+
+   explosionchunks        = 6
+
+   reloadrate          = 3
+   reloadwaittime      = 1
+
+   collisionType     = "dynamic"
+   team = 2
+
+
+  >
+    <controller>
+        <WaypointPatrolController alertnessradius=1000 team=5>
+            <waypoints>
+                <Model mesh="cube.mesh" scale=0 position=" 700, 200, 100" />
+            </waypoints>
+        </WaypointPatrolController>
+    </controller>
+
+
+    <attached>
+        <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
+    </attached>
+
+    <!--collisionShapes>
+
+    </collisionShapes-->
+
+<?lua
+  include("../includes/towerWeaponSettings.oxi")
+?>
+  </Tower>
+</Template>
+
Index: code/trunk/data/levels/testStars.oxw
===================================================================
--- code/trunk/data/levels/testStars.oxw	(revision 9347)
+++ code/trunk/data/levels/testStars.oxw	(revision 9348)
@@ -30,14 +30,14 @@
       <attached>
         <Model pitch=180 position="0,0,0" scale=1.5 mesh="rocket_test.mesh" >
-	  <attached>
-           <ParticleEmitter pitch=0 roll=0 position="0,5,0" source="Orxonox/laser" lifetime=2.0 loop=1 startdelay=3.0/>
-           <ParticleEmitter pitch=-90 roll=0 position="0,-5,0" source="Orxonox/particlecanon" lifetime=2.0 loop=1 startdelay=3.0/>
-           <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/rocketfire" lifetime=2.0 loop=1 startdelay=3.0 />
-	   <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/smoke" lifetime=2.0 loop=1 startdelay=3.0 />
+          <attached>
+            <ParticleEmitter pitch=0 roll=0 position="0,5,0" source="Orxonox/laser" lifetime=2.0 loop=1 startdelay=3.0/>
+            <ParticleEmitter pitch=-90 roll=0 position="0,-5,0" source="Orxonox/particlecanon" lifetime=2.0 loop=1 startdelay=3.0/>
+            <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/rocketfire" lifetime=2.0 loop=1 startdelay=3.0 />
+            <ParticleEmitter pitch=-90 roll=0 position="0,0,-2" source="Orxonox/smoke" lifetime=2.0 loop=1 startdelay=3.0 />
           </attached>
-	  </Model>
-	</attached>
+        </Model>
+      </attached>
     </Rocket-->
-    
+
     <CreateStars numStars="6000" material="Examples/Flare" colour="1,1,1" radius=10000 colourDiff=0.1/>
 
Index: code/trunk/data/levels/testSwallow.oxw
===================================================================
--- code/trunk/data/levels/testSwallow.oxw	(revision 9347)
+++ code/trunk/data/levels/testSwallow.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/tetris.oxw
===================================================================
--- code/trunk/data/levels/tetris.oxw	(revision 9347)
+++ code/trunk/data/levels/tetris.oxw	(revision 9348)
@@ -9,5 +9,12 @@
   include("HUDTemplates3.oxo")
   include("stats.oxo")
+  include("tetrisHUD.oxo")
   include("templates/lodInformation.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipGhost.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipSwallow.oxt")
+  include("templates/spaceshipTransporter.oxt")
+  include("templates/spaceshipH2.oxt")
 ?>
 
@@ -16,6 +23,4 @@
     <camerapositions>
       <CameraPosition position="55,75,200" absolute=true />
-      <CameraPosition position="0,50,160" drag=true mouselook=true />
-      <CameraPosition position="0,50,0" pitch=-90 drag=true mouselook=true />
     </camerapositions>
   </TetrisStone>
@@ -25,8 +30,26 @@
   <TetrisStone camerapositiontemplate=tetrisstonecameras>
     <attached>
-      <Model position="0,0,0" mesh="crate.mesh" scale=1 />
+      <Model position="0,0,0" mesh="crate.mesh" scale=0.9 />
     </attached>
   </TetrisStone>
 </Template>
+
+
+
+<Template name=tetrisbrickcameras defaults=0>
+  <TetrisBrick>
+    <camerapositions>
+      <CameraPosition position="55,75,200" absolute=true />
+      <!--CameraPosition position="0,50,160" drag=true mouselook=true />
+      <CameraPosition position="0,50,0" pitch=-90 drag=true mouselook=true /-->
+    </camerapositions>
+  </TetrisBrick>
+</Template>
+
+<Template name=tetrisbrick>
+  <TetrisBrick camerapositiontemplate=tetrisbrickcameras>
+  </TetrisBrick>
+</Template>
+
 
 <Level
@@ -40,7 +63,15 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
+<!--luke_grey_-_hypermode.ogg allgorythm-lift_up.ogg Fight1.ogg -->
+    <WorldAmbientSound
+      source="Ganymede.ogg"
+      looping="true"
+      playOnLoad="true"
+    />
+
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+
 
     <?lua
@@ -50,5 +81,5 @@
     <?lua end ?>
 
-    <TetrisCenterpoint name=tetriscenter width=11 height=15 stoneSize=10 stoneTemplate=tetrisstone stoneSpeed=10 position="-55,-75,0">
+    <TetrisCenterpoint name=tetriscenter width=11 height=15 stoneSize=10 stoneTemplate=tetrisstone brickTemplate=tetrisbrick stoneSpeed=10 position="-55,-75,0">
         <attached>
             <Model position="55,-1,0" mesh="cube.mesh" scale3D="57,1,11" />
@@ -56,6 +87,103 @@
             <Model position="111,76,0" mesh="cube.mesh" scale3D="1,76,1" />
         </attached>
+        <!--collisionShapes>
+            <BoxCollisionShape position="55,-1,0"  halfExtents="57,1,11" />
+            <BoxCollisionShape position="-1,76,0"  halfExtents="1,76,1" />
+            <BoxCollisionShape position="111,76,0" halfExtents="1,76,1" />
+        </collisionShapes-->
     </TetrisCenterpoint>
 
+<!-- ------------ insert eye candy here  ---------------- -->
+
+<!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) -->
+<!-- DONT DARE TO TURN THE FOG ON, whithout finding a better belt position -->
+    <?lua
+    	dofile("includes/asteroidField.lua")
+    	asteroidBelt(10000, 0, 0, -40, -90, 70, 100, 200, 24000, 20000, 500, 0)
+
+    ?>
+<!-- -------- 4 spaceships rotating around the tetris field --------- -->
+    <SpaceShip position="1000,-75,1" lookat="0,0,0">
+      <templates>
+        <Template link=spaceshipswallow />
+      </templates>
+      <controller>
+        <WaypointController team=10 accuracy=200>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=0 position="1000,-75,0" />
+            <Model mesh="cube.mesh" scale=0 position="650,-75,650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,-75,1000" />
+            <Model mesh="cube.mesh" scale=0 position="-700,-75,650" />
+            <Model mesh="cube.mesh" scale=0 position="-1000,-75,0" />
+            <Model mesh="cube.mesh" scale=0 position="-700,-75,-650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,-75,-1000" />
+            <Model mesh="cube.mesh" scale=0 position="650,-75,-650" />
+          </waypoints>
+        </WaypointController>
+      </controller>
+    </SpaceShip>
+    
+   <SpaceShip position="-500,-500,-400" lookat="0,0,0">
+      <templates>
+        <Template link=spaceshippirate />
+      </templates>
+      <controller>
+        <WaypointController team=10>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=0 position="-1000,-200,0" />
+            <Model mesh="cube.mesh" scale=0 position="-700,-150,650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,-75,1000" />
+            <Model mesh="cube.mesh" scale=0 position="650,100,650" />          
+            <Model mesh="cube.mesh" scale=0 position="1000,150,0" />
+            <Model mesh="cube.mesh" scale=0 position="650,100,-650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,0,-1000" />
+            <Model mesh="cube.mesh" scale=0 position="-700,-100,-650" />
+          </waypoints>
+        </WaypointController>
+      </controller>
+    </SpaceShip>
+    
+       <SpaceShip position="-700,200,651" lookat="1,0,0">
+      <templates>
+        <Template link=spaceshipghost />
+      </templates>
+      <controller>
+        <WaypointController team=10 accuracy=300>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=0 position="-700,200,650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,100,1000" />
+            <Model mesh="cube.mesh" scale=0 position="650,0,650" />          
+            <Model mesh="cube.mesh" scale=0 position="1000,-100,0" />
+            <Model mesh="cube.mesh" scale=0 position="650,0,-650" />
+            <Model mesh="cube.mesh" scale=0 position="-55,100,-1000" />
+            <Model mesh="cube.mesh" scale=0 position="-700,200,-650" />
+            <Model mesh="cube.mesh" scale=0 position="-1000,300,0" />
+          </waypoints>
+        </WaypointController>
+      </controller>
+    </SpaceShip>
+    
+    <SpaceShip position="1000,-75,0" lookat="0,0,0">
+      <templates>
+        <Template link=spaceshipHtwo />
+      </templates>
+      <controller>
+        <WaypointController team=10>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=0 position="400,240,400" />
+            <Model mesh="cube.mesh" scale=0 position="-55,240,700" />
+            <Model mesh="cube.mesh" scale=0 position="-500,240,400" />
+            <Model mesh="cube.mesh" scale=0 position="-700,240,0" />
+            <Model mesh="cube.mesh" scale=0 position="-500,240,-400" />
+            <Model mesh="cube.mesh" scale=0 position="-55,240,-700" />
+            <Model mesh="cube.mesh" scale=0 position="400,240,-400" />
+            <Model mesh="cube.mesh" scale=0 position="700,240,0" />
+          </waypoints>
+        </WaypointController>
+      </controller>
+    </SpaceShip>
+    
+    
+    
   </Scene>
 </Level>
Index: code/trunk/data/levels/theTimeMachine.oxw
===================================================================
--- code/trunk/data/levels/theTimeMachine.oxw	(revision 9347)
+++ code/trunk/data/levels/theTimeMachine.oxw	(revision 9348)
@@ -39,4 +39,8 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
@@ -71,5 +75,5 @@
     <Scene
         ambientlight="0.8,0.8,0.8"
-        skybox="Orxonox/skypanoramagen2"
+        skybox="Orxonox/skyBoxSomeNebula"
     >
 
Index: code/trunk/data/levels/towerDefense.oxw
===================================================================
--- code/trunk/data/levels/towerDefense.oxw	(revision 9348)
+++ code/trunk/data/levels/towerDefense.oxw	(revision 9348)
@@ -0,0 +1,140 @@
+<!-- TODO: Update the level's image-->
+
+<!-- See TowerDefenseReadme.txt for Information on this file -->
+
+<LevelInfo
+ name = "Tower Defense"
+ description = "Defend your Spacestation from incoming waves."
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("towerdefenseHUD.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/tower.oxt")
+?>
+
+<!-- Specify the position of the camera -->
+<Template name=centerpointmarkcamera defaults=0>
+  <Pawn>
+    <camerapositions>
+      <CameraPosition position="0,0,1500"/>
+    </camerapositions>
+  </Pawn>
+</Template>
+
+<!-- Loads a mesh to mark the center-->
+<Template name=centerpointmark>
+  <Pawn camerapositiontemplate=centerpointmarkcamera>
+    <attached>
+      <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->
+    </attached>
+  </Pawn>
+</Template>
+
+
+<!-- Template for a tower   EDIT: new towertemplate is included with "templates/tower" -->
+<!--Template name=towertemplate>
+  <Tower>
+    <attached>
+      <Model position="0,0,0" scale=0.25 mesh="Tower_ME.mesh" />
+    </attached>
+  </Tower>
+</Template-->
+
+
+
+
+
+<Level gametype = "TowerDefense">
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+    <!-- Spawns the camera, attached to a crate -->
+    <SpawnPoint team=0 position="0,0,0" spawnclass=Pawn pawndesign=centerpointmark />
+    <!--TeamSpawnPoint team=1 position="-7,7,4" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+    <!--SpawnPoint team=1 position="0,0,10" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff  /-->
+    <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+    <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=3 team=1 >
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            <Model mesh="cube.mesh" scale=0 position="-700,-500, 150" />
+            <Model mesh="cube.mesh" scale=0 position=" 200,-500, 150" />
+            <Model mesh="cube.mesh" scale=0 position=" 200, 300, 150" />
+            <Model mesh="cube.mesh" scale=0 position=" 500, 300, 150" />
+            <Model mesh="cube.mesh" scale=0 position=" 500, 700, 150" />
+          </waypoints>
+        </WaypointController>
+      </controller>
+    </SpaceShip>
+
+
+    <!--invisible entity to attach towers to, since playfield is static and towers are dynamic-->
+    <StaticEntity position=0,0,0>
+
+        <attached>
+            <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
+            <!-- Base -->
+            <Model position="500,700,100" mesh="sphere.mesh" scale=80 />
+            <!--Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /--> <!-- Only temporary needed to help align the collisionshape -->
+            <!-- This was used to mark the playfield, let's let it be here for now -->
+            <!--Model position="-8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+            <!--Model position="-8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+            <!--Model position="8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+            <!--Model position="8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+        </attached>
+        <collisionShapes> <!-- The collisionshape forbids other worldentities that have a collisionShape to fly through it.
+
+                               TODO: Find correct size for the collisionshape; since a collisionShape is invisible
+                               I added the crate wich currently has the same dimensions as the collisionshape.
+                               You have to adjust the crate's scale3D as well as the collisionshape's halfExtens to
+                               find the proper shape. -->
+           <BoxCollisionShape position="0,0,0" halfExtents="400,400,100" />
+        </collisionShapes>
+    </StaticEntity>
+
+
+
+
+    <!-- PlayField -->
+    <TowerDefenseCenterpoint
+    name=towerdefensecenter
+    width=16
+    height=16
+    tileScale=100
+    towerTemplate=tower
+    position="0,0,0"
+    direction="0,0,0"
+    collisionType=dynamic
+    mass=100000>
+
+    </TowerDefenseCenterpoint>
+
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/tutorial.oxw
===================================================================
--- code/trunk/data/levels/tutorial.oxw	(revision 9347)
+++ code/trunk/data/levels/tutorial.oxw	(revision 9348)
@@ -2,6 +2,7 @@
  name = "Coding Tutorial"
  description = "Level for the coding tutorial."
- tags = "tutorial"
+ tags = "tutorial, shipselection"
  screenshot = "codingtutorial.png"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser"
 />
 
@@ -10,4 +11,6 @@
   include("stats.oxo")
   include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipGhost.oxt")
+  include("templates/spaceshipSpacecruiser.oxt")
   include("templates/lodInformation.oxt")
 ?>
@@ -21,10 +24,6 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
-
-
-
-
 <Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
   <attached>
@@ -53,5 +52,5 @@
       for i = 1, 10, 1 do
     ?>
-      <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+      <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=shipselection />
     <?lua end ?>
 
Index: code/trunk/data/levels/underAttack.oxw
===================================================================
--- code/trunk/data/levels/underAttack.oxw	(revision 9347)
+++ code/trunk/data/levels/underAttack.oxw	(revision 9348)
@@ -12,5 +12,4 @@
   include("templates/lodInformation.oxt")
 ?>
-<!--OUTDATED: include("underAttackHUD.oxo") -->
 
 <Level
@@ -24,5 +23,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/levels/waypoints.oxw
===================================================================
--- code/trunk/data/levels/waypoints.oxw	(revision 9347)
+++ code/trunk/data/levels/waypoints.oxw	(revision 9348)
@@ -23,5 +23,5 @@
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skypanoramagen1"
+   skybox       = "Orxonox/skyBoxBasic"
   >
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Index: code/trunk/data/overlays/dynamicMatchHUD.oxo
===================================================================
--- code/trunk/data/overlays/dynamicMatchHUD.oxo	(revision 9347)
+++ code/trunk/data/overlays/dynamicMatchHUD.oxo	(revision 9348)
@@ -2,4 +2,25 @@
   <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
    
+    <!--OverlayText
+     position  = "0.02, 0.02"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     caption   = "Target:"
+    />
+
+    <OverlayText
+     position  = "0.02, 0.055"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     caption   = "Score:"
+    /-->
+
+
  <GametypeStaticMessage
    name     = "staticmessage"
Index: code/trunk/data/overlays/lastManStandingHUD.oxo
===================================================================
--- code/trunk/data/overlays/lastManStandingHUD.oxo	(revision 9347)
+++ code/trunk/data/overlays/lastManStandingHUD.oxo	(revision 9348)
@@ -1,34 +1,4 @@
 <Template name="LastmanstandingHUD">
-  <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
-   
- <!--GametypeStaticMessage
-   name     = "staticmessage"
-   position = "0.5, 0.01"
-   font     = "VeraMono"
-   caption  = ""
-   textsize = 0.033
-   colour   = "1.0, 1.0, 0.5, 1.0"
-   align    = "center"
-  /-->
-
-<GametypeFadingMessage
-     name     = "fadingmessage"
-     position = "0.5, 0.01"
-     font     = "VeraMono"
-     textsize = 0.04
-     colour   = "1.0, 1.0, 0.5, 1.0"
-     align    = "center"
-    />
-
-    <OverlayText
-     position  = "0.02, 0.02"
-     pickpoint = "0.0, 0.0"
-     font      = "ShareTechMono"
-     textsize  = 0.04
-     colour    = "1.0, 1.0, 1.0, 1.0"
-     align     = "left"
-     caption   = "Lives:   "
-    />
-
+  <OverlayGroup name="LastmanstandingHUD" scale = "1, 1">
     <LastManStandingInfos
      position  = "0.14, 0.02"
@@ -41,4 +11,13 @@
      showlives     = true
      showplayers     = false
+    />
+    <OverlayText
+     position  = "0.02, 0.02"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     caption   = "Lives:   "
     />
 
Index: code/trunk/data/overlays/lastTeamStandingHUD.oxo
===================================================================
--- code/trunk/data/overlays/lastTeamStandingHUD.oxo	(revision 9347)
+++ code/trunk/data/overlays/lastTeamStandingHUD.oxo	(revision 9348)
@@ -1,12 +1,14 @@
 <Template name="lastTeamStandingHUD">
   <OverlayGroup name="lastTeamStandingHUD" scale = "1, 1">
+    <LastTeamStandingInfos
+     position  = "0.14, 0.02"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.04
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
 
-<GametypeFadingMessage
-     name     = "fadingmessage"
-     position = "0.5, 0.01"
-     font     = "VeraMono"
-     textsize = 0.04
-     colour   = "1.0, 1.0, 0.5, 1.0"
-     align    = "center"
+     showlives     = true
+     showteams     = false
     />
 
@@ -19,16 +21,4 @@
      align     = "left"
      caption   = "Lives:   "
-    />
-
-    <LastTeamStandingInfos
-     position  = "0.14, 0.02"
-     pickpoint = "0.0, 0.0"
-     font      = "ShareTechMono"
-     textsize  = 0.04
-     colour    = "1.0, 1.0, 1.0, 1.0"
-     align     = "left"
-
-     showlives     = true
-     showteams     = false
     />
 
Index: code/trunk/data/overlays/tetrisHUD.oxo
===================================================================
--- code/trunk/data/overlays/tetrisHUD.oxo	(revision 9348)
+++ code/trunk/data/overlays/tetrisHUD.oxo	(revision 9348)
@@ -0,0 +1,37 @@
+<Template name="TetrisHUD">
+  <OverlayGroup name="TetrisHUD" scale = "1, 1">
+    <TetrisScore
+     position  = "0.9, 0.1"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+    />
+
+    <OverlayText
+     position  = "0.7, 0.10"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     caption   = "Points: "
+    />
+    
+    <OverlayText
+     position  = "0.7, 0.20"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     caption   = "Next Brick"
+    />
+    
+    
+
+  </OverlayGroup>
+</Template>
Index: code/trunk/data/overlays/towerdefenseHUD.oxo
===================================================================
--- code/trunk/data/overlays/towerdefenseHUD.oxo	(revision 9348)
+++ code/trunk/data/overlays/towerdefenseHUD.oxo	(revision 9348)
@@ -0,0 +1,14 @@
+<Template name="TowerDefenseHUD">
+  <OverlayGroup name="TowerDefenseHUD" scale = "1, 1">
+    <OverlayText
+     position  = "0.05, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     caption = "Hello World"
+    />
+  </OverlayGroup>
+</Template>
Index: code/trunk/data/overlays/underAttackHUD.oxo
===================================================================
--- code/trunk/data/overlays/underAttackHUD.oxo	(revision 9347)
+++ 	(revision )
@@ -1,26 +1,0 @@
-< Template name="UnderAttackHUD">
-  <OverlayGroup name="UnderAttackHUD" scale = "1, 1">
-    <OUTDATED-- UnderAttackHealthBar
-     name                 = "HealthBar"
-     background           = "Orxonox/HealthBarBackground"
-     size                 = "0.45, 0.0875"
-     position             = "0.99 , 0.01"
-     pickpoint            = "1, 0"
-     bartexture           = "healthbar_bar.png"
-     textfont             = "VeraMono"
-     textusebarcolour     = true
-     textsize             = 0.039
-     textoffset           = "0.315, 0.05"
-     textpickpoint        = "0, 0"
-     textalign            = "right"
-     correctaspect        = false
-     textcorrectaspect    = false
-     descriptionpickpoint = "0, 0"
-     descriptionoffset    = "0.5, 1"
-    >
-      <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
-      <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
-      <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
-    </UnderAttackHealthBar>
-  </OverlayGroup>
-</Template>
Index: code/trunk/data/particle/smoke1.particle
===================================================================
--- code/trunk/data/particle/smoke1.particle	(revision 9347)
+++ 	(revision )
@@ -1,43 +1,0 @@
-// Example particle systems
-
-// smoke
-particle_system Examples/Smoke
-{
-    	material        	Examples/Smoke
-    	particle_width  	55
-    	particle_height 	55
-    	cull_each       	true
-    	quota           	500
-    	billboard_type  	point
-		sorted				true
-    
-    	// Area emitter
-    	emitter Point
-    	{
-		angle               		11
-        	emission_rate       		15
-        	time_to_live        		4
-        	direction           		0 1 0
-        	velocity_min        		150
-        	velocity_max        		240    	
-	}
-
-	affector ColourImage
-	{
-		image		smokecolors.png
-	}
-
-   	affector Rotator
-   	{
-        	rotation_range_start  		0
-        	rotation_range_end   	 	360
-        	rotation_speed_range_start  	-60
-        	rotation_speed_range_end    	200
-   	}
-
-   	affector Scaler
-   	{
-       	rate 	100
-   	}
-
-}
Index: code/trunk/src/BuildUnitsConfigGCC.cmake
===================================================================
--- code/trunk/src/BuildUnitsConfigGCC.cmake	(revision 9347)
+++ code/trunk/src/BuildUnitsConfigGCC.cmake	(revision 9348)
Index: code/trunk/src/BuildUnitsConfigMSVC.cmake
===================================================================
--- code/trunk/src/BuildUnitsConfigMSVC.cmake	(revision 9347)
+++ code/trunk/src/BuildUnitsConfigMSVC.cmake	(revision 9348)
Index: code/trunk/src/external/tolua/README_ORXONOX
===================================================================
--- code/trunk/src/external/tolua/README_ORXONOX	(revision 9347)
+++ code/trunk/src/external/tolua/README_ORXONOX	(revision 9348)
Index: code/trunk/src/libraries/core/Super.h
===================================================================
--- code/trunk/src/libraries/core/Super.h	(revision 9347)
+++ code/trunk/src/libraries/core/Super.h	(revision 9348)
@@ -280,7 +280,4 @@
         SUPER_NOARGS(classname, functionname)
 
-    #define SUPER_clone(classname, functionname, ...) \
-        SUPER_ARGS(classname, functionname, __VA_ARGS__)
-
     #define SUPER_changedCarrier(classname, functionname, ...) \
         SUPER_NOARGS(classname, functionname)
@@ -398,5 +395,5 @@
                     inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \
                     { \
-                        (dynamic_cast<T*>(object))->T:: functionname
+                        (orxonox_cast<T*>(object))->T:: functionname
 
         /*
@@ -508,5 +505,5 @@
                 inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) )
                 {
-                    (dynamic_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
+                    (orxonox_cast<T*>(object))->T:: functionname ( Call the function with it's arguments );
                 }
 
@@ -566,13 +563,9 @@
         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
 
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, clone, true, OrxonoxClass*& item)
-            (item)
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedCarrier, false)
-            ()
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
-
-        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(13, changedPickedUp, false)
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(11, changedCarrier, false)
+            ()
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
+
+        SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(12, changedPickedUp, false)
             ()
         SUPER_FUNCTION_GLOBAL_DECLARATION_PART2;
@@ -632,5 +625,4 @@
     SUPER_INTRUSIVE_DECLARATION(changedGametype);
     SUPER_INTRUSIVE_DECLARATION(changedUsed);
-    SUPER_INTRUSIVE_DECLARATION(clone);
     SUPER_INTRUSIVE_DECLARATION(changedCarrier);
     SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
Index: code/trunk/src/libraries/core/Template.cc
===================================================================
--- code/trunk/src/libraries/core/Template.cc	(revision 9347)
+++ code/trunk/src/libraries/core/Template.cc	(revision 9348)
@@ -149,4 +149,9 @@
         orxout(verbose, context::templates) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << endl;
 
+        // check if the template is applied on an object of the right type
+        Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());
+        if (!object->getIdentifier()->isA(identifier))
+            orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl;
+
         Element temp = &const_cast<TiXmlElement&>(this->getXMLElement());
 
Index: code/trunk/src/libraries/core/XMLPort.h
===================================================================
--- code/trunk/src/libraries/core/XMLPort.h	(revision 9347)
+++ code/trunk/src/libraries/core/XMLPort.h	(revision 9348)
@@ -197,5 +197,5 @@
         ClassIdentifier<classname>::getIdentifier()->addXMLPortParamContainer(paramname, containername); \
     } \
-    containername->port(dynamic_cast<BaseObject*>(this), object, xmlelement, mode)
+    containername->port(orxonox_cast<BaseObject*>(this), object, xmlelement, mode)
 
 // --------------------
Index: code/trunk/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 9347)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.cc	(revision 9348)
@@ -594,5 +594,5 @@
         @param bPrintError If true, an error is printed if the command doesn't exist
     */
-    /* static */ const ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
     {
         // find the group
@@ -624,5 +624,5 @@
         @param bPrintError If true, an error is printed if the command doesn't exist
     */
-    /* static */ const ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
     {
         std::string groupLC = getLowercase(group);
Index: code/trunk/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 9347)
+++ code/trunk/src/libraries/core/command/ConsoleCommand.h	(revision 9348)
@@ -382,5 +382,5 @@
                 public:
                     /// Constructor: Creates a manipulator for a given ConsoleCommand.
-                    ConsoleCommandManipulator(const ConsoleCommand* command) : command_(const_cast<ConsoleCommand*>(command)) {}
+                    ConsoleCommandManipulator(ConsoleCommand* command) : command_(command) {}
 
                     /// Changes the current function of the command. @param function The new function-pointer @param bForce If true, the new function-pointer is always assigned, even if the headers don't match
@@ -619,5 +619,5 @@
 
             /// Returns a manipulator for this command.
-            inline ConsoleCommandManipulator getManipulator() const
+            inline ConsoleCommandManipulator getManipulator()
                 { return this; }
 
@@ -667,12 +667,12 @@
 
             /// Returns a command (shortcut) with given name. @param name The name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
-            static inline const ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
+            static inline ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommand("", name, bPrintError); }
             /// Returns a command (shortcut) with given name in lowercase. @param name The lowercase name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
-            static inline const ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
+            static inline ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommandLC("", name, bPrintError); }
 
-            static const ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
-            static const ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
+            static ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
+            static ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
 
             static void destroyAll();
Index: code/trunk/src/libraries/util/output/ConsoleWriter.cc
===================================================================
--- code/trunk/src/libraries/util/output/ConsoleWriter.cc	(revision 9347)
+++ code/trunk/src/libraries/util/output/ConsoleWriter.cc	(revision 9348)
Index: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/modules/CMakeLists.txt	(revision 9348)
@@ -38,2 +38,3 @@
 ADD_SUBDIRECTORY(weapons)
 ADD_SUBDIRECTORY(docking)
+ADD_SUBDIRECTORY(towerdefense)
Index: code/trunk/src/modules/docking/DockingController.cc
===================================================================
--- code/trunk/src/modules/docking/DockingController.cc	(revision 9347)
+++ code/trunk/src/modules/docking/DockingController.cc	(revision 9348)
@@ -60,5 +60,5 @@
 
         float distance = (this->dock_->getWorldPosition() - entity->getPosition()).length();
-        Vector2 coord = get2DViewdirection(     // I don't understand this too
+        Vector2 coord = get2DViewcoordinates(     // I don't understand this too
             entity->getPosition(),
             entity->getOrientation() * WorldEntity::FRONT,
@@ -70,6 +70,6 @@
         if (distance > 10)
         {
-            entity->rotateYaw(-1.0f * 0.8f * sgn(coord.x) * coord.x*coord.x);
-            entity->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
+            entity->rotateYaw(-1.0f * 0.8f * clamp(coord.x * 10, -1.0f, 1.0f));
+            entity->rotatePitch(0.8f * clamp(coord.y * 10, -1.0f, 1.0f));
         }
 
Index: code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	(revision 9347)
+++ code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc	(revision 9348)
@@ -112,5 +112,5 @@
                 const std::string& message =  "You have " + multi_cast<std::string>(this->bTimeLimit_)
                             + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
-                const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
+                gametype->getGametypeInfo()->sendAnnounceMessage(message);
                 ChatManager::message(message);
             }
Index: code/trunk/src/modules/gametypes/OldSpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.cc	(revision 9347)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.cc	(revision 9348)
@@ -58,5 +58,5 @@
                         + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
                         + " before the time limit. You lose!";
-            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            this->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
         }
@@ -68,5 +68,5 @@
             const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
                         + "." + multi_cast<std::string>(ms) + " seconds.";
-            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            this->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
 /*
@@ -85,5 +85,5 @@
 
         std::string message("The match has started! Reach the check points as quickly as possible!");
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        this->getGametypeInfo()->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
@@ -98,5 +98,5 @@
                         + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
                         + " seconds.";
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        this->getGametypeInfo()->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
Index: code/trunk/src/modules/gametypes/OldSpaceRace.h
===================================================================
--- code/trunk/src/modules/gametypes/OldSpaceRace.h	(revision 9347)
+++ code/trunk/src/modules/gametypes/OldSpaceRace.h	(revision 9348)
@@ -59,4 +59,6 @@
 
             virtual void newCheckpointReached();
+            virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command.
+                                                        //<! This is only a temporary solution. Better: create racingBots.
 
             inline void setCheckpointsReached(int n)
Index: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9347)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9348)
@@ -97,5 +97,5 @@
             std::string message =  "You have " + multi_cast<std::string>(this->timeLimit_)
                         + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
-            const_cast<GametypeInfo*>(this->getGametype()->getGametypeInfo())->sendAnnounceMessage(message);
+            this->getGametype()->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
         }
Index: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9347)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9348)
@@ -23,5 +23,5 @@
  *     Mauro Salomon
  *   Co-authors:
- *      ...
+ *      Celine Egger
  *
  */
@@ -48,4 +48,6 @@
         this->cantMove_ = false;
         this->bTimeIsUp_ = false;
+        this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race
+                                 // remove this line, if a raceBot has been created.
     }
 
@@ -70,5 +72,5 @@
         }
 
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        this->getGametypeInfo()->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
@@ -97,5 +99,5 @@
 
             std::string message = "The match has started! Reach the check points as quickly as possible!";
-            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+            this->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
         }
@@ -112,5 +114,5 @@
         const std::string& message = "Checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
             + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        this->getGametypeInfo()->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9347)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9348)
@@ -149,5 +149,5 @@
             }
             else
-			{
+            {
                 // adjust the radarvisibility
                 gametype->newCheckpointReached(newCheckpoint, player);
Index: code/trunk/src/modules/objects/triggers/CheckPoint.cc
===================================================================
--- code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 9347)
+++ code/trunk/src/modules/objects/triggers/CheckPoint.cc	(revision 9348)
@@ -109,5 +109,5 @@
                 if (bIsDestination_)
                 {
-                    const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Congratulations - you have won the match!");
+                    gametype->getGametypeInfo()->sendAnnounceMessage("Congratulations - you have won the match!");
                     gametype->end();
                 }
@@ -115,5 +115,5 @@
                 if (!bIsFirst_ && !bIsDestination_)
                 {
-                    const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage("Checkpoint reached");
+                    gametype->getGametypeInfo()->sendAnnounceMessage("Checkpoint reached");
                 }
             }
Index: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 9347)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h	(revision 9348)
@@ -95,5 +95,4 @@
     class PauseNotice;
     class TeamBaseMatchScore;
-    class UnderAttackHealthBar;
 
     // stats
Index: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 9348)
@@ -12,5 +12,4 @@
   KillMessage.cc
   DeathMessage.cc
-  UnderAttackHealthBar.cc
   TeamBaseMatchScore.cc
   GametypeStaticMessage.cc
Index: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc	(revision 9348)
Index: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h	(revision 9348)
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 9348)
@@ -55,394 +55,373 @@
 namespace orxonox
 {
-bool compareDistance ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b )
-{
-    return a.second<b.second;
-
-}
-
-void HUDNavigation::setConfigValues()
-{
-  SetConfigValue(markerLimit_, 3);
-  SetConfigValue(showDistance, false);
-}
-
-CreateFactory ( HUDNavigation );
-
-HUDNavigation::HUDNavigation ( BaseObject* creator )
-        : OrxonoxOverlay ( creator )
-{
-    RegisterObject ( HUDNavigation );
-    this->setConfigValues();
-
-    // Set default values
-    this->setFont ( "Monofur" );
-    this->setTextSize ( 0.05f );
-    this->setNavMarkerSize ( 0.05f );
-    this->setDetectionLimit( 10000.0f );
-}
-
-HUDNavigation::~HUDNavigation()
-{
-    if ( this->isInitialized() )
-    {
-        for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); )
-            removeObject ( ( it++ )->first );
-
-    }
-
-    sortedObjectList_.clear();
-}
-
-void HUDNavigation::XMLPort ( Element& xmlelement, XMLPort::Mode mode )
-{
-    SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
-
-    XMLPortParam ( HUDNavigation, "font",          setFont,          getFont,          xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
-    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
-}
-
-void HUDNavigation::setFont ( const std::string& font )
-{
-    const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName ( font );
-    if ( fontPtr.isNull() )
-    {
-        orxout(internal_warning) << "HUDNavigation: Font '" << font << "' not found" << endl;
-        return;
-    }
-    fontName_ = font;
-    for ( ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it )
-    {
-        if ( it->second.text_ != NULL )
-            it->second.text_->setFontName ( fontName_ );
-    }
-}
-
-const std::string& HUDNavigation::getFont() const
-{
-    return fontName_;
-}
-
-void HUDNavigation::setTextSize ( float size )
-{
-    if ( size <= 0.0f )
-    {
-        orxout(internal_warning) << "HUDNavigation: Negative font size not allowed" << endl;
-        return;
-    }
-    textSize_ = size;
-    for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
-    {
-        if ( it->second.text_ )
-            it->second.text_->setCharHeight ( size );
-    }
-}
-
-float HUDNavigation::getTextSize() const
-{
-    return textSize_;
-}
-
-float HUDNavigation::getArrowSizeX(int dist)
-{
-    if (dist < 600)
-        dist = 600;
-    return this->getActualSize().x * 900 * navMarkerSize_ / dist;
-}
-
-float HUDNavigation::getArrowSizeY(int dist)
-{
-    if (dist < 600)
-        dist = 600;
-    return this->getActualSize().y * 900 * navMarkerSize_ / dist;
-}
-
-void HUDNavigation::tick ( float dt )
-{
-    SUPER ( HUDNavigation, tick, dt );
-
-    Camera* cam = CameraManager::getInstance().getActiveCamera();
-    if ( cam == NULL )
-        return;
-    const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
-
-
-    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
-    {
-        listIt->second = ( int ) ( ( listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition() ).length() + 0.5f );
-    }
-
-    sortedObjectList_.sort ( compareDistance );
-
-    unsigned int markerCount_ = 0;
-    bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
-
-//         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
-    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
-    {
-        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
-        closeEnough_ = listIt->second < detectionLimit_ ;
-        // display radarviewables on HUD if the marker limit and max-distance is not exceeded
-        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) )
-        {
-
-
-            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
-            int dist = listIt->second;
-            float textLength = 0.0f;
-
-            //display distance next to cursor
-            if (showDistance){
-            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
-            textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
-            }
-
-            //display name next to cursor
-            else{
-            it->second.text_->setCaption(it->first->getRadarName());
-            textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
-            }
-
-            // Transform to screen coordinates
-            Vector3 pos = camTransform * it->first->getRVWorldPosition();
-
-            bool outOfView = true;
-            if ( pos.z > 1.0 )
+    bool compareDistance(std::pair<RadarViewable*, unsigned int> a, std::pair<RadarViewable*, unsigned int> b)
+    {
+        return a.second < b.second;
+    }
+
+    CreateFactory ( HUDNavigation );
+
+    HUDNavigation::HUDNavigation(BaseObject* creator) : OrxonoxOverlay(creator)
+    {
+        RegisterObject(HUDNavigation);
+        this->setConfigValues();
+
+        // Set default values
+        this->setFont("Monofur");
+        this->setTextSize(0.05f);
+        this->setNavMarkerSize(0.05f);
+        this->setDetectionLimit(10000.0f);
+    }
+
+    HUDNavigation::~HUDNavigation()
+    {
+        if (this->isInitialized())
+        {
+            for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end();)
+                removeObject((it++)->first);
+        }
+        this->sortedObjectList_.clear();
+    }
+
+    void HUDNavigation::setConfigValues()
+    {
+        SetConfigValue(markerLimit_, 3);
+        SetConfigValue(showDistance_, false);
+    }
+
+    void HUDNavigation::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDNavigation, XMLPort, xmlelement, mode);
+
+        XMLPortParam(HUDNavigation, "font",           setFont,           getFont,           xmlelement, mode);
+        XMLPortParam(HUDNavigation, "textSize",       setTextSize,       getTextSize,       xmlelement, mode);
+        XMLPortParam(HUDNavigation, "navMarkerSize",  setNavMarkerSize,  getNavMarkerSize,  xmlelement, mode);
+        XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
+    }
+
+    void HUDNavigation::setFont(const std::string& font)
+    {
+        const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName(font);
+        if (fontPtr.isNull())
+        {
+            orxout(internal_warning) << "HUDNavigation: Font '" << font << "' not found" << endl;
+            return;
+        }
+        this->fontName_ = font;
+        for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
+        {
+            if (it->second.text_ != NULL)
+                it->second.text_->setFontName(this->fontName_);
+        }
+    }
+
+    const std::string& HUDNavigation::getFont() const
+    {
+        return this->fontName_;
+    }
+
+    void HUDNavigation::setTextSize(float size)
+    {
+        if (size <= 0.0f)
+        {
+            orxout(internal_warning) << "HUDNavigation: Negative font size not allowed" << endl;
+            return;
+        }
+        this->textSize_ = size;
+        for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)
+        {
+            if (it->second.text_)
+                it->second.text_->setCharHeight(size);
+        }
+    }
+
+    float HUDNavigation::getTextSize() const
+    {
+        return this->textSize_;
+    }
+
+    float HUDNavigation::getArrowSizeX(int dist) const
+    {
+        if (dist < 600)
+            dist = 600;
+        return this->getActualSize().x * 900 * this->navMarkerSize_ / dist;
+    }
+
+    float HUDNavigation::getArrowSizeY(int dist) const
+    {
+        if (dist < 600)
+            dist = 600;
+        return this->getActualSize().y * 900 * this->navMarkerSize_ / dist;
+    }
+
+    void HUDNavigation::tick(float dt)
+    {
+        SUPER(HUDNavigation, tick, dt);
+
+        Camera* cam = CameraManager::getInstance().getActiveCamera();
+        if (cam == NULL)
+            return;
+        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
+
+
+        for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
+            listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
+
+        this->sortedObjectList_.sort(compareDistance);
+
+        unsigned int markerCount = 0;
+        bool closeEnough = false; // only display objects that are close enough to be relevant for the player
+
+        for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
+        {
+            std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
+            closeEnough = listIt->second < this->detectionLimit_;
+            // display radarviewables on HUD if the marker limit and max-distance is not exceeded
+            if (markerCount < this->markerLimit_ && (closeEnough ||  this->detectionLimit_ < 0))
             {
-                // z > 1.0 means that the object is behind the camera
-                outOfView = true;
-                // we have to switch all coordinates (if you don't know why,
-                // try linear algebra lectures, because I can't explain..)
-                pos.x = -pos.x;
-                pos.y = -pos.y;
-            }
-            else
-                outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
-
-            if ( outOfView )
-            {
-                // Object is not in view
-
-                // Change material only if outOfView changed
-                if ( !it->second.wasOutOfView_ )
+                // Get Distance to HumanController and save it in the TextAreaOverlayElement.
+                int dist = listIt->second;
+                float textLength = 0.0f;
+
+                if (this->showDistance_)
                 {
-                    it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "arrows.png", it->first->getRadarObjectColour()) );
-                    it->second.wasOutOfView_ = true;
+                    //display distance next to cursor
+                    it->second.text_->setCaption(multi_cast<std::string>(dist));
+                    textLength = multi_cast<std::string>(dist).size() * it->second.text_->getCharHeight() * 0.3f;
                 }
-
-                //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist;
-                //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist;
-
-                // Adjust Arrowsize according to distance
-                it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist));
-
-                // Switch between top, bottom, left and right position of the arrow at the screen border
-                if ( pos.x < pos.y )
+                else
                 {
-                    if ( pos.y > -pos.x )
+                    //display name next to cursor
+                    it->second.text_->setCaption(it->first->getRadarName());
+                    textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
+                }
+
+                // Transform to screen coordinates
+                Vector3 pos = camTransform * it->first->getRVWorldPosition();
+
+                bool outOfView = true;
+                if (pos.z > 1.0)
+                {
+                    // z > 1.0 means that the object is behind the camera
+                    outOfView = true;
+                    // we have to switch all coordinates (if you don't know why,
+                    // try linear algebra lectures, because I can't explain..)
+                    pos.x = -pos.x;
+                    pos.y = -pos.y;
+                }
+                else
+                    outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
+
+                if (outOfView)
+                {
+                    // Object is not in view
+
+                    // Change material only if outOfView changed
+                    if (!it->second.wasOutOfView_)
                     {
-                        // Top
-                        float position = pos.x / pos.y + 1.0f;
-                        it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 0.0f );
-                        it->second.panel_->setUV ( 0.5f, 0.0f, 1.0f, 0.5f );
-                        it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
-                        it->second.text_->setTop ( it->second.panel_->getHeight() );
+                        it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
+                        it->second.wasOutOfView_ = true;
+                    }
+
+                    //float xDistScale = this->getActualSize().x * 1000.0f * this->navMarkerSize_ / dist;
+                    //float yDistScale = this->getActualSize().y * 1000.0f * this->navMarkerSize_ / dist;
+
+                    // Adjust Arrowsize according to distance
+                    it->second.panel_->setDimensions(getArrowSizeX(dist), getArrowSizeY(dist));
+
+                    // Switch between top, bottom, left and right position of the arrow at the screen border
+                    if (pos.x < pos.y)
+                    {
+                        if (pos.y > -pos.x)
+                        {
+                            // Top
+                            float position = pos.x / pos.y + 1.0f;
+                            it->second.panel_->setPosition((position - it->second.panel_->getWidth()) * 0.5f, 0.0f);
+                            it->second.panel_->setUV(0.5f, 0.0f, 1.0f, 0.5f);
+                            it->second.text_->setLeft((position - textLength) * 0.5f);
+                            it->second.text_->setTop(it->second.panel_->getHeight());
+                        }
+                        else
+                        {
+                            // Left
+                            float position = pos.y / pos.x + 1.0f;
+                            it->second.panel_->setPosition(0.0f, (position - it->second.panel_->getWidth()) * 0.5f);
+                            it->second.panel_->setUV(0.0f, 0.0f, 0.5f, 0.5f);
+                            it->second.text_->setLeft(it->second.panel_->getWidth() + 0.01f);
+                            it->second.text_->setTop((position - it->second.text_->getCharHeight()) * 0.5f);
+                        }
                     }
                     else
                     {
-                        // Left
-                        float position = pos.y / pos.x + 1.0f;
-                        it->second.panel_->setPosition ( 0.0f, ( position - it->second.panel_->getWidth() ) * 0.5f );
-                        it->second.panel_->setUV ( 0.0f, 0.0f, 0.5f, 0.5f );
-                        it->second.text_->setLeft ( it->second.panel_->getWidth() + 0.01f );
-                        it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
+                        if (pos.y < -pos.x)
+                        {
+                            // Bottom
+                            float position = -pos.x / pos.y + 1.0f;
+                            it->second.panel_->setPosition((position - it->second.panel_->getWidth()) * 0.5f, 1.0f - it->second.panel_->getHeight());
+                            it->second.panel_->setUV(0.0f, 0.5f, 0.5f, 1.0f );
+                            it->second.text_->setLeft((position - textLength) * 0.5f);
+                            it->second.text_->setTop(1.0f - it->second.panel_->getHeight() - it->second.text_->getCharHeight());
+                        }
+                        else
+                        {
+                            // Right
+                            float position = -pos.y / pos.x + 1.0f;
+                            it->second.panel_->setPosition(1.0f - it->second.panel_->getWidth(), (position - it->second.panel_->getHeight()) * 0.5f);
+                            it->second.panel_->setUV(0.5f, 0.5f, 1.0f, 1.0f);
+                            it->second.text_->setLeft(1.0f - it->second.panel_->getWidth() - textLength - 0.01f);
+                            it->second.text_->setTop((position - it->second.text_->getCharHeight()) * 0.5f);
+                        }
                     }
                 }
-
                 else
                 {
-
-                    if ( pos.y < -pos.x )
+                    // Object is in view
+
+                    // Change material only if outOfView changed
+                    if (it->second.wasOutOfView_)
                     {
-                        // Bottom
-                        float position = -pos.x / pos.y + 1.0f;
-                        it->second.panel_->setPosition ( ( position - it->second.panel_->getWidth() ) * 0.5f, 1.0f - it->second.panel_->getHeight() );
-                        it->second.panel_->setUV ( 0.0f, 0.5f, 0.5f, 1.0f );
-                        it->second.text_->setLeft ( ( position - textLength ) * 0.5f );
-                        it->second.text_->setTop ( 1.0f - it->second.panel_->getHeight() - it->second.text_->getCharHeight() );
+                        //it->second.panel_->setMaterialName("Orxonox/NavTDC");
+                        it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("tdc.png", it->first->getRadarObjectColour()));
+                        it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
+                        it->second.wasOutOfView_ = false;
                     }
-                    else
-                    {
-                        // Right
-                        float position = -pos.y / pos.x + 1.0f;
-                        it->second.panel_->setPosition ( 1.0f - it->second.panel_->getWidth(), ( position - it->second.panel_->getHeight() ) * 0.5f );
-                        it->second.panel_->setUV ( 0.5f, 0.5f, 1.0f, 1.0f );
-                        it->second.text_->setLeft ( 1.0f - it->second.panel_->getWidth() - textLength - 0.01f );
-                        it->second.text_->setTop ( ( position - it->second.text_->getCharHeight() ) * 0.5f );
-                    }
+
+                    // Position marker
+                    it->second.panel_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.panel_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.panel_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f);
+
+                    // Position text
+                    it->second.text_->setLeft((pos.x + 1.0f + it->second.panel_->getWidth()) * 0.5f);
+                    it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
                 }
+
+                // Make sure the overlays are shown
+                it->second.panel_->show();
+                it->second.text_->show();
             }
-            else
+            else // do not display on HUD
             {
-                // Object is in view
-
-                // Change material only if outOfView changed
-                if ( it->second.wasOutOfView_ )
-                {
-                  //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
-                    it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) );
-                    it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y );
-                    it->second.wasOutOfView_ = false;
-                }
-
-                // Position marker
-                it->second.panel_->setUV ( 0.0f, 0.0f, 1.0f, 1.0f );
-                it->second.panel_->setLeft ( ( pos.x + 1.0f - it->second.panel_->getWidth() ) * 0.5f );
-                it->second.panel_->setTop ( ( -pos.y + 1.0f - it->second.panel_->getHeight() ) * 0.5f );
-
-                // Position text
-                it->second.text_->setLeft ( ( pos.x + 1.0f + it->second.panel_->getWidth() ) * 0.5f );
-                it->second.text_->setTop ( ( -pos.y + 1.0f + it->second.panel_->getHeight() ) * 0.5f );
+                it->second.panel_->hide();
+                it->second.text_->hide();
             }
-
-            // Make sure the overlays are shown
-            it->second.panel_->show();
-            it->second.text_->show();
-        }
-        else // do not display on HUD
-        {
-            it->second.panel_->hide();
-            it->second.text_->hide();
-        }
-
+        }
+    }
+
+    /** Overridden method of OrxonoxOverlay.
+    @details
+        Usually the entire overlay scales with scale().
+        Here we obviously have to adjust this.
+    */
+    void HUDNavigation::sizeChanged()
+    {
+        // Use size to compensate for aspect ratio if enabled.
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+
+        for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
+        {
+            if (it->second.panel_ != NULL)
+                it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
+            if (it->second.text_ != NULL)
+                it->second.text_->setCharHeight(it->second.text_->getCharHeight() * yScale);
+        }
+    }
+
+    void HUDNavigation::addObject(RadarViewable* object)
+    {
+        if (showObject(object) == false)
+            return;
+
+        if (this->activeObjectList_.size() >= this->markerLimit_)
+            if (object == NULL)
+                return;
+
+        // Object hasn't been added yet (we know that)
+        assert(this->activeObjectList_.find(object) == this->activeObjectList_.end());
+
+        // Scales used for dimensions and text size
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+
+        // Create everything needed to display the object on the radar and add it to the map
+
+        // Create arrow/marker
+        Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton()
+                                           .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        panel->setMaterialName(TextureGenerator::getMaterialName("tdc.png", object->getRadarObjectColour()));
+        panel->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
+        //panel->setColour(object->getRadarObjectColour());
+
+        Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton()
+                                             .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+        text->setFontName(this->fontName_);
+        text->setCharHeight(text->getCharHeight() * yScale);
+        text->setColour(object->getRadarObjectColour());
+
+        panel->hide();
+        text->hide();
+
+        ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
+        this->activeObjectList_[object] = tempStruct;
+
+        this->background_->addChild(panel);
+        this->background_->addChild(text);
+
+        this->sortedObjectList_.push_front(std::make_pair(object, (unsigned int)0));
+    }
+
+    void HUDNavigation::removeObject(RadarViewable* viewable)
+    {
+        std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(viewable);
+
+        if (this->activeObjectList_.find(viewable) != this->activeObjectList_.end())
+        {
+            // Detach overlays
+            this->background_->removeChild(it->second.panel_->getName());
+            this->background_->removeChild(it->second.text_->getName());
+            // Properly destroy the overlay elements (do not use delete!)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.text_);
+            // Remove from the list
+            this->activeObjectList_.erase(viewable);
+        }
+
+        for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
+        {
+            if ((listIt->first) == viewable)
+            {
+                this->sortedObjectList_.erase(listIt);
+                break;
+            }
+        }
+    }
+
+    void HUDNavigation::objectChanged(RadarViewable* viewable)
+    {
+        // TODO: niceification neccessary ;)
+        removeObject(viewable);
+        addObject(viewable);
+    }
+
+    bool HUDNavigation::showObject(RadarViewable* rv)
+    {
+        if (rv == orxonox_cast<RadarViewable*>(this->getOwner()))
+            return false;
+        assert(rv->getWorldEntity());
+        if (rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false)
+            return false;
+        return true;
+    }
+
+    void HUDNavigation::changedOwner()
+    {
+        const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
+        for (std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)
+        {
+            if (!(*it)->isHumanShip_)
+                this->addObject(*it);
+        }
     }
 }
-
-
-/** Overridden method of OrxonoxOverlay.
-@details
-    Usually the entire overlay scales with scale().
-    Here we obviously have to adjust this.
-*/
-void HUDNavigation::sizeChanged()
-{
-    // Use size to compensate for aspect ratio if enabled.
-    float xScale = this->getActualSize().x;
-    float yScale = this->getActualSize().y;
-
-    for ( ObjectMap::iterator it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
-    {
-        if ( it->second.panel_ != NULL )
-            it->second.panel_->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
-        if ( it->second.text_ != NULL )
-            it->second.text_->setCharHeight ( it->second.text_->getCharHeight() * yScale );
-    }
-}
-
-void HUDNavigation::addObject ( RadarViewable* object )
-{
-    if( showObject(object)==false )
-        return;
-
-    if ( activeObjectList_.size() >= markerLimit_ )
-        if ( object == NULL )
-            return;
-
-    // Object hasn't been added yet (we know that)
-    assert ( this->activeObjectList_.find ( object ) == this->activeObjectList_.end() );
-
-    // Scales used for dimensions and text size
-    float xScale = this->getActualSize().x;
-    float yScale = this->getActualSize().y;
-
-    // Create everything needed to display the object on the radar and add it to the map
-
-    // Create arrow/marker
-    Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*> ( Ogre::OverlayManager::getSingleton()
-                                       .createOverlayElement ( "Panel", "HUDNavigation_navMarker_" + getUniqueNumberString() ) );
-//     panel->setMaterialName ( "Orxonox/NavTDC" );
-    panel->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", object->getRadarObjectColour()) );
-    panel->setDimensions ( navMarkerSize_ * xScale, navMarkerSize_ * yScale );
-//     panel->setColour( object->getRadarObjectColour() );
-
-    Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*> ( Ogre::OverlayManager::getSingleton()
-                                         .createOverlayElement ( "TextArea", "HUDNavigation_navText_" + getUniqueNumberString() ) );
-    text->setFontName ( this->fontName_ );
-    text->setCharHeight ( text->getCharHeight() * yScale );
-    text->setColour( object->getRadarObjectColour() );
-
-    panel->hide();
-    text->hide();
-
-    ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
-    activeObjectList_[object] = tempStruct;
-
-    this->background_->addChild ( panel );
-    this->background_->addChild ( text );
-
-    sortedObjectList_.push_front ( std::make_pair ( object, ( unsigned int ) 0 ) );
-
-
-}
-
-void HUDNavigation::removeObject ( RadarViewable* viewable )
-{
-    ObjectMap::iterator it = activeObjectList_.find ( viewable );
-
-    if ( activeObjectList_.find ( viewable ) != activeObjectList_.end() )
-    {
-        // Detach overlays
-        this->background_->removeChild ( it->second.panel_->getName() );
-        this->background_->removeChild ( it->second.text_->getName() );
-        // Properly destroy the overlay elements (do not use delete!)
-        Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.panel_ );
-        Ogre::OverlayManager::getSingleton().destroyOverlayElement ( it->second.text_ );
-        // Remove from the list
-        activeObjectList_.erase ( viewable );
-
-
-    }
-
-    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
-    {
-        if ( (listIt->first) == viewable )
-        {
-            sortedObjectList_.erase ( listIt );
-            break;
-        }
-
-    }
-
-}
-
-void HUDNavigation::objectChanged(RadarViewable* viewable)
-{
-    // TODO: niceification neccessary ;)
-    removeObject(viewable);
-    addObject(viewable);
-}
-
-
-bool HUDNavigation::showObject(RadarViewable* rv)
-{
-    if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
-        return false;
-    assert( rv->getWorldEntity() );
-    if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
-        return false;
-    return true;
-}
-
-void HUDNavigation::changedOwner()
-{
-
-    const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
-    for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it )
-    {
-        if ( ! ( *it )->isHumanShip_ )
-            this->addObject ( *it );
-    }
-}
-
-}
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 9348)
@@ -36,5 +36,4 @@
 #include <string>
 
-
 #include "util/OgreForwardRefs.h"
 #include "tools/interfaces/Tickable.h"
@@ -44,77 +43,76 @@
 namespace orxonox
 {
-class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
-{
-public:
-    HUDNavigation ( BaseObject* creator );
-    virtual ~HUDNavigation();
+    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
+    {
+        public:
+            HUDNavigation(BaseObject* creator);
+            virtual ~HUDNavigation();
 
-    void setConfigValues();
+            void setConfigValues();
 
-    virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
-    virtual void tick ( float dt );
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
 
-    // RadarListener interface
-    virtual void addObject ( RadarViewable* object );
-    virtual void removeObject ( RadarViewable* viewable );
-    virtual void objectChanged ( RadarViewable* viewable );
+            // RadarListener interface
+            virtual void addObject(RadarViewable* object);
+            virtual void removeObject(RadarViewable* viewable);
+            virtual void objectChanged(RadarViewable* viewable);
 
-    virtual void changedOwner();
-    virtual void sizeChanged();
-    virtual void angleChanged() { }
-    virtual void positionChanged() { }
-    virtual void radarTick ( float dt ) {}
+            virtual void changedOwner();
+            virtual void sizeChanged();
+            virtual void angleChanged() { }
+            virtual void positionChanged() { }
+            virtual void radarTick(float dt) {}
 
-    inline float getRadarSensitivity() const
-    { return 1.0f; }
+            inline float getRadarSensitivity() const
+                { return 1.0f; }
 
-    unsigned int getMarkerLimit() { return this->markerLimit_; }
+            inline unsigned int getMarkerLimit() const
+                { return this->markerLimit_; }
 
-private:
-    struct ObjectInfo
-    {
-        Ogre::PanelOverlayElement* panel_;
-        Ogre::TextAreaOverlayElement* text_;
-        bool outOfView_;
-        bool wasOutOfView_;
+        private:
+            struct ObjectInfo
+            {
+                Ogre::PanelOverlayElement* panel_;
+                Ogre::TextAreaOverlayElement* text_;
+                bool outOfView_;
+                bool wasOutOfView_;
+            };
 
+            bool showObject(RadarViewable* rv);
+
+            // XMLPort accessors
+            inline void setNavMarkerSize(float size)
+            {
+                navMarkerSize_ = size;
+                this->sizeChanged();
+            }
+            inline float getNavMarkerSize() const
+                { return navMarkerSize_; }
+            inline void setDetectionLimit(float limit)
+                { this->detectionLimit_ = limit; }
+            inline float getDetectionLimit() const
+                { return this->detectionLimit_; }
+
+            void setTextSize(float size);
+            float getTextSize() const;
+
+            void setFont(const std::string& font);
+            const std::string& getFont() const;
+
+            float getArrowSizeX(int dist) const;
+            float getArrowSizeY(int dist) const;
+
+            std::map<RadarViewable*, ObjectInfo> activeObjectList_;
+            std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
+
+            float navMarkerSize_;
+            std::string fontName_;
+            float textSize_;
+            bool showDistance_;
+
+            unsigned int markerLimit_;
+            float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
     };
-
-    bool showObject( RadarViewable* rv );
-
-    // XMLPort accessors
-    void setNavMarkerSize ( float size )
-        { navMarkerSize_ = size; this->sizeChanged(); }
-    float getNavMarkerSize() const
-        { return navMarkerSize_; }
-    void setDetectionLimit( float limit ) 
-        { this->detectionLimit_ = limit; } 
-    float getDetectionLimit() const 
-        { return this->detectionLimit_; }
-
-    void setTextSize ( float size );
-    float getTextSize() const;
-
-    void setFont ( const std::string& font );
-    const std::string& getFont() const;
-
-    typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
-    ObjectMap activeObjectList_;
-
-    typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
-    sortedList sortedObjectList_;
-
-    float getArrowSizeX(int dist);    
-    float getArrowSizeY(int dist);
-
-    float navMarkerSize_;
-    std::string fontName_;
-    float textSize_;
-    bool showDistance;
-
-    unsigned int markerLimit_;
-    float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 
-
-};
 }
 
Index: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 9347)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 9348)
@@ -92,5 +92,5 @@
     void HUDRadar::addObject(RadarViewable* object)
     {
-        if (object == dynamic_cast<RadarViewable*>(this->owner_))
+        if (object == orxonox_cast<RadarViewable*>(this->owner_))
             return;
         if( showObject(object) == false ) //do not show objects that are "invisible" or "radar invisible"
@@ -189,5 +189,5 @@
     bool HUDRadar::showObject(RadarViewable* rv)
     {
-        if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
+        if ( rv == orxonox_cast<RadarViewable*> ( this->getOwner() ) )
             return false;
         assert( rv->getWorldEntity() );
Index: code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.cc	(revision 9347)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/*
- *   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 "UnderAttackHealthBar.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "infos/PlayerInfo.h"
-#include "gametypes/UnderAttack.h"
-#include "worldentities/pawns/Destroyer.h"
-#include "overlays/OverlayGroup.h"
-
-namespace orxonox
-{
-    CreateFactory(UnderAttackHealthBar);
-
-    UnderAttackHealthBar::UnderAttackHealthBar(BaseObject* creator) : HUDHealthBar(creator)
-    {
-        RegisterObject(UnderAttackHealthBar);
-
-        this->owner_ = 0;
-
-        this->text_ = new OverlayText(this);
-        this->text_->setFont("Monofur");
-        this->text_->setTextSize(0.04f);
-        this->text_->setAlignmentString("center");
-        this->text_->setColour(ColourValue::White);
-        this->text_->setPickPoint(Vector2(0.5, 0));
-
-        this->inittimer_.setTimer(0.0f, false, createExecutor(createFunctor(&UnderAttackHealthBar::init, this)));
-    }
-
-    UnderAttackHealthBar::~UnderAttackHealthBar()
-    {
-        if (this->isInitialized())
-        {
-            this->text_->destroy();
-            this->text_ = 0;
-        }
-    }
-
-    void UnderAttackHealthBar::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(UnderAttackHealthBar, XMLPort, xmlelement, mode);
-
-        XMLPortParam(UnderAttackHealthBar, "descriptionpickpoint", setDescriptionPickPoint, getDescriptionPickPoint, xmlelement, mode);
-        XMLPortParam(UnderAttackHealthBar, "descriptionoffset", setDescriptionOffset, getDescriptionOffset, xmlelement, mode);
-    }
-
-    void UnderAttackHealthBar::changedOwner()
-    {
-        SUPER(UnderAttackHealthBar, changedOwner);
-
-        PlayerInfo* player = orxonox_cast<PlayerInfo*>(this->getOwner());
-        if (player)
-        {
-            this->owner_ = player;
-
-            UnderAttack* ua = orxonox_cast<UnderAttack*>(player->getGametype().get());
-            if (ua)
-            {
-                this->setOwner(ua->getDestroyer());
-
-                if (ua->getTeam(player) == 0)
-                    this->text_->setCaption("Attack the Transporter!");
-                else
-                    this->text_->setCaption("Defend the Transporter!");
-            }
-        }
-    }
-
-    void UnderAttackHealthBar::changedOverlayGroup()
-    {
-        SUPER(UnderAttackHealthBar, changedOverlayGroup);
-
-        this->getOverlayGroup()->addElement(this->text_.get());
-    }
-
-    void UnderAttackHealthBar::init()
-    {
-        this->setOwner(this->owner_);
-    }
-}
Index: code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/UnderAttackHealthBar.h	(revision 9347)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*
- *   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 _UnderAttackHealthBar_H__
-#define _UnderAttackHealthBar_H__
-
-#include "overlays/OverlaysPrereqs.h"
-
-#include "util/Math.h"
-#include "tools/Timer.h"
-#include "HUDHealthBar.h"
-
-namespace orxonox
-{
-    class _OverlaysExport UnderAttackHealthBar : public HUDHealthBar
-    {
-        public:
-            UnderAttackHealthBar(BaseObject* creator);
-            virtual ~UnderAttackHealthBar();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void changedOwner();
-            virtual void changedOverlayGroup();
-
-            inline void setDescriptionPickPoint(const Vector2& pickpoint)
-                { this->text_->setPickPoint(pickpoint); }
-            inline Vector2 getDescriptionPickPoint() const
-                { return this->text_->getPickPoint(); }
-
-            inline void setDescriptionOffset(const Vector2& position)
-                { this->text_->setPosition(this->getPosition() + (position - this->getPickPoint()) * this->getSize()); }
-            inline Vector2 getDescriptionOffset() const
-                { return (this->text_->getPosition() - this->getPosition()) / this->getSize() + this->getPickPoint(); }
-
-        private:
-            void init();
-
-            PlayerInfo* owner_;
-            SmartPtr<OverlayText> text_;
-            Timer inittimer_;
-    };
-}
-#endif /* _UnderAttackHealthBar_H__ */
Index: code/trunk/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/modules/pickup/CMakeLists.txt	(revision 9348)
@@ -1,8 +1,6 @@
 SET_SOURCE_FILES(PICKUP_SRC_FILES
   CollectiblePickup.cc
-  DroppedPickup.cc
   Pickup.cc
   PickupCollection.cc
-  PickupCollectionIdentifier.cc
   PickupManager.cc
   PickupRepresentation.cc
Index: code/trunk/src/modules/pickup/CollectiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/CollectiblePickup.cc	(revision 9348)
@@ -45,9 +45,7 @@
         Registers the object and initializes variables.
     */
-    CollectiblePickup::CollectiblePickup() : isInCollection_(false)
+    CollectiblePickup::CollectiblePickup() : collection_(NULL)
     {
         RegisterObject(CollectiblePickup);
-
-        this->collection_ = NULL;
     }
 
@@ -58,49 +56,6 @@
     CollectiblePickup::~CollectiblePickup()
     {
-
-    }
-
-    /**
-    @brief
-        Is called by OrxonoxClass::destroy() before the object is actually destroyed.
-    */
-    void CollectiblePickup::preDestroy(void)
-    {
-        this->Pickupable::preDestroy();
-
-        // The PickupCollection has to be destroyed as well.
-        if(this->isInCollection())
-            this->collection_->Pickupable::destroy();
-    }
-
-    /**
-    @brief
-        Destroys a Pickupable.
-    */
-    void CollectiblePickup::destroyPickup(void)
-    {
-        if(!this->isInCollection()) // If the CollectiblePickup is not in a PickupCollection the destroyPickup method of Pickupable is called.
-            this->Pickupable::destroyPickup();
-        else // Else the ColectiblePickup is dropped and disabled,
-        {
-            this->drop(false);
-            if(this->isInCollection() && this->isEnabled()) // It is only disabled if it is enabled and still ina PickupCollection after having been dropped.
-            {
-                this->setDisabled();
-                this->collection_->pickupDisabled();
-            }
-        }
-    }
-
-    /**
-    @brief
-        Is called by the PickupCarrier when it is being destroyed.
-    */
-    void CollectiblePickup::carrierDestroyed(void)
-    {
-        if(!this->isInCollection())
-            this->Pickupable::destroy();
-        else // If the CollectiblePickup is part of a PickupCollection it is just dropped instead of destroyed.
-            this->drop(false);
+        if (this->isInCollection())
+            this->collection_->removePickupable(this);
     }
 
@@ -131,35 +86,20 @@
     /**
     @brief
-        Adds this CollectiblePickup to the input PickupCollection.
+        Notifies this CollectiblePickup that it was added to a PickupCollection.
     @param collection
         A pointer to the PickupCollection to which the CollectiblePickup should be added.
-    @return
-        Returns true if the CollectiblePickup was successfully added to the PickupCollection.
     */
-    bool CollectiblePickup::addToCollection(PickupCollection* collection)
+    void CollectiblePickup::wasAddedToCollection(PickupCollection* collection)
     {
-        if(this->isInCollection() || collection == NULL) //If the CollectiblePickup already is in a PickupCollection or if the input pointer is NULL.
-            return false;
-
-        this->isInCollection_ = true;
         this->collection_ = collection;
-        return true;
     }
 
     /**
     @brief
-        Removes this CollectiblePickup from its PickupCollection.
-    @return
-        Returns true if the CollectiblePickup was succcessfully removed.
+        Notifies this CollectiblePickup that it was removed from its PickupCollection.
     */
-    bool CollectiblePickup::removeFromCollection(void)
+    void CollectiblePickup::wasRemovedFromCollection(void)
     {
-        if(!this->isInCollection()) //If the CollectiblePickup is not in a PickupCollection.
-            return false;
-
-        this->isInCollection_ = false;
         this->collection_ = NULL;
-        return true;
     }
-
 }
Index: code/trunk/src/modules/pickup/CollectiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/CollectiblePickup.h	(revision 9348)
@@ -55,4 +55,5 @@
     class _PickupExport CollectiblePickup : public Pickupable
     {
+        friend class PickupCollection;
 
         public:
@@ -68,19 +69,11 @@
             */
             bool isInCollection(void) const
-                { return this->isInCollection_; }
-
-            bool addToCollection(PickupCollection* collection); //!< Adds this CollectiblePickup to the input PickupCollection.
-            bool removeFromCollection(void); //!< Removes this CollectiblePickup from its PickupCollection.
-
-            void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
-
-        protected:
-            virtual void preDestroy(void); //!< Is called by OrxonoxClass::destroy() before the object is actually destroyed.
-            virtual void destroyPickup(void); //!< Destroys a Pickupable.
+                { return this->collection_ != NULL; }
 
         private:
-            bool isInCollection_; //!< True if the CollectiblePickup is in a PickupCollection.
+            void wasAddedToCollection(PickupCollection* collection);
+            void wasRemovedFromCollection(void);
+
             PickupCollection* collection_; //!< A pointer to the PickupCollection this CollectiblePickup is in.
-
     };
 }
Index: code/trunk/src/modules/pickup/DroppedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.cc	(revision 9347)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/*
- *   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:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-/**
-    @file DroppedPickup.cc
-    @brief Implementation of the DroppedPickup class.
-*/
-
-#include "DroppedPickup.h"
-
-#include "core/CoreIncludes.h"
-
-#include "interfaces/Pickupable.h"
-#include "interfaces/PickupCarrier.h"
-
-namespace orxonox
-{
-
-    CreateFactory(DroppedPickup);
-
-    /**
-    @brief
-        Default constructor. Registers object and sets default values.
-    */
-    DroppedPickup::DroppedPickup(BaseObject* creator) : PickupSpawner(creator)
-    {
-        RegisterObject(DroppedPickup);
-    }
-
-    /**
-    @brief
-        Constructor. Registers the object and sets values.
-    @param creator
-        The creator of the DroppedPickup.
-    @param pickup
-        The Pickupable that was dropped.
-    @param carrier
-        The PickupCarrier that carried the input pickup before it was dropped.
-    @param triggerDistance
-        The distance at which the PickupSpawner triggers. Default is 10.
-    */
-    DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 5, 1)
-    {
-        RegisterObject(DroppedPickup);
-
-        this->setPosition(carrier->getCarrierPosition());
-        this->block(carrier, DEFAULT_BLOCKED_TIME);
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    DroppedPickup::~DroppedPickup()
-    {
-
-    }
-
-    /**
-    @brief
-        Creates the Pickupable that is going to get picked up.
-        In the case of the DroppedItem it is the one and only Pickupable that was dropped. No additional Pickupables of the same type are created.
-    */
-    Pickupable* DroppedPickup::getPickup(void)
-    {
-        Pickupable* pickup = this->pickup_;
-        this->pickup_ = NULL;
-        return pickup;
-    }
-
-}
Index: code/trunk/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.h	(revision 9347)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*
- *   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:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-/**
-    @file DroppedPickup.h
-    @brief Definition of the DroppedPickup class.
-    @ingroup Pickup
-*/
-
-#ifndef _DroppedPickup_H__
-#define _DroppedPickup_H__
-
-#include "PickupPrereqs.h"
-
-#include "PickupSpawner.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        Special PickupSpawner that is created when a @ref orxonox::Pickupable "Pickupable" is dropped. It just spawns one pickup, the one that was dropped.
-
-    @author
-        Daniel 'Huty' Haggenmueller
-    @author
-        Damian 'Mozork' Frick
-
-    @ingroup Pickup
-    */
-    class _PickupExport DroppedPickup : public PickupSpawner
-    {
-        public:
-            DroppedPickup(BaseObject* creator);
-            DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0); //!< Constructor.
-            virtual ~DroppedPickup();
-
-        protected:
-            virtual Pickupable* getPickup(void); //!< Creates the Pickupable that is going to get picked up.
-
-        private:
-            static const unsigned int DEFAULT_BLOCKED_TIME = 10; //!< The default time a PickupCarrier is blocked from picking up the pickupable again, after it has dropped it.
-
-    };
-}
-
-#endif /* _DroppedPickup_H__ */
Index: code/trunk/src/modules/pickup/Pickup.cc
===================================================================
--- code/trunk/src/modules/pickup/Pickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/Pickup.cc	(revision 9348)
@@ -37,7 +37,5 @@
 #include "util/StringUtils.h"
 
-#include "pickup/PickupIdentifier.h"
-
-#include "DroppedPickup.h"
+#include "PickupSpawner.h"
 
 namespace orxonox
@@ -86,19 +84,4 @@
     /**
     @brief
-        Initializes the PickupIdentififer of this Pickup.
-    */
-    void Pickup::initializeIdentifier(void)
-    {
-        std::string val1 = this->getActivationType();
-        std::string type1 = "activationType";
-        this->pickupIdentifier_->addParameter(type1, val1);
-
-        std::string val2 = this->getDurationType();
-        std::string type2 = "durationType";
-        this->pickupIdentifier_->addParameter(type2, val2);
-    }
-
-    /**
-    @brief
         Method for creating a Pickup object through XML.
     */
@@ -107,8 +90,7 @@
         SUPER(Pickup, XMLPort, xmlelement, mode);
 
-        XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
-        XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
-
-        this->initializeIdentifier();
+        XMLPortParam(Pickup, "representation", setRepresentationName, getRepresentationName, xmlelement, mode);
+        XMLPortParam(Pickup, "activationType", setActivationTypeAsString, getActivationTypeAsString, xmlelement, mode);
+        XMLPortParam(Pickup, "durationType", setDurationTypeAsString, getDurationTypeAsString, xmlelement, mode);
     }
 
@@ -119,7 +101,7 @@
         Returns a string containing the activation type.
     */
-    const std::string& Pickup::getActivationType(void) const
+    const std::string& Pickup::getActivationTypeAsString(void) const
     {
-        switch(this->activationType_)
+        switch(this->getActivationType())
         {
             case pickupActivationType::immediate:
@@ -138,7 +120,7 @@
         Returns a string containing the duration type.
     */
-    const std::string& Pickup::getDurationType(void) const
+    const std::string& Pickup::getDurationTypeAsString(void) const
     {
-        switch(this->durationType_)
+        switch(this->getDurationType())
         {
             case pickupDurationType::once:
@@ -157,10 +139,10 @@
         The activation type of the Pickup as a string.
     */
-    void Pickup::setActivationType(const std::string& type)
+    void Pickup::setActivationTypeAsString(const std::string& type)
     {
         if(type == Pickup::activationTypeImmediate_s)
-            this->activationType_ = pickupActivationType::immediate;
+            this->setActivationType(pickupActivationType::immediate);
         else if(type == Pickup::activationTypeOnUse_s)
-            this->activationType_ = pickupActivationType::onUse;
+            this->setActivationType(pickupActivationType::onUse);
         else
             orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
@@ -173,10 +155,10 @@
         The duration type of the Pickup as a string.
     */
-    void Pickup::setDurationType(const std::string& type)
+    void Pickup::setDurationTypeAsString(const std::string& type)
     {
         if(type == Pickup::durationTypeOnce_s)
-            this->durationType_ = pickupDurationType::once;
+            this->setDurationType(pickupDurationType::once);
         else if(type == Pickup::durationTypeContinuous_s)
-            this->durationType_ = pickupDurationType::continuous;
+            this->setDurationType(pickupDurationType::continuous);
         else
             orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
@@ -199,27 +181,5 @@
     /**
     @brief
-        Creates a duplicate of the OrxonoxClass.
-    @param item
-        A reference to the pointer of the item that we're duplicating.
-    */
-    void Pickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new Pickup(this);
-
-        SUPER(Pickup, clone, item);
-
-        Pickup* pickup = dynamic_cast<Pickup*>(item);
-        pickup->setActivationTypeDirect(this->getActivationTypeDirect());
-        pickup->setDurationTypeDirect(this->getDurationTypeDirect());
-
-        pickup->initializeIdentifier();
-    }
-
-    /**
-    @brief
         Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-        This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
-        DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
     @return
         Returns true if a spawner was created, false if not.
@@ -227,5 +187,5 @@
     bool Pickup::createSpawner(void)
     {
-        new DroppedPickup(this, this, this->getCarrier());
+        PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
         return true;
     }
Index: code/trunk/src/modules/pickup/Pickup.h
===================================================================
--- code/trunk/src/modules/pickup/Pickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/Pickup.h	(revision 9348)
@@ -105,9 +105,12 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
+            virtual const std::string& getRepresentationName() const
+                { return this->representationName_; }
+
             /**
             @brief Get the activation type of the Pickup.
             @return Returns the activation type of the Pickup.
             */
-            inline pickupActivationType::Value getActivationTypeDirect(void) const
+            inline pickupActivationType::Value getActivationType(void) const
                 { return this->activationType_; }
             /**
@@ -115,9 +118,9 @@
             @return Returns the duration type of the Pickup.
             */
-            inline pickupDurationType::Value getDurationTypeDirect(void) const
+            inline pickupDurationType::Value getDurationType(void) const
                 { return this->durationType_; }
 
-            const std::string& getActivationType(void) const; //!< Get the activation type of the Pickup.
-            const std::string& getDurationType(void) const; //!< Get the duration type of the Pickup.
+            const std::string& getActivationTypeAsString(void) const; //!< Get the activation type of the Pickup.
+            const std::string& getDurationTypeAsString(void) const; //!< Get the duration type of the Pickup.
 
             /**
@@ -126,5 +129,5 @@
             */
             inline bool isImmediate(void) const
-                { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
+                { return this->getActivationType() == pickupActivationType::immediate; }
             /**
             @brief Get whether the activation type is 'onUse'.
@@ -132,5 +135,5 @@
             */
             inline bool isOnUse(void) const
-                { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
+                { return this->getActivationType() == pickupActivationType::onUse; }
             /**
             @brief Get whether the duration type is 'once'.
@@ -138,5 +141,5 @@
             */
             inline bool isOnce(void) const
-                { return this->getDurationTypeDirect() == pickupDurationType::once; }
+                { return this->getDurationType() == pickupDurationType::once; }
             /**
             @brief Get whether the duration type is 'continuous'.
@@ -144,13 +147,16 @@
             */
             inline bool isContinuous(void) const
-                { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
+                { return this->getDurationType() == pickupDurationType::continuous; }
 
             virtual void changedPickedUp(void); //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the OrxonoxClass.
 
         protected:
-            void initializeIdentifier(void);
+            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
 
-            virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+            /**
+            @brief Sets the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup.
+            */
+            inline void setRepresentationName(const std::string& name)
+                { this->representationName_ = name; }
 
             /**
@@ -158,5 +164,5 @@
             @param type The activation type of the Pickup.
             */
-            inline void setActivationTypeDirect(pickupActivationType::Value type)
+            inline void setActivationType(pickupActivationType::Value type)
                 { this->activationType_ = type; }
             /**
@@ -164,13 +170,14 @@
             @param type The duration type of the Pickup.
             */
-            inline void setDurationTypeDirect(pickupDurationType::Value type)
+            inline void setDurationType(pickupDurationType::Value type)
                 { this->durationType_ = type; }
 
-            void setActivationType(const std::string& type); //!< Set the activation type of the Pickup.
-            void setDurationType(const std::string& type); //!< Set the duration type of the Pickup.
+            void setActivationTypeAsString(const std::string& type); //!< Set the activation type of the Pickup.
+            void setDurationTypeAsString(const std::string& type); //!< Set the duration type of the Pickup.
 
         private:
             void initialize(void); //!< Initializes the member variables.
 
+            std::string representationName_; //!< The name of the associated PickupRepresentation.
             pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
             pickupDurationType::Value durationType_; //!< The duration type of the Pickup.
Index: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupCollection.cc	(revision 9348)
@@ -38,6 +38,5 @@
 
 #include "CollectiblePickup.h"
-#include "DroppedPickup.h"
-#include "PickupCollectionIdentifier.h"
+#include "PickupSpawner.h"
 
 #include "PickupCollection.h"
@@ -54,12 +53,8 @@
         The creator of the object.
     */
-    PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator), pickupCollectionIdentifier_(NULL)
+    PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator)
     {
         RegisterObject(PickupCollection);
 
-        this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(this);
-        this->usedCounter_ = 0;
-        this->pickedUpCounter_ = 0;
-        this->disabledCounter_ = 0;
         this->processingUsed_ = false;
         this->processingPickedUp_ = false;
@@ -70,16 +65,13 @@
         Destructor. Iterates through all Pickupables this PickupCollection consists of and destroys them if they haven't been already.
     */
-    PickupCollection::~ PickupCollection()
+    PickupCollection::~PickupCollection()
     {
         // Destroy all Pickupables constructing this PickupCollection.
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            (*it)->removeFromCollection();
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+        {
+            (*it)->wasRemovedFromCollection();
             (*it)->destroy();
         }
         this->pickups_.clear();
-        
-        if(this->pickupCollectionIdentifier_ != NULL)
-            delete this->pickupCollectionIdentifier_;
     }
 
@@ -92,19 +84,6 @@
         SUPER(PickupCollection, XMLPort, xmlelement, mode);
 
+        XMLPortParam(PickupCollection, "representation", setRepresentationName, getRepresentationName, xmlelement, mode);
         XMLPortObject(PickupCollection, CollectiblePickup, "pickupables", addPickupable, getPickupable, xmlelement, mode);
-
-        this->initializeIdentifier();
-    }
-
-    /**
-    @brief
-        Initializes the PickupIdentifier for this pickup.
-    */
-    void PickupCollection::initializeIdentifier(void)
-    {
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            this->pickupCollectionIdentifier_->addPickup((*it)->getPickupIdentifier());
-        }
     }
 
@@ -120,5 +99,5 @@
         this->processingUsed_ = true;
         // Change used for all Pickupables this PickupCollection consists of.
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
             (*it)->setUsed(this->isUsed());
 
@@ -138,10 +117,20 @@
             return;
 
+        size_t numPickupsEnabled = 0;
+        size_t numPickupsInUse = 0;
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+        {
+            if ((*it)->isEnabled())
+                ++numPickupsEnabled;
+            if ((*it)->isUsed())
+                ++numPickupsInUse;
+        }
+
         // If all the pickups are not in use but the PickupCollection is.
-        if(this->usedCounter_ == 0 && this->isUsed())
+        if(numPickupsInUse == 0 && this->isUsed())
             this->setUsed(false);
 
         // If all the enabled pickups are in use but the PickupCollection is not.
-        if(this->usedCounter_ != 0 && this->usedCounter_ == this->pickups_.size()-this->disabledCounter_ && !this->isUsed())
+        if(numPickupsInUse > 0 && numPickupsInUse == numPickupsEnabled && !this->isUsed())
             this->setUsed(true);
     }
@@ -157,5 +146,5 @@
 
         // Change the PickupCarrier for all Pickupables this PickupCollection consists of.
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
         {
             if(this->getCarrier() == NULL)
@@ -177,6 +166,6 @@
         this->processingPickedUp_ = true;
         // Change the pickedUp status for all Pickupables this PickupCollection consists of.
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-            (*it)->setPickedUp(this->isPickedUp());
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); )
+            (*(it++))->setPickedUp(this->isPickedUp());
 
         this->processingPickedUp_ = false;
@@ -195,37 +184,16 @@
             return;
 
-        // If at least all the enabled pickups of this PickupCollection are no longer picked up. 
-        if(this->pickedUpCounter_ <= this->disabledCounter_ && this->isPickedUp())
+        // If at least all the enabled pickups of this PickupCollection are no longer picked up.
+        bool isOnePickupEnabledAndPickedUp = false;
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+        {
+            if ((*it)->isEnabled() && (*it)->isPickedUp())
+            {
+                isOnePickupEnabledAndPickedUp = true;
+                break;
+            }
+        }
+        if(!isOnePickupEnabledAndPickedUp && this->isPickedUp())
             this->Pickupable::destroy();
-
-        // If the PickupCollection is no longer picked up.
-        if(!this->isPickedUp())
-            this->pickedUpCounter_ = 0;
-    }
-
-    /**
-    @brief
-        Creates a duplicate of the input Pickupable.
-        This method needs to be implemented by any Class inheriting from Pickupable.
-    @param item
-        A reference to a pointer to the OrxonoxClass that is to be duplicated.
-    */
-    void PickupCollection::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new PickupCollection(this);
-
-        SUPER(PickupCollection, clone, item);
-
-        PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
-        // Clone all Pickupables this PickupCollection consist of.
-        for(std::vector<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            Pickupable* newPickup = (*it)->clone();
-            CollectiblePickup* collectible = static_cast<CollectiblePickup*>(newPickup);
-            pickup->addPickupable(collectible);
-        }
-
-        pickup->initializeIdentifier();
     }
 
@@ -240,5 +208,5 @@
     bool PickupCollection::isTarget(const PickupCarrier* carrier) const
     {
-        for(std::vector<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        for(std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
         {
             if(!carrier->isTarget(*it))
@@ -247,16 +215,4 @@
 
         return true;
-    }
-
-    /**
-    @brief
-        Get the PickupIdentifier of this PickupCollection.
-        This is in fact the PickupCollectionIdentifier.
-    @return
-        Returns a pointer to the PickupIdentifier of this PickupCollection.
-    */
-    const PickupIdentifier* PickupCollection::getPickupIdentifier(void) const
-    {
-        return this->pickupCollectionIdentifier_;
     }
 
@@ -274,6 +230,7 @@
             return false;
 
-        pickup->addToCollection(this);
         this->pickups_.push_back(pickup);
+        pickup->wasAddedToCollection(this);
+        this->pickupsChanged();
         return true;
     }
@@ -289,5 +246,33 @@
     const Pickupable* PickupCollection::getPickupable(unsigned int index) const
     {
-        return this->pickups_[index];
+        if(this->pickups_.size() >= index)
+            return NULL;
+
+        std::list<CollectiblePickup*>::const_iterator it = this->pickups_.begin();
+        std::advance(it, index);
+        return *it;
+    }
+
+    /**
+    @brief
+        Removes the Pickup from the Collection.
+    @param pickup
+        The Pickup to be removed.
+    @return
+        Returns true if the pickup was in the collection.
+    */
+    bool PickupCollection::removePickupable(CollectiblePickup* pickup)
+    {
+        for(std::list<CollectiblePickup*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); ++it)
+        {
+            if (*it == pickup)
+            {
+                this->pickups_.erase(it);
+                pickup->wasRemovedFromCollection();
+                this->pickupsChanged();
+                return true;
+            }
+        }
+        return false;
     }
 
@@ -297,13 +282,8 @@
         This is used internally by the CollectiblePickup class.
     @param changed
-        The value the used status has changed to. 
+        The value the used status has changed to.
     */
     void PickupCollection::pickupChangedUsed(bool changed)
     {
-        if(changed)
-            this->usedCounter_++;
-        else
-            this->usedCounter_--;
-
         this->changedUsedAction();
     }
@@ -318,9 +298,4 @@
     void PickupCollection::pickupChangedPickedUp(bool changed)
     {
-        if(changed)
-            this->pickedUpCounter_++;
-        else
-            this->pickedUpCounter_--;
-
         this->changedPickedUpAction();
     }
@@ -333,5 +308,14 @@
     void PickupCollection::pickupDisabled(void)
     {
-        this->disabledCounter_++;
+    }
+
+    /**
+    @brief
+        Helpfer function if the number of pickups in this collection has changed.
+    */
+    void PickupCollection::pickupsChanged(void)
+    {
+        this->changedUsedAction();
+        this->changedPickedUpAction();
     }
 
@@ -339,6 +323,4 @@
     @brief
         Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-        This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
-        DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
     @return
         Returns true if a spawner was created, false if not.
@@ -346,5 +328,5 @@
     bool PickupCollection::createSpawner(void)
     {
-        new DroppedPickup(this, this, this->getCarrier());
+        PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
         return true;
     }
Index: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupCollection.h	(revision 9348)
@@ -50,6 +50,4 @@
         The PickupCollection combines different @ref orxonox::Pickupable "Pickupables" (more precisely @ref orxonox::CollectiblePickup "CollectiblePickups") to a coherent, single pickup and makes them seem (from the outside looking in) just as if they were just one @ref orxonox::Pickupable "Pickupable".
 
-        To differentiate between different types of @ref orxonox::PickupCollection "PickupCollections" (just as we differentiate between different types of @ref orxonox::Pickupable "Pickupables") we define a new identifyer called the @ref orxonox::PickupCollectionIdentifier "PickupCollectionIdentifier" which has pretty much the same properties as the @ref orxonox::PickupIdentifier "PickupIdentifier" but extende to @ref orxonox::PickupCollection "PickupCollections".
-
         A PickupCollection can be created in XML as follows:
         @code
@@ -81,12 +79,17 @@
             virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
 
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input pickup.
-
             virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
 
-            virtual const PickupIdentifier* getPickupIdentifier(void) const; //!< Get the PickupIdentifier of this PickupCollection.
+            inline void setRepresentationName(const std::string& name)
+                { this->representationName_ = name; }
+            virtual const std::string& getRepresentationName() const
+                { return this->representationName_; }
 
             bool addPickupable(CollectiblePickup* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
             const Pickupable* getPickupable(unsigned int index) const; //!< Get the Pickupable at the given index.
+            bool removePickupable(CollectiblePickup* pickup); //!< Removes the input Pickupable from the list of Pickupables in this PickupCollection.
+
+            inline const std::list<CollectiblePickup*>& getPickups() const
+                { return this->pickups_; }
 
             void pickupChangedUsed(bool changed); //!< Informs the PickupCollection, that one of its pickups has changed its used status to the input value.
@@ -95,19 +98,13 @@
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
-
             virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-
-            PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
 
         private:
             void changedUsedAction(void); //!< Helper method.
             void changedPickedUpAction(void); //!< Helper method.
+            void pickupsChanged(void); //!< Helper method.
 
-            std::vector<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
-
-            unsigned int usedCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are in use.
-            unsigned int pickedUpCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are picked up.
-            unsigned int disabledCounter_; //!< Keeps track of the number of pickups of this PickupCollection, that are disabled.
+            std::string representationName_; //!< The name of the associated PickupRepresentation.
+            std::list<CollectiblePickup*> pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
 
             bool processingUsed_; //!< Boolean to ensure, that the PickupCollection doesn't update its used status while its internal state is inconsistent.
Index: code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc	(revision 9347)
+++ 	(revision )
@@ -1,112 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
-*/
-
-/**
-    @file PickupCollectionIdentifier.cc
-    @brief Implementation of PickupCollectionIdentifier.
-*/
-
-#include "core/CoreIncludes.h"
-
-#include "PickupCollectionIdentifier.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        Constructor. Registers the object.
-    */
-    PickupCollectionIdentifier::PickupCollectionIdentifier(Pickupable* pickup) : PickupIdentifier(pickup)
-    {
-        RegisterObject(PickupCollectionIdentifier);
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    PickupCollectionIdentifier::~PickupCollectionIdentifier()
-    {
-
-    }
-
-    /**
-    @brief
-        Compares a PickupCollectionIdentifier with a PickupIdentifier and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b), where a is a PickupCollectionIdentifier and b is just some PickupIdentifier.
-    @param identifier
-        Pointer to the second PickupIdentifier, b.
-    @return
-        Returns an integer. 0 if the two compared PickupIdentifiers are the same, <0 if a < b and >0 if a > b.
-    */
-    int PickupCollectionIdentifier::compare(const PickupIdentifier* identifier) const
-    {
-        assert(identifier);
-
-        // Slight un-niceity to cast the const PickupIdentifier to a const PickupCollectionIdentifier, but since we cast to a const, there is no harm done.
-        PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier);
-        const PickupCollectionIdentifier* collectionIdentifier = orxonox_cast<PickupCollectionIdentifier*>(temp);
-
-        // If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
-        if(collectionIdentifier == NULL)
-        {
-            return this->PickupIdentifier::compare(identifier);
-        }
-
-        // If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
-        if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
-            return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
-
-        // Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
-        std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin();
-        for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++)
-        {
-
-            if((*it)->compare(*it2) < 0)
-                return -1;
-            if((*it2)->compare(*it) < 0)
-                return 1;
-        }
-
-        // This means they are equal.
-        return 0;
-    }
-
-    /**
-    @brief
-        Add a Pickupable to the PickupCollectionIdentifier.
-    @param identifier
-        A pointer to the PickupIdentifier of the Pickupable to be added.
-    */
-    void PickupCollectionIdentifier::addPickup(const PickupIdentifier* identifier)
-    {
-        this->identifiers_.insert(identifier);
-    }
-
-}
-
Index: code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.h	(revision 9347)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
-*/
-
-/**
-    @file PickupCollectionIdentifier.h
-    @brief Declaration of PickupCollectionIdentifier.
-    @ingroup Pickup
-*/
-
-#ifndef _PickupCollectionIdentifier_H__
-#define _PickupCollectionIdentifier_H__
-
-#include "PickupPrereqs.h"
-
-#include <set>
-
-#include "pickup/PickupIdentifier.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        The PickupCollectionIdentifier is the specialization of the PickupIdentifier for the @ref orxonox::PickupCollection "PickupCollection" class.
-        It identifies @ref orxonox::PickupCollection "PickupCollections" based on the different @ref orxonox::CollectiblePickup "CollectiblePickups" they consist of.
-
-        @ref orxonox::Pickupable "Pickupables" (resp. @ref orxonox::CollectiblePickup "CollectiblePickups") can be added to the PickupCollectionIdentifier via the addPickup method.
-
-    @author
-        Damian 'Mozork' Frick
-
-    @ingroup Pickup
-    */
-    class _PickupExport PickupCollectionIdentifier : public PickupIdentifier
-    {
-
-        public:
-            PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor.
-            ~PickupCollectionIdentifier(); //!< Destructor.
-
-            virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier.
-
-            void addPickup(const PickupIdentifier* identifier); //!< Add a @ref orxonox::Pickupable "Pickupable" to the PickupCollectionIdentifier.
-
-        private:
-            std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the @ref orxonox::Pickupable "Pickupables", the @ref orxonox::PickupCollection "PickupCollection" with this PickupCollectionIdentifier consists of, ordered by the rule set by @ref orxonox::PickupIdentifierCompare "PickupIdentifierCompare".
-
-    };
-
-}
-
-#endif // _PickupCollectionIdentifier_H__
Index: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupManager.cc	(revision 9348)
@@ -87,5 +87,4 @@
 
         this->representations_.clear();
-        this->representationsNetworked_.clear();
 
         // Destroying all the PickupInventoryContainers that are still there.
@@ -106,8 +105,7 @@
     /**
     @brief
-        Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents, on the server (or in standalone mode).
-        For every type of Pickupable (uniquely identified by a PickupIdentifier) there can be one (and just one) PickupRepresentation registered.
-    @param identifier
-        The PickupIdentifier identifying the Pickupable.
+        Registers a PickupRepresentation.
+    @param name
+        The representation's name.
     @param representation
         A pointer to the PickupRepresentation.
@@ -115,14 +113,13 @@
         Returns true if successful and false if not.
     */
-    bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
-    {
-        assert(identifier);
+    bool PickupManager::registerRepresentation(const std::string& name, PickupRepresentation* representation)
+    {
         assert(representation);
 
         // If the list is not empty and Pickupable already has a Representation registered.
-        if(!this->representations_.empty() && this->representations_.find(identifier) != this->representations_.end())
+        if(!this->representations_.empty() && this->representations_.find(name) != this->representations_.end())
             return false;
 
-        this->representations_[identifier] = representation;
+        this->representations_[name] = representation;
 
         orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " registered with the PickupManager." << endl;
@@ -132,18 +129,13 @@
     /**
     @brief
-        Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents, on the server (or in standalone mode).
-    @param identifier
-        The PickupIdentifier identifying the Pickupable.
-    @param representation
-        A pointer to the PickupRepresentation.
+        Unegisters a PickupRepresentation.
+    @param name
+        The representation's name.
     @return
         Returns true if successful and false if not.
     */
-    bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
-    {
-        assert(identifier);
-        assert(representation);
-
-        std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
+    bool PickupManager::unregisterRepresentation(const std::string& name)
+    {
+        std::map<std::string, PickupRepresentation*>::iterator it = this->representations_.find(name);
         if(it == this->representations_.end()) // If the Pickupable is not registered in the first place.
             return false;
@@ -151,5 +143,5 @@
         this->representations_.erase(it);
 
-        orxout(verbose, context::pickups) << "PickupRepresentation &" << representation << " unregistered with the PickupManager." << endl;
+        orxout(verbose, context::pickups) << "PickupRepresentation &" << name << " unregistered with the PickupManager." << endl;
         return true;
     }
@@ -157,54 +149,14 @@
     /**
     @brief
-        Registers a PickupRepresentation on the host it was created.
-    @param representation
-        A pointer to the PickupRepresentation.
-    @return
-        Returns true if successful, false if not.
-    */
-    bool PickupManager::registerRepresentation(PickupRepresentation* representation)
-    {
-        assert(representation);
-
-        // If the list is not empty and PickupRepresentation is already registered.
-        if(!this->representationsNetworked_.empty() && this->representationsNetworked_.find(representation->getObjectID()) != this->representationsNetworked_.end())
-            return false;
-
-        this->representationsNetworked_[representation->getObjectID()] = representation;
-        return true;
-    }
-
-    /**
-    @brief
-        Unregisters a PickupRepresentation on the host it is being destroyed (which is the same host on which it was created).
-    @param representation
-        A pointer to the Pickuprepresentation.
-    @return
-        Returns true if successful, false if not.
-    */
-    bool PickupManager::unregisterRepresentation(PickupRepresentation* representation)
-    {
-        assert(representation);
-
-        std::map<uint32_t, PickupRepresentation*>::iterator it = this->representationsNetworked_.find(representation->getObjectID());
-        if(it == this->representationsNetworked_.end()) // If the Pickupable is not registered in the first place.
-            return false;
-
-        this->representationsNetworked_.erase(it);
-        return true;
-    }
-
-    /**
-    @brief
-        Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
-    @param identifier
-        The PickupIdentifier.
+        Get the PickupRepresentation with the given name.
+    @param name
+        The name of the PickupRepresentation.
     @return
         Returns a pointer to the PickupRepresentation.
     */
-    PickupRepresentation* PickupManager::getRepresentation(const PickupIdentifier* identifier)
-    {
-        std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier);
-        if(it == this->representations_.end()) // If there is no PickupRepresentation associated with the input PickupIdentifier.
+    PickupRepresentation* PickupManager::getRepresentation(const std::string& name)
+    {
+        std::map<std::string, PickupRepresentation*>::iterator it = this->representations_.find(name);
+        if(it == this->representations_.end()) // If there is no PickupRepresentation associated with the input name.
         {
             orxout(verbose, context::pickups) << "PickupManager::getRepresentation() returned default representation." << endl;
@@ -353,8 +305,8 @@
         {
             // If there is no PickupRepresentation registered the default representation is used.
-            if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
-                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
+            if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
+                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickup->getRepresentationName(), pickedUp);
             else
-                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
+                PickupManager::pickupChangedPickedUpNetwork(index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickup->getRepresentationName(), pickedUp);
         }
         // If the concerned host is somewhere in the network, we call pickupChangedPickedUpNetwork() on its PickupManager.
@@ -362,5 +314,5 @@
         {
             // If there is no PickupRepresentation registered the default representation is used.
-            if(this->representations_.find(pickup->getPickupIdentifier()) == this->representations_.end())
+            if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
             {
                 callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
@@ -368,5 +320,5 @@
             else
             {
-                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getPickupIdentifier()]->getObjectID(), pickedUp);
+                callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
             }
         }
@@ -388,5 +340,5 @@
         The pickedUp status the Pickupable changed to.
     */
-    /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, bool pickedUp)
+    /*static*/ void PickupManager::pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp)
     {
         PickupManager& manager = PickupManager::getInstance(); // Get the PickupManager singleton on this host.
@@ -402,4 +354,5 @@
             container->unusable = false;
             container->representationObjectId = representationObjectId;
+            container->representationName = representationName;
             // Insert the container into the pickupInventoryContainers_ list.
             manager.pickupInventoryContainers_.insert(std::pair<uint32_t, PickupInventoryContainer*>(pickup, container));
@@ -417,34 +370,4 @@
             manager.updateGUI(); // Tell the PickupInventory that something has changed.
         }
-    }
-
-    /**
-    @brief
-        Get the PickupRepresentation of an input Pickupable.
-        This method spares us the hassle to export the PickupIdentifier class to lua.
-    @param pickup
-        The number identifying the Pickupable whose PickupRepresentation should be returned.
-    @return
-        Returns the PickupRepresentation of the input Pickupable or NULL if an error occurred.
-    */
-    orxonox::PickupRepresentation* PickupManager::getPickupRepresentation(uint32_t pickup)
-    {
-        // Clear and rebuild the representationsNetworked_ list.
-        //TODO: Better solution?
-        this->representationsNetworked_.clear();
-        for(ObjectList<PickupRepresentation>::iterator it = ObjectList<PickupRepresentation>::begin(); it != ObjectList<PickupRepresentation>::end(); ++it)
-            this->representationsNetworked_[it->getObjectID()] = *it;
-
-        // Get the container belonging to the input pickup, if not found return the default representation.
-        std::map<uint32_t, PickupInventoryContainer*>::iterator it = this->pickupInventoryContainers_.find(pickup);
-        if(it == this->pickupInventoryContainers_.end())
-            return this->defaultRepresentation_;
-
-        // Get the PickupRepresentation of the input pickup (through the objecId of the representation stored in the PickupInventoryContainer belonging to the pickup), if not found return the default representation.
-        std::map<uint32_t, PickupRepresentation*>::iterator it2 = this->representationsNetworked_.find(it->second->representationObjectId);
-        if(it2 == this->representationsNetworked_.end())
-            return this->defaultRepresentation_;
-
-        return it2->second;
     }
 
Index: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupManager.h	(revision 9348)
@@ -41,6 +41,4 @@
 #include "core/WeakPtr.h"
 
-#include "pickup/PickupIdentifier.h"
-
 #include "PickupRepresentation.h"
 
@@ -67,4 +65,5 @@
         bool unusable; //!< Whether the @ref orxonox::Pickupable "Pickupable" is droppable.
         uint32_t representationObjectId; //!< The objectId of the @ref orxonox::PickupRepresentation "PickupRepresentation" that represents the @ref orxonox::Pickupable "Pickupable".
+        std::string representationName; //!< The name of the associated PickupRepresentation
     };
     // tolua_end
@@ -74,5 +73,5 @@
         The PickupManager class manages @ref orxonox::Pickupable "Pickupables".
 
-        It has in essence two tasks to fulfill. Firstly it must link @ref orxonox::Pickupable "Pickupables" (through their @ref orxonox::PickupIdentifier "PickupIdentifiers") to their respective @ref orxonox::PickupRepresentation "PickupRepresentations". Secondly it manages the PickupInventory. (The PickupInventory is the GUI that displays @ref orxonox::Pickupable "Pickupables" for the covenience of the user.)
+        It has in essence two tasks to fulfill. Firstly it must link @ref orxonox::Pickupable "Pickupables" (through their representation-name attribute) to the respective @ref orxonox::PickupRepresentation "PickupRepresentations". Secondly it manages the PickupInventory. (The PickupInventory is the GUI that displays @ref orxonox::Pickupable "Pickupables" for the covenience of the user.)
 
         @section PickupManagerTechnicalDetails Technical details
@@ -86,6 +85,5 @@
 
         Firstly there are a number of lists (where by list I really mean any kind of ordered data structure) kept.
-        - The @ref orxonox::PickupManager::representations_ "representations_" list links @ref orxonox::PickupRepresentation "PickupRepresentations" with @ref orxonox::PickupIdentifier "PickupIdentifiers" and can be used to get the @ref orxonox::PickupRepresentation "PickupRepresentation" for a given @ref orxonox::Pickupable "Pickupable". It is only populated on the server (or in standalone mode). Each @ref orxonox::PickupRepresentation "PickupRepresentation" that is generated through XML registers itself with the PickupManager and is thereby added to the list.
-        - The @ref orxonox::PickupManager::representationsNetworked_ "representationsNetworked_" list is the networked (hence the name) equivalent to the @ref orxonox::PickupManager::representations_ "representations_" list. It links an objectId of a @ref orxonox::PickupRepresentation "PickupRepresentation" to a @ref orxonox::PickupRepresentation "PickupRepresentation". This list is maintained on all hosts, each representation registers itself (in its constructor) with the PickupManager. Since the representations are synchronised they are created on each host. The "same" instance on each host is identified by the same objectId and that is why we store the representations with the objectId as key. We can then use this list to get a @ref orxonox::PickupRepresentation "PickupRepresentation" for a specific @ref orxonox::Pickupable "Pickupable" (or more precisely a number identifiying that particular pickup, but we'll see that, when we look at the next list) on a client to be used in the PickupInventory.
+        - The @ref orxonox::PickupManager::representations_ "representations_" list links @ref orxonox::PickupRepresentation "PickupRepresentations" with its name and can be used to get the @ref orxonox::PickupRepresentation "PickupRepresentation" for a given @ref orxonox::Pickupable "Pickupable". It is only populated on the server (or in standalone mode). Each @ref orxonox::PickupRepresentation "PickupRepresentation" that is generated through XML registers itself with the PickupManager and is thereby added to the list.
         - The @ref orxonox::PickupManager::pickupInventoryContainers_ "pickupInventoryContainers_" list links a number identifying a @ref orxonox::Pickupable "Pickupable" to a data structure (the @ref orxonox::PickupInventoryContainer "PickupInventoryContainer"), which contains all necessary information about that @ref orxonox::Pickupable "Pickupable". This list is maintained on all hosts, a new container is inserted when a @ref orxonox::Pickupable "Pickupable" is picked up, but only if it has been picked up by the repsective host. This list is then used by the PickupInventory to access the required information and to get the correct @ref orxonox::PickupRepresentation "PickupRepresentation".
         - The @ref orxonox::PickupManager::pickups_ "pickups_" list links a number identifiying a @ref orxonox::Pickupable "Pickupable" to a (weak pointer to a) @ref orxonox::Pickupable "Pickupable". It is only maintained by the server (or in standalone mode), to be able to use, unuse and drop @ref orxonox::Pickupable "Pickupables" through the PickupInventory. Since @ref orxonox::Pickupable "Pickupables" only exist on the server a client that wants to change a pickups status has so send a request over the network (with the number identifying the pickup) to the server and then the server facilitates the change, using this list to map from the identifyer to the actual @ref orxonox::Pickupable "Pickupable".
@@ -114,22 +112,17 @@
             static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export
 
-            bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
-            bool unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
+            bool registerRepresentation(const std::string& name, PickupRepresentation* representation);
+            bool unregisterRepresentation(const std::string& name);
 
-            bool registerRepresentation(PickupRepresentation* representation); //!< Registers a PickupRepresentation on the host it was created.
-            bool unregisterRepresentation(PickupRepresentation* representation); //!< Unregisters a PickupRepresentation on the host it is being destroyed.
-
-            PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
+            PickupRepresentation* getRepresentation(const std::string& name); // tolua_export
 
             virtual void pickupChangedUsed(Pickupable* pickup, bool used); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input used state.
             static void pickupChangedUsedNetwork(uint32_t pickup, bool inUse, bool usable, bool unusable); //!< Helper method to react to the change in the used status of a Pickupable.
             virtual void pickupChangedPickedUp(Pickupable* pickup, bool pickedUp); //!< Is called by the PickupListener to notify the PickupManager, that the input Pickupable has transited to the input pickedUp state.
-            static void pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, bool pickedUp); //!< Helper method to react to the change in the pickedUp status of a Pickupable.
+            static void pickupChangedPickedUpNetwork(uint32_t pickup, bool usable, uint32_t representationObjectId, const std::string& representationName, bool pickedUp); //!< Helper method to react to the change in the pickedUp status of a Pickupable.
 
         // Methods to be used by the PickupInventory.
         public:
             // tolua_begin
-            orxonox::PickupRepresentation* getPickupRepresentation(uint32_t pickup); //!< Get the PickupRepresentation of an input indentifier for Pickupable.
-
             int getNumPickups(void); //!< Get the number of pickups currently picked up by the player.
             /**
@@ -163,6 +156,5 @@
             PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
 
-            std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types of Pickupables) and PickupRepresentations.
-            std::map<uint32_t, PickupRepresentation*> representationsNetworked_; //!< Map linking the PickupRepresentation's objectId to the PickupRepresentation itself. It is used for networking purposes.
+            std::map<std::string, PickupRepresentation*> representations_; //!< Map linking PickupRepresentations and their names.
 
             std::map<uint32_t, PickupInventoryContainer*> pickupInventoryContainers_; //!< Map linking a number identifying a Pickupable to a PickupInventoryContainer, which contains all necessary information about that Pickupable.
Index: code/trunk/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 9348)
@@ -70,8 +70,6 @@
 
     class CollectiblePickup;
-    class DroppedPickup;
     class Pickup;
     class PickupCollection;
-    class PickupCollectionIdentifier;
     class PickupManager;
     class PickupRepresentation;
@@ -86,5 +84,5 @@
     class ShieldPickup;
     class ShrinkPickup;
-
+    class DamageBoostPickup;
 }
 
Index: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 9348)
@@ -52,5 +52,5 @@
         This is primarily for use of the PickupManager in creating a default PickupRepresentation.
     */
-    PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL), pickup_(NULL)
+    PickupRepresentation::PickupRepresentation() : BaseObject(NULL), Synchronisable(NULL), spawnerRepresentation_(NULL)
     {
         RegisterObject(PickupRepresentation);
@@ -64,5 +64,5 @@
         Default Constructor. Registers the object and initializes its member variables.
     */
-    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL), pickup_(NULL)
+    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL)
     {
         RegisterObject(PickupRepresentation);
@@ -70,6 +70,4 @@
         this->initialize();
         this->registerVariables();
-
-        PickupManager::getInstance().registerRepresentation(this); // Registers the PickupRepresentation with the PickupManager.
     }
 
@@ -84,11 +82,5 @@
 
         if(this->isInitialized())
-        {
-            if(GameMode::isMaster() && this->pickup_ != NULL)
-            {
-                PickupManager::getInstance().unregisterRepresentation(this->pickup_->getPickupIdentifier(), this);
-            }
-            PickupManager::getInstance().unregisterRepresentation(this);
-        }
+            PickupManager::getInstance().unregisterRepresentation(this->getName());
     }
 
@@ -128,15 +120,5 @@
         XMLPortParam(PickupRepresentation, "spawnerTemplate", setSpawnerTemplate, getSpawnerTemplate, xmlelement, mode);
         XMLPortParam(PickupRepresentation, "inventoryRepresentation", setInventoryRepresentation, getInventoryRepresentation, xmlelement, mode);
-        XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
         XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
-
-        if(GameMode::isMaster())
-        {
-            // Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents.
-            PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this);
-        }
-
-        if(this->spawnerRepresentation_ != NULL)
-            this->spawnerRepresentation_->setVisible(false);
 
         orxout(verbose, context::pickups) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << endl;
@@ -151,5 +133,5 @@
         Returns a pointer to the StaticEntity.
     */
-    StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
+    StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
     {
         if(this->spawnerRepresentation_ == NULL)
@@ -158,5 +140,5 @@
             if(this->spawnerTemplate_ == "")
             {
-                orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
+                orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
                 // If neither spawnerRepresentation nor spawnerTemplate was specified
                 return this->getDefaultSpawnerRepresentation(spawner);
@@ -165,11 +147,23 @@
         }
 
-        StaticEntity* representation = this->spawnerRepresentation_;
-        representation->setVisible(true);
+        this->spawnerRepresentation_->setVisible(true);
+        StaticEntity* temp = this->spawnerRepresentation_;
+        this->spawnerRepresentation_ = NULL;
 
-        this->addTemplate(this->spawnerTemplate_);
-        this->spawnerRepresentation_->setVisible(false);
+        return temp;
+    }
 
-        return representation;
+    void PickupRepresentation::changedName()
+    {
+        // Registers the PickupRepresentation with the PickupManager.
+        PickupManager::getInstance().unregisterRepresentation(this->getOldName());
+        PickupManager::getInstance().registerRepresentation(this->getName(), this);
+    }
+
+    void PickupRepresentation::setSpawnerRepresentation(StaticEntity* representation)
+    {
+        this->spawnerRepresentation_ = representation;
+        if(this->spawnerRepresentation_ != NULL)
+            this->spawnerRepresentation_->setVisible(false);
     }
 
Index: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 9348)
@@ -41,5 +41,4 @@
 
 #include "interfaces/Pickupable.h"
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/StaticEntity.h"
 
@@ -54,5 +53,5 @@
     /**
     @brief
-        The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentifier "PickupIdentifier"). It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.
+        The PickupRepresentation class represents a specific pickup type. It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like.
         They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager".
 
@@ -64,9 +63,5 @@
             spawnerTemplate = "awesomePickupRepresentation"
             inventoryRepresentation = "AwesomePickup"
-        >
-            <pickup>
-                <SomePickup />
-            </pickup>
-        </PickupRepresentation>
+        />
         @endcode
         As you might have noticed, there is a parameter called <em>spawnerTemplate</em> and also another parameter called <em>inventoryRepresentation</em>. Let's first explain the second one, <em>inventoryRepresentation</em>.
@@ -133,13 +128,8 @@
             */
             inline const std::string& getInventoryRepresentation(void) const { return this->inventoryRepresentation_; } // tolua_export
-            /**
-            @brief Get the Pickupable represented by this PickupRepresentation.
-            @param index The index.
-            @return Returns (for index = 0) a pointer to the Pickupable. For index > 0 it returns NULL.
-            */
-            inline const Pickupable* getPickup(unsigned int index) const
-                { if(index == 0) return this->pickup_; return NULL; }
 
-            StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner.
+            virtual void changedName();
+
+            StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner.
 
         protected:
@@ -168,6 +158,6 @@
             @param representation A pointer to the StaticEntity that is the spawnerRepresentation of this PickupRepresentation.
             */
-            inline void setSpawnerRepresentation(StaticEntity* representation)
-                { this->spawnerRepresentation_ = representation; }
+            void setSpawnerRepresentation(StaticEntity* representation);
+
             /**
             @brief Set the image representing the pickup in the PickupInventory.
@@ -176,10 +166,4 @@
             inline void setInventoryRepresentation(const std::string& image)
                 { this->inventoryRepresentation_ = image; }
-            /**
-            @brief Set the Pickupable that is represented by this PickupRepresentation.
-            @param pickup A pointer to the Pickupable.
-            */
-            inline void setPickup(Pickupable* pickup)
-                { this->pickup_ = pickup; }
 
         private:
@@ -195,6 +179,4 @@
             std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory.
 
-            Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation.
-
     }; // tolua_export
 
Index: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 9348)
@@ -55,48 +55,9 @@
         Pointer to the object which created this item.
     */
-    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator), pickup_(NULL)
+    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator), pickup_(NULL), representation_(NULL), pickupTemplate_(NULL)
     {
         RegisterObject(PickupSpawner);
 
         this->initialize();
-    }
-
-    /**
-    @brief
-        Constructor, Creates a fully functional PickupSpawner.
-    @param creator
-        The creator of this PickupSpawner.
-    @param pickup
-        The Pickupable to be spawned by this PickupSpawner.
-    @param triggerDistance
-        The distance at which the PickupSpawner will trigger.
-    @param respawnTime
-        The minimum time between two spawns.
-    @param maxSpawnedItems
-        The maximum number of items spawned by this PickupSpawner.
-    */
-    PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator), pickup_(NULL)
-    {
-        RegisterObject(PickupSpawner);
-
-        this->initialize();
-
-        this->pickup_ = pickup;
-
-        this->triggerDistance_ = triggerDistance;
-        this->respawnTime_ = respawnTime;
-        this->setMaxSpawnedItems(maxSpawnedItems);
-
-        if(this->pickup_ == NULL)
-        {
-            orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
-            this->setActive(false);
-        }
-        else
-        {
-            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
-            this->attach(representation->getSpawnerRepresentation(this));
-            this->setActive(true);
-        }
     }
 
@@ -112,4 +73,6 @@
         this->spawnsRemaining_ = INF;
         this->selfDestruct_ = false;
+
+        this->setPickupable(NULL);
     }
 
@@ -122,4 +85,30 @@
         if(this->isInitialized() && this->selfDestruct_ && this->pickup_ != NULL)
             this->pickup_->destroy();
+    }
+
+    /**
+    @brief
+        Factory method, Creates a fully functional PickupSpawner.
+    @param creator
+        The creator of this PickupSpawner.
+    @param pickup
+        The Pickupable to be spawned by this PickupSpawner.
+    @param carrier
+        The PickupCarrier that carried the input pickup before it was dropped.
+    @param triggerDistance
+        The distance at which the PickupSpawner will trigger.
+    */
+    /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance)
+    {
+        PickupSpawner* spawner = new PickupSpawner(creator);
+
+        spawner->setPickupable(pickup);
+        spawner->setTriggerDistance(triggerDistance);
+        spawner->setMaxSpawnedItems(1);
+
+        spawner->setPosition(carrier->getCarrierPosition());
+        spawner->block(carrier);
+
+        return spawner;
     }
 
@@ -136,33 +125,8 @@
         SUPER(PickupSpawner, XMLPort, xmlelement, mode);
 
-        XMLPortObject(PickupSpawner, Pickupable, "pickup", setPickupable, getPickupable, xmlelement, mode);
-
+        XMLPortParam(PickupSpawner, "pickup", setPickupTemplateName, getPickupTemplateName, xmlelement, mode);
         XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
         XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
         XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode);
-
-        if(this->pickup_ == NULL)
-        {
-            orxout(internal_warning, context::pickups) << "A PickupSpawner was created without a valid Pickupable. This won't work." << endl;
-            this->setActive(false);
-        }
-        else
-        {
-            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
-            this->attach(representation->getSpawnerRepresentation(this));
-            this->setActive(true);
-        }
-    }
-
-    /**
-    @brief
-        Invoked when the activity has changed. Sets visibility of attached objects.
-    */
-    void PickupSpawner::changedActivity()
-    {
-        SUPER(PickupSpawner, changedActivity);
-
-        if(GameMode::isMaster())
-            this->setVisible(this->isActive());
     }
 
@@ -199,5 +163,5 @@
 
                 Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
-                PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(*it);
+                PickupCarrier* carrier = static_cast<PickupCarrier*>(*it);
                 // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
                 if(distance.length() < this->triggerDistance_ && carrier != NULL && this->blocked_.find(carrier) == this->blocked_.end())
@@ -212,4 +176,43 @@
     /**
     @brief
+        Trigger the PickupSpawner.
+        Adds the pickup to the Pawn that triggered, sets the timer to re-activate and deactives the PickupSpawner.
+    @param carrier
+        Carrier which triggered the PickupSpawner.
+    */
+    void PickupSpawner::trigger(PickupCarrier* carrier)
+    {
+        orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered and active." << endl;
+
+        PickupCarrier* target = carrier->getTarget(this->pickup_);
+
+        this->block(carrier);
+
+        assert(target);
+        bool pickedUp = this->pickup_->pickup(target);
+        assert(pickedUp);
+        pickedUp = false; // To avoid compiler warning.
+
+        this->setPickupable(NULL);
+        this->decrementSpawnsRemaining();
+    }
+
+    void PickupSpawner::setPickupTemplateName(const std::string& name)
+    {
+        Template* temp = Template::getTemplate(name);
+        if (temp)
+            this->setPickupTemplate(temp);
+    }
+
+    void PickupSpawner::setPickupTemplate(Template* temp)
+    {
+        this->pickupTemplate_ = temp;
+        this->pickupTemplateName_ = temp->getName();
+
+        this->setPickupable(this->createPickup());
+    }
+
+    /**
+    @brief
         Sets the maximum number of spawned items.
     @param items
@@ -233,9 +236,9 @@
             this->spawnsRemaining_--;
 
+        this->setActive(false);
+
         if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0)
         {
             this->startRespawnTimer();
-
-            this->setActive(false);
             this->fireEvent();
         }
@@ -243,5 +246,4 @@
         {
             orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") empty, selfdestruct initialized." << endl;
-            this->setActive(false);
             this->destroy();
         }
@@ -255,4 +257,45 @@
     {
         this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
+    }
+
+    /**
+    @brief
+        Invoked by the timer, re-activates the PickupSpawner.
+    */
+    void PickupSpawner::respawnTimerCallback()
+    {
+        orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") reactivated." << endl;
+
+        this->setPickupable(this->createPickup());
+    }
+
+    /**
+    @brief
+        Creates a new Pickupable.
+    @return
+        The Pickupable created.
+    */
+    Pickupable* PickupSpawner::createPickup(void)
+    {
+        if(this->spawnsRemaining_ == 0)
+        {
+            orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
+            return NULL;
+        }
+
+        if (this->pickupTemplate_ != NULL)
+        {
+            Identifier* identifier = this->pickupTemplate_->getBaseclassIdentifier();
+            if (identifier != NULL)
+            {
+                Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this));
+                orxonox_cast<BaseObject*>(pickup)->addTemplate(this->pickupTemplate_);
+                return pickup;
+            }
+            else
+                orxout(internal_error, context::pickups) << "No base class defined in pickup-template " << this->pickupTemplateName_ << endl;
+        }
+
+        return NULL;
     }
 
@@ -265,94 +308,26 @@
     void PickupSpawner::setPickupable(Pickupable* pickup)
     {
-        if(this->pickup_ != NULL)
-        {
-            orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): setPickupable called, with this->pickup_ already set." << endl;
-            return;
-        }
-        if(pickup == NULL)
-        {
-            orxout(internal_error, context::pickups) << "In PickupSpawner (&" << this << "): Argument of setPickupable is NULL." << endl;
-            return;
+        if (this->representation_ != NULL)
+        {
+            this->representation_->destroy();
+            this->representation_ = NULL;
+        }
+
+        if (pickup != NULL)
+        {
+            if (this->pickup_ != NULL)
+                this->pickup_->destroy();
+
+            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(pickup->getRepresentationName());
+            this->representation_ = representation->createSpawnerRepresentation(this);
+            this->attach(this->representation_);
+            this->setActive(true);
+        }
+        else
+        {
+            this->setActive(false);
         }
 
         this->pickup_ = pickup;
     }
-
-    /**
-    @brief
-        Get the Pickupable that is spawned by this PickupSpawner.
-    @return
-        Returns the Pickupable that is spawned by this PickupSpawner.
-    */
-    const Pickupable* PickupSpawner::getPickupable(void) const
-    {
-        return this->pickup_;
-    }
-
-    /**
-    @brief
-        Trigger the PickupSpawner.
-        Adds the pickup to the Pawn that triggered, sets the timer to re-activate and deactives the PickupSpawner.
-    @param pawn
-        Pawn which triggered the PickupSpawner.
-    */
-    void PickupSpawner::trigger(Pawn* pawn)
-    {
-        if(this->isActive()) // Checks whether PickupSpawner is active.
-        {
-            orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered and active." << endl;
-
-            PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
-            assert(carrier);
-
-            // If the Pawn isn't a target of the Pickupable.
-            if(!carrier->isTarget(this->pickup_))
-            {
-                orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") triggered but Pawn wasn't a target of the Pickupable." << endl;
-                return;
-            }
-
-            PickupCarrier* target = carrier->getTarget(this->pickup_);
-            Pickupable* pickup = this->getPickup();
-
-            this->block(carrier);
-
-            assert(pickup);
-            assert(target);
-            bool pickedUp = pickup->pickup(target);
-            assert(pickedUp);
-            pickedUp = false; // To avoid compiler warning.
-
-            this->decrementSpawnsRemaining();
-        }
-    }
-
-    /**
-    @brief
-        Creates a new Pickupable.
-    @return
-        The Pickupable created.
-    */
-    Pickupable* PickupSpawner::getPickup(void)
-    {
-        if(this->spawnsRemaining_ == 0)
-        {
-            orxout(internal_error, context::pickups) << "Massive Error: PickupSpawner still alive until having spawned last item." << endl;
-            return NULL;
-        }
-
-        Pickupable* pickup = this->pickup_->clone();
-        return pickup;
-    }
-
-    /**
-    @brief
-        Invoked by the timer, re-activates the PickupSpawner.
-    */
-    void PickupSpawner::respawnTimerCallback()
-    {
-        orxout(verbose, context::pickups) << "PickupSpawner (&" << this << ") reactivated." << endl;
-
-        this->setActive(true);
-    }
 }
Index: code/trunk/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.h	(revision 9347)
+++ code/trunk/src/modules/pickup/PickupSpawner.h	(revision 9348)
@@ -78,9 +78,9 @@
         public:
             PickupSpawner(BaseObject* creator); //!< Default Constructor.
-            PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems); //!< Constructor.
             virtual ~PickupSpawner(); //!< Destructor.
 
+            static PickupSpawner* createDroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0);
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
-            virtual void changedActivity(); //!< Invoked when activity has changed (set visibilty).
             virtual void tick(float dt); //!< Tick, checks if any Pawn is close enough to trigger.
 
@@ -103,6 +103,21 @@
             inline int getMaxSpawnedItems(void) const
                 { return this->maxSpawnedItems_; }
+            /**
+            @brief Returns the name of the template which is used to create a pickup for this spawner.
+            */
+            inline const std::string& getPickupTemplateName() const
+                { return this->pickupTemplateName_; }
+            /**
+            @brief Returns the template which is used to create a pickup for this spawner.
+            */
+            inline Template* getPickupTemplate() const
+                {return this->pickupTemplate_; }
 
-        protected:
+        private:
+            void initialize(void);
+
+            void trigger(PickupCarrier* carrier); //!< Method called when a carrier is close enough.
+            void respawnTimerCallback(); //!< Method called when the timer runs out.
+
             void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns.
             void startRespawnTimer(void); //!< Invoked by the timer, re-activates the PickupSpawner.
@@ -128,18 +143,17 @@
             inline void setRespawnTime(float time)
                 { this->respawnTime_ = time; }
+
             void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
 
-            virtual Pickupable* getPickup(void); //!< Creates a new Pickupable.
+            void setPickupTemplateName(const std::string& name);
+            void setPickupTemplate(Template* temp);
 
+            Pickupable* createPickup(void); //!< Creates a new Pickupable.
             void setPickupable(Pickupable* pickup); //!< Sets a Pickupable for the PickupSpawner to spawn.
-            const Pickupable* getPickupable(void) const; //!< Get the Pickupable that is spawned by this PickupSpawner.
 
             Pickupable* pickup_; //!< The pickup to be spawned.
-
-        private:
-            void initialize(void);
-
-            void trigger(Pawn* pawn); //!< Method called when a Pawn is close enough.
-            void respawnTimerCallback(); //!< Method called when the timer runs out.
+            StaticEntity* representation_; //!< The active representation of the spawner.
+            std::string pickupTemplateName_; //!< The name of the pickup template.
+            Template* pickupTemplate_; //!< The template to be used to create a pickupable.
 
             int maxSpawnedItems_; //!< Maximum number of items spawned by this PickupSpawner.
Index: code/trunk/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/items/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/modules/pickup/items/CMakeLists.txt	(revision 9348)
@@ -7,3 +7,4 @@
   ShieldPickup.cc
   ShrinkPickup.cc
+  DamageBoostPickup.cc
 )
Index: code/trunk/src/modules/pickup/items/DamageBoostPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/DamageBoostPickup.cc	(revision 9348)
+++ code/trunk/src/modules/pickup/items/DamageBoostPickup.cc	(revision 9348)
@@ -0,0 +1,198 @@
+/*
+ *   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:
+ *      Kevin Lengauer
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DamageBoostPickup.cc
+    @brief Implementation of the DamageBoostPickup class.
+*/
+
+#include "DamageBoostPickup.h"
+
+#include <sstream>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+    CreateFactory(DamageBoostPickup);
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes the member variables.
+    */
+    DamageBoostPickup::DamageBoostPickup(BaseObject* creator) : Pickup(creator)
+    {
+        RegisterObject(DamageBoostPickup);
+
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    DamageBoostPickup::~DamageBoostPickup()
+    {
+    }
+
+    /**
+    @brief
+        Initializes the member variables.
+    */
+    void DamageBoostPickup::initialize(void)
+    {
+        this->duration_ = 0.0f;
+        this->damageMultiplier_ = 1.0f; //The default damage multiplier.
+        //Defines who is allowed to pick up the pickup.
+        this->addTarget(ClassIdentifier<SpaceShip>::getIdentifier());
+    }
+
+    /**
+    @brief
+        Method for creating a DamageBoostPickup object through XML.
+    */
+    void DamageBoostPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+    {
+        SUPER(DamageBoostPickup, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DamageBoostPickup, "duration", setDuration, getDuration, xmlelement, mode);
+        XMLPortParam(DamageBoostPickup, "damageMultiplier", setDamageMultiplier, getDamageMultiplier, xmlelement, mode);
+    }
+
+    // Work in Progress setDamage Function
+    void DamageBoostPickup::setDamageMultiplier(float damageMultiplier)
+    {
+        if(damageMultiplier >= 1.0f)
+        {
+            this->damageMultiplier_ = damageMultiplier;
+        }
+    }
+
+
+    /**
+    @brief
+        Is called when the pickup has transisted from used to unused or the other way around.
+    */
+    void DamageBoostPickup::changedUsed(void)
+    {
+        SUPER(DamageBoostPickup, changedUsed);
+
+        SpaceShip* ship = this->carrierToSpaceShipHelper();
+        if(ship == NULL) // If the PickupCarrier is no SpaceShip, then this pickup is useless and therefore is destroyed.
+            this->Pickupable::destroy();
+
+
+        // If the pickup has transited to used.
+        if(this->isUsed())
+        {
+            // If its durationType is continuous, we set a Timer to be reminded, when the time has run out.
+            if(this->isContinuous())
+            {
+                if(!this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() > 0.0f)
+                {
+                    this->durationTimer_.unpauseTimer();
+                }
+                else
+                {
+                    this->durationTimer_.setTimer(this->getDuration(), false, createExecutor(createFunctor(&DamageBoostPickup::pickupTimerCallback, this)));
+                }
+            }
+
+            // Saves the old default Damage that is needed to restore the original damage
+            this->olddamageMultiplier_ = 1.0f;
+            // Sets the new Damage with the damage multiplier
+            ship->setDamageMultiplier(this->getDamageMultiplier());
+        }
+        else
+        {
+
+            // We destroy the pickup if either, the pickup has activationType immediate and durationType once or it has durationType continuous and the duration was exceeded.
+            if((!this->isContinuous() && this->isImmediate()) || (this->isContinuous() && !this->durationTimer_.isActive() && this->durationTimer_.getRemainingTime() == this->getDuration()))
+            {
+                this->Pickupable::destroy();
+                ship->setDamageMultiplier ( this->olddamageMultiplier_);
+            }
+            // We pause the Timer if the pickup is continuous and the duration is not yet exceeded,
+            else if(this->isContinuous() && this->durationTimer_.isActive())
+            {
+                this->durationTimer_.pauseTimer();
+            }
+        }
+    }
+
+    /**
+    @brief
+        Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+    @return
+        A pointer to the SpaceShip, or NULL if the conversion failed.
+    */
+    SpaceShip* DamageBoostPickup::carrierToSpaceShipHelper(void)
+    {
+        PickupCarrier* carrier = this->getCarrier();
+        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
+
+        if(ship == NULL)
+        {
+            orxout(internal_error, context::pickups) << "Invalid PickupCarrier in DamageBoostPickup." << endl;
+        }
+
+        return ship;
+    }
+
+    /**
+    @brief
+        Sets the duration for which the DamageBoostPickup stays active.
+    @param duration
+        The duration in seconds.
+    */
+    void DamageBoostPickup::setDuration(float duration)
+    {
+        if(duration >= 0.0f)
+        {
+            this->duration_ = duration;
+        }
+        else
+        {
+            orxout(internal_error, context::pickups) << "Invalid duration in DamagePickup." << endl;
+            this->duration_ = 0.0f;
+        }
+    }
+
+    /**
+    @brief
+        Helper method. Is called by the Timer as soon as it expires.
+    */
+    void DamageBoostPickup::pickupTimerCallback(void)
+    {
+        this->setUsed(false);
+    }
+
+}
+
Index: code/trunk/src/modules/pickup/items/DamageBoostPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DamageBoostPickup.h	(revision 9348)
+++ code/trunk/src/modules/pickup/items/DamageBoostPickup.h	(revision 9348)
@@ -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:
+ *      Kevin Lengauer
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DamageBoostPickup.h
+    @brief Declaration of the DamageBoostPickup class.
+    @ingroup PickupItems
+*/
+
+#ifndef _DamageBoostPickup_H__
+#define _DamageBoostPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include <string>
+
+#include "pickup/Pickup.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox {
+
+    class _PickupExport DamageBoostPickup : public Pickup, public Tickable
+    {
+        public:
+
+            DamageBoostPickup(BaseObject* creator); //!< Constructor.
+            virtual ~DamageBoostPickup(); //!< Destructor.
+
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DamageBoostPickup object through XML.
+
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+
+            /**
+            @brief Get the time the DamagePickup lasts.
+            @return Returns the time in seconds the DamagePickup lasts.
+            */
+            inline float getDuration(void) const
+                { return this->duration_; }
+
+            inline void setDuration( float duration );
+
+
+
+            /**
+             @brief set Damage multiplier
+             @param multiplier The default damage multiplier to set
+             */
+            inline float getDamageMultiplier()
+                { return this->damageMultiplier_; }
+
+
+
+
+        protected:
+            void setDamageMultiplier(float damageMultiplier); //!< Sets the DamageMultiplier according to the XML.
+
+
+        private:
+            void initialize(void); //!< Initializes the member variables.
+            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
+            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
+            void pickupTimerCallback(void);
+
+
+
+            float damageMultiplier_; //!< The damage boost that is transferred to the Pawn.
+            float olddamageMultiplier_; //!< Helper to remember what the actual damage of the Pawn was before we changed it.
+
+            Timer durationTimer_; //!< Timer.
+            float duration_; //! Duration of damage boost.
+
+    };
+}
+
+#endif // _DamageBoostPickup_H__
Index: code/trunk/src/modules/pickup/items/DronePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/DronePickup.cc	(revision 9348)
@@ -39,5 +39,4 @@
 
 #include "controllers/DroneController.h"
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/Drone.h"
 #include "worldentities/pawns/Pawn.h"
@@ -75,17 +74,6 @@
     {
         this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
-        this->setDurationTypeDirect(pickupDurationType::once);
+        this->setDurationType(pickupDurationType::once);
         this->droneTemplate_ = "";
-    }
-
-    /**
-    @brief
-        Initializes the PickupIdentifier of this pickup.
-    */
-    void DronePickup::initializeIdentifier(void)
-    {
-        std::string val = this->getDroneTemplate();
-        std::string type = "droneTemplate";
-        this->pickupIdentifier_->addParameter(type, val);
     }
 
@@ -98,6 +86,4 @@
         SUPER(DronePickup, XMLPort, xmlelement, mode);
         XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode);
-
-        this->initializeIdentifier();
     }
 
@@ -108,5 +94,5 @@
         The name of the Template to e set.
     */
-    void DronePickup::setDroneTemplate(std::string templatename){
+    void DronePickup::setDroneTemplate(const std::string& templatename){
         droneTemplate_ = templatename;
     }
@@ -144,5 +130,5 @@
 
                 Controller* controller = drone->getController();
-                DroneController* droneController = dynamic_cast<DroneController*>(controller);
+                DroneController* droneController = orxonox_cast<DroneController*>(controller);
                 if(droneController != NULL)
                 {
@@ -175,5 +161,5 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
         if(pawn == NULL)
@@ -184,22 +170,3 @@
         return pawn;
     }
-
-    /**
-    @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void DronePickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new DronePickup(this);
-
-        SUPER(DronePickup, clone, item);
-
-        DronePickup* pickup = dynamic_cast<DronePickup*>(item);
-        pickup->setDroneTemplate(this->getDroneTemplate());
-
-        pickup->initializeIdentifier();
-    }
 }
Index: code/trunk/src/modules/pickup/items/DronePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/DronePickup.h	(revision 9348)
@@ -70,12 +70,9 @@
 
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             const std::string& getDroneTemplate() const; //!< Get the name of the droneTemplate.
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
-            void setDroneTemplate(std::string templatename); //!< Set the droneTemplate.
+            void setDroneTemplate(const std::string& templatename); //!< Set the droneTemplate.
 
         private:
Index: code/trunk/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/HealthPickup.cc	(revision 9348)
@@ -38,5 +38,4 @@
 #include "core/XMLPort.h"
 
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -87,27 +86,4 @@
     /**
     @brief
-        Initializes the PickupIdentifier of this pickup.
-    */
-    void HealthPickup::initializeIdentifier(void)
-    {
-        std::stringstream stream;
-        stream << this->getHealth();
-        std::string type1 = "health";
-        std::string val1 = stream.str();
-        this->pickupIdentifier_->addParameter(type1, val1);
-
-        std::string val2 = this->getHealthType();
-        std::string type2 = "healthType";
-        this->pickupIdentifier_->addParameter(type2, val2);
-
-        stream.clear();
-        stream << this->getHealthRate();
-        std::string val3 = stream.str();
-        std::string type3 = "healthRate";
-        this->pickupIdentifier_->addParameter(type3, val3);
-    }
-
-    /**
-    @brief
         Method for creating a HealthPickup object through XML.
     */
@@ -118,10 +94,8 @@
         XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode);
         XMLPortParam(HealthPickup, "healthRate", setHealthRate, getHealthRate, xmlelement, mode);
-        XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode);
+        XMLPortParam(HealthPickup, "healthType", setHealthTypeAsString, getHealthTypeAsString, xmlelement, mode);
 
         if(!this->isContinuous())
-            this->healthRate_ = 0.0f;
-
-        this->initializeIdentifier();
+            this->setHealthRate(0.0f); // TODO: this logic should be inside tick(), not in XMLPort
     }
 
@@ -151,5 +125,5 @@
             this->setHealth(this->getHealth()-health);
 
-            switch(this->getHealthTypeDirect())
+            switch(this->getHealthType())
             {
                 case pickupHealthType::permanent:
@@ -198,5 +172,5 @@
 
                 float health = 0.0f;
-                switch(this->getHealthTypeDirect())
+                switch(this->getHealthType())
                 {
                     case pickupHealthType::permanent:
@@ -227,8 +201,8 @@
         else
         {
-            if(this->getHealthTypeDirect() == pickupHealthType::temporary)
+            if(this->getHealthType() == pickupHealthType::temporary)
             {
                 PickupCarrier* carrier = this->getCarrier();
-                Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+                Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
                 if(pawn == NULL)
@@ -264,5 +238,5 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
         if(pawn == NULL)
@@ -270,25 +244,4 @@
 
         return pawn;
-    }
-
-    /**
-    @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void HealthPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new HealthPickup(this);
-
-        SUPER(HealthPickup, clone, item);
-
-        HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
-        pickup->setHealth(this->getHealth());
-        pickup->setHealthRate(this->getHealthRate());
-        pickup->setHealthTypeDirect(this->getHealthTypeDirect());
-
-        pickup->initializeIdentifier();
     }
 
@@ -299,7 +252,7 @@
         Returns the health type as a string.
     */
-    const std::string& HealthPickup::getHealthType(void) const
-    {
-        switch(this->getHealthTypeDirect())
+    const std::string& HealthPickup::getHealthTypeAsString(void) const
+    {
+        switch(this->getHealthType())
         {
             case pickupHealthType::limited:
@@ -352,12 +305,12 @@
         The type as a string.
     */
-    void HealthPickup::setHealthType(std::string type)
+    void HealthPickup::setHealthTypeAsString(const std::string& type)
     {
         if(type == HealthPickup::healthTypeLimited_s)
-            this->setHealthTypeDirect(pickupHealthType::limited);
+            this->setHealthType(pickupHealthType::limited);
         else if(type == HealthPickup::healthTypeTemporary_s)
-            this->setHealthTypeDirect(pickupHealthType::temporary);
+            this->setHealthType(pickupHealthType::temporary);
         else if(type == HealthPickup::healthTypePermanent_s)
-            this->setHealthTypeDirect(pickupHealthType::permanent);
+            this->setHealthType(pickupHealthType::permanent);
         else
             orxout(internal_error, context::pickups) << "Invalid healthType '" << type << "' in HealthPickup." << endl;
Index: code/trunk/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/HealthPickup.h	(revision 9348)
@@ -97,5 +97,4 @@
 
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -116,11 +115,9 @@
             @return Returns the health type as an enum.
             */
-            inline pickupHealthType::Value getHealthTypeDirect(void) const
+            inline pickupHealthType::Value getHealthType(void) const
                 { return this->healthType_; }
-            const std::string& getHealthType(void) const; //!< Get the health type of this pickup.
+            const std::string& getHealthTypeAsString(void) const; //!< Get the health type of this pickup.
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
             void setHealth(float health); //!< Sets the health.
             void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous.
@@ -130,7 +127,7 @@
             @param type The type of this pickup as an enum.
             */
-            inline void setHealthTypeDirect(pickupHealthType::Value type)
+            inline void setHealthType(pickupHealthType::Value type)
                 { this->healthType_ = type; }
-            void setHealthType(std::string type); //!< Set the type of the HealthPickup.
+            void setHealthTypeAsString(const std::string& type); //!< Set the type of the HealthPickup.
 
         private:
Index: code/trunk/src/modules/pickup/items/InvisiblePickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.cc	(revision 9348)
@@ -40,5 +40,4 @@
 #include "core/XMLPort.h"
 
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -79,17 +78,4 @@
     /**
     @brief
-        Initializes the PickupIdentifier of this pickup.
-    */
-    void InvisiblePickup::initializeIdentifier(void)
-    {
-        std::stringstream stream;
-        stream << this->getDuration();
-        std::string type1 = "duration";
-        std::string val1 = stream.str();
-        this->pickupIdentifier_->addParameter(type1, val1);
-    }
-
-    /**
-    @brief
         Method for creating a HealthPickup object through XML.
     */
@@ -98,6 +84,4 @@
         SUPER(InvisiblePickup, XMLPort, xmlelement, mode);
         XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
-
-        this->initializeIdentifier();
     }
 
@@ -148,22 +132,4 @@
     /**
     @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void InvisiblePickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new InvisiblePickup(this);
-
-        SUPER(InvisiblePickup, clone, item);
-
-        InvisiblePickup* pickup = dynamic_cast<InvisiblePickup*>(item);
-        pickup->setDuration(this->getDuration());
-        pickup->initializeIdentifier();
-    }
-
-    /**
-    @brief
         Sets the invisibility.
     @param invisibility
@@ -202,5 +168,5 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
         if(pawn == NULL)
Index: code/trunk/src/modules/pickup/items/InvisiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.h	(revision 9348)
@@ -72,8 +72,7 @@
             InvisiblePickup(BaseObject* creator); //!< Constructor.
             virtual ~InvisiblePickup(); //!< Destructor.
-            
+
             virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -91,6 +90,4 @@
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
             bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
             void setDuration(float duration); //!< Sets the time the InvisibilityPickup will last.
Index: code/trunk/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/MetaPickup.cc	(revision 9348)
@@ -36,5 +36,4 @@
 
 #include "interfaces/PickupCarrier.h"
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -80,5 +79,5 @@
         this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
 
-        this->setDurationTypeDirect(pickupDurationType::once);
+        this->setDurationType(pickupDurationType::once);
         this->metaType_ = pickupMetaType::none;
     }
@@ -86,15 +85,4 @@
     /**
     @brief
-        Helper method to initialize the PickupIdentifier.
-    */
-    void MetaPickup::initializeIdentifier(void)
-    {
-        std::string val = this->getMetaType();
-        std::string type = "metaType";
-        this->pickupIdentifier_->addParameter(type, val);
-    }
-
-    /**
-    @brief
         Method for creating a MetaPickup object through XML.
     */
@@ -103,7 +91,5 @@
         SUPER(MetaPickup, XMLPort, xmlelement, mode);
 
-        XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode);
-
-        this->initializeIdentifier();
+        XMLPortParam(MetaPickup, "metaType", setMetaTypeAsString, getMetaTypeAsString, xmlelement, mode);
     }
 
@@ -121,8 +107,8 @@
         {
             PickupCarrier* carrier = this->getCarrier();
-            if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
+            if(this->getMetaType() != pickupMetaType::none && carrier != NULL)
             {
                 // If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
-                if(this->getMetaTypeDirect() == pickupMetaType::destroyCarrier)
+                if(this->getMetaType() == pickupMetaType::destroyCarrier)
                 {
                     Pawn* pawn = orxonox_cast<Pawn*>(carrier);
@@ -139,15 +125,15 @@
 
                     // If the metaType is use, then the Pickupable is set to used.
-                    if(this->getMetaTypeDirect() == pickupMetaType::use && !pickup->isUsed())
+                    if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())
                     {
                         pickup->setUsed(true);
                     }
                     // If the metaType is drop, then the Pickupable is dropped.
-                    else if(this->getMetaTypeDirect() == pickupMetaType::drop)
+                    else if(this->getMetaType() == pickupMetaType::drop)
                     {
                         pickup->drop();
                     }
                     // If the metaType is destroy, then the Pickupable is destroyed.
-                    else if(this->getMetaTypeDirect() == pickupMetaType::destroy)
+                    else if(this->getMetaType() == pickupMetaType::destroy)
                     {
                         pickup->Pickupable::destroy();
@@ -161,30 +147,11 @@
     /**
     @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void MetaPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new MetaPickup(this);
-
-        SUPER(MetaPickup, clone, item);
-
-        MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
-        pickup->setMetaTypeDirect(this->getMetaTypeDirect());
-
-        pickup->initializeIdentifier();
-    }
-
-    /**
-    @brief
         Get the meta type of this MetaPickup.
     @return
         Returns a string with the meta type of the MetaPickup.
     */
-    const std::string& MetaPickup::getMetaType(void) const
-    {
-        switch(this->getMetaTypeDirect())
+    const std::string& MetaPickup::getMetaTypeAsString(void) const
+    {
+        switch(this->getMetaType())
         {
             case pickupMetaType::none:
@@ -209,25 +176,25 @@
         A string with the type to be set.
     */
-    void MetaPickup::setMetaType(const std::string& type)
+    void MetaPickup::setMetaTypeAsString(const std::string& type)
     {
         if(type == MetaPickup::metaTypeNone_s)
         {
-            this->setMetaTypeDirect(pickupMetaType::none);
+            this->setMetaType(pickupMetaType::none);
         }
         else if(type == MetaPickup::metaTypeUse_s)
         {
-            this->setMetaTypeDirect(pickupMetaType::use);
+            this->setMetaType(pickupMetaType::use);
         }
         else if(type == MetaPickup::metaTypeDrop_s)
         {
-            this->setMetaTypeDirect(pickupMetaType::drop);
+            this->setMetaType(pickupMetaType::drop);
         }
         else if(type == MetaPickup::metaTypeDestroy_s)
         {
-            this->setMetaTypeDirect(pickupMetaType::destroy);
+            this->setMetaType(pickupMetaType::destroy);
         }
         else if(type == MetaPickup::metaTypeDestroyCarrier_s)
         {
-            this->setMetaTypeDirect(pickupMetaType::destroyCarrier);
+            this->setMetaType(pickupMetaType::destroyCarrier);
         }
         else
Index: code/trunk/src/modules/pickup/items/MetaPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/MetaPickup.h	(revision 9348)
@@ -69,5 +69,5 @@
 
         The default value is <em>none</em>, which basically does nothing.
-        
+
         The parameter <b>activation type</b> can be used to specify, whether the MetaPickup is used upon pickup (<em>immediate</em>) or not (<em>onUse</em>). With <em>immediate</em> being the default.
 
@@ -95,5 +95,4 @@
 
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -101,18 +100,16 @@
             @return Returns an enum with the meta type of the MetaPickup.
             */
-            inline pickupMetaType::Value getMetaTypeDirect(void) const
+            inline pickupMetaType::Value getMetaType(void) const
                 { return this->metaType_; }
-            const std::string& getMetaType(void) const; //!< Get the meta type of this MetaPickup.
+            const std::string& getMetaTypeAsString(void) const; //!< Get the meta type of this MetaPickup.
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
-
             /**
             @brief Set the meta type of the MetaPickup.
             @param type The meta type as an enum.
             */
-            inline void setMetaTypeDirect(pickupMetaType::Value type)
+            inline void setMetaType(pickupMetaType::Value type)
                 { this->metaType_ =  type; }
-            void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
+            void setMetaTypeAsString(const std::string& type); //!< Set the meta type of this MetaPickup.
 
         private:
Index: code/trunk/src/modules/pickup/items/ShieldPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.cc	(revision 9348)
@@ -38,5 +38,4 @@
 #include "core/XMLPort.h"
 
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -80,30 +79,4 @@
     /**
     @brief
-        Initializes the PickupIdentifier of this pickup.
-    */
-    void ShieldPickup::initializeIdentifier(void)
-    {
-        std::stringstream stream;
-        stream << this->getDuration();
-        std::string type1 = "duration";
-        std::string val1 = stream.str();
-        this->pickupIdentifier_->addParameter(type1, val1);
-
-        stream.clear();
-        stream << this->getShieldHealth();
-        std::string type2 = "ShieldHealth";
-        std::string val2 = stream.str();
-        this->pickupIdentifier_->addParameter(type2, val2);
-
-        stream.clear();
-        stream << this->getShieldAbsorption();
-        std::string type3 = "ShieldAbsorption";
-        std::string val3 = stream.str();
-        this->pickupIdentifier_->addParameter(type3, val3);
-
-    }
-
-    /**
-    @brief
         Method for creating a ShieldPickup object through XML.
     */
@@ -115,6 +88,4 @@
         XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
         XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
-
-        this->initializeIdentifier();
     }
 
@@ -177,5 +148,5 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
         if(pawn == NULL)
@@ -184,24 +155,4 @@
         }
         return pawn;
-    }
-
-    /**
-    @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void ShieldPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new ShieldPickup(this);
-
-        SUPER(ShieldPickup, clone, item);
-
-        ShieldPickup* pickup = dynamic_cast<ShieldPickup*>(item);
-        pickup->setDuration(this->getDuration());
-        pickup->setShieldAbsorption(this->getShieldAbsorption());
-        pickup->setShieldHealth(this->getShieldHealth());
-        pickup->initializeIdentifier();
     }
 
Index: code/trunk/src/modules/pickup/items/ShieldPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.h	(revision 9348)
@@ -82,5 +82,4 @@
 
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -104,5 +103,4 @@
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
             void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires.
 
Index: code/trunk/src/modules/pickup/items/ShrinkPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/ShrinkPickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/ShrinkPickup.cc	(revision 9348)
@@ -40,5 +40,4 @@
 #include "core/XMLPort.h"
 
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -81,25 +80,4 @@
     }
 
-    void ShrinkPickup::initializeIdentifier(void)
-    {
-        std::stringstream stream;
-        stream << this->getShrinkFactor();
-        std::string type1 = "shrinkFactor";
-        std::string val1 = stream.str();
-        this->pickupIdentifier_->addParameter(type1, val1);
-
-        stream.clear();
-        stream << this->getDuration();
-        std::string val2 = stream.str();
-        std::string type2 = "duration";
-        this->pickupIdentifier_->addParameter(type2, val2);
-
-        stream.clear();
-        stream << this->getShrinkDuration();
-        std::string val3 = stream.str();
-        std::string type3 = "shrinkDuration";
-        this->pickupIdentifier_->addParameter(type3, val3);
-    }
-
    /**
     @brief
@@ -113,6 +91,46 @@
         XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode);
         XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode);
-
-        this->initializeIdentifier();
+    }
+
+    /**
+    @brief Sets the shrinking factor.
+    @param factor The factor, needs to greater than 1.
+    */
+    void ShrinkPickup::setShrinkFactor(float factor)
+    {
+        if(factor <= 1.0f)
+        {
+            orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl;
+            return;
+        }
+        this->shrinkFactor_ = factor;
+    }
+
+    /**
+    @brief Set the duration for which the ship remains shrunken.
+    @param duration The duration, needs to be non-negative.
+    */
+    void ShrinkPickup::setDuration(float duration)
+    {
+        if(duration < 0.0f)
+        {
+            orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl;
+            return;
+        }
+        this->duration_ = duration;
+    }
+
+    /**
+    @brief Set the shrink duration.
+    @param speed The shrink duration, needs to be positive.
+    */
+    void ShrinkPickup::setShrinkDuration(float speed)
+    {
+        if(speed <= 0.0f)
+        {
+            orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl;
+            return;
+        }
+        this->shrinkDuration_ = speed;
     }
 
@@ -148,5 +166,5 @@
     {
         SUPER(ShrinkPickup, changedPickedUp);
-        
+
         if(!this->isPickedUp() && this->isActive_)
         {
@@ -271,5 +289,5 @@
 
                 bool destroy = false;
-                
+
                 // Stop shrinking if the desired size is reached.
                 if(this->timeRemainig_ <= 0.0f)
@@ -314,27 +332,7 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+        Pawn* pawn = orxonox_cast<Pawn*>(carrier);
 
         return pawn;
     }
-
-    /**
-    @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void ShrinkPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new ShrinkPickup(this);
-
-        SUPER(ShrinkPickup, clone, item);
-        ShrinkPickup* pickup = dynamic_cast<ShrinkPickup*>(item);
-        pickup->setShrinkFactor(this->getShrinkFactor());
-        pickup->setDuration(this->getDuration());
-        pickup->setShrinkDuration(this->getShrinkDuration());
-
-        pickup->initializeIdentifier();
-    }
 }
Index: code/trunk/src/modules/pickup/items/ShrinkPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShrinkPickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/ShrinkPickup.h	(revision 9348)
@@ -80,5 +80,4 @@
             virtual void changedUsed(void); // Is called when the pickup has transited from used to unused or the other way around.
             virtual void changedPickedUp(void);
-            virtual void clone(OrxonoxClass*& item); // Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -88,10 +87,6 @@
             inline float getShrinkFactor(void) const
                 { return this->shrinkFactor_; }
-            /**
-            @brief Sets the shrinking factor.
-            @param factor The factor, needs to greater than 1.
-            */
-            inline void setShrinkFactor(float factor)
-                { if(factor <= 1.0f) { orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; }
+            void setShrinkFactor(float factor);
+
             /**
             @brief Get the duration for which the ship remains shrunken.
@@ -100,10 +95,6 @@
             inline float getDuration(void) const
                 { return this->duration_; }
-            /**
-            @brief Set the duration for which the ship remains shrunken.
-            @param duration The duration, needs to be non-negative.
-            */
-            inline void setDuration(float duration)
-                { if(duration < 0.0f) { orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; }
+            void setDuration(float duration);
+
             /**
             @brief Get the shrink speed.
@@ -112,13 +103,5 @@
             inline float getShrinkDuration(void) const
                 { return this->shrinkDuration_; }
-            /**
-            @brief Set the shrink duration.
-            @param speed The shrink duration, needs to be positive.
-            */
-            inline void setShrinkDuration(float speed)
-                { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
-
-        protected:
-            void initializeIdentifier(void);
+            void setShrinkDuration(float speed);
 
         private:
@@ -135,5 +118,5 @@
             float currentFactor_;       //!< The shrink factor that is currently applied.
             float timeRemainig_;        //!< The remaining shrink time.
-            
+
             Pawn* carrierToPawnHelper(void);
             Timer durationTimer_;
Index: code/trunk/src/modules/pickup/items/SpeedPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.cc	(revision 9347)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.cc	(revision 9348)
@@ -38,5 +38,4 @@
 #include "core/XMLPort.h"
 
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/SpaceShip.h"
 
@@ -80,29 +79,4 @@
     /**
     @brief
-        Initializes the PickupIdentifier of this pickup.
-    */
-    void SpeedPickup::initializeIdentifier(void)
-    {
-        std::stringstream stream;
-        stream << this->getDuration();
-        std::string type1 = "duration";
-        std::string val1 = stream.str();
-        this->pickupIdentifier_->addParameter(type1, val1);
-
-        stream.clear();
-        stream << this->getSpeedAdd();
-        std::string type2 = "speedAdd";
-        std::string val2 = stream.str();
-        this->pickupIdentifier_->addParameter(type2, val2);
-
-        stream.clear();
-        stream << this->getSpeedMultiply();
-        std::string type3 = "speedMultiply";
-        std::string val3 = stream.str();
-        this->pickupIdentifier_->addParameter(type3, val3);
-    }
-
-    /**
-    @brief
         Method for creating a SpeedPickup object through XML.
     */
@@ -114,6 +88,4 @@
         XMLPortParam(SpeedPickup, "speedAdd", setSpeedAdd, getSpeedAdd, xmlelement, mode);
         XMLPortParam(SpeedPickup, "speedMultiply", setSpeedMultiply, getSpeedMultiply, xmlelement, mode);
-
-        this->initializeIdentifier();
     }
 
@@ -176,5 +148,5 @@
     {
         PickupCarrier* carrier = this->getCarrier();
-        SpaceShip* ship = dynamic_cast<SpaceShip*>(carrier);
+        SpaceShip* ship = orxonox_cast<SpaceShip*>(carrier);
 
         if(ship == NULL)
@@ -184,25 +156,4 @@
 
         return ship;
-    }
-
-    /**
-    @brief
-        Creates a duplicate of the input OrxonoxClass.
-    @param item
-        A pointer to the Orxonox class.
-    */
-    void SpeedPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new SpeedPickup(this);
-
-        SUPER(SpeedPickup, clone, item);
-
-        SpeedPickup* pickup = dynamic_cast<SpeedPickup*>(item);
-        pickup->setDuration(this->getDuration());
-        pickup->setSpeedAdd(this->getSpeedAdd());
-        pickup->setSpeedMultiply(this->getSpeedMultiply());
-
-        pickup->initializeIdentifier();
     }
 
Index: code/trunk/src/modules/pickup/items/SpeedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.h	(revision 9347)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.h	(revision 9348)
@@ -81,5 +81,4 @@
 
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
-            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
 
             /**
@@ -103,5 +102,4 @@
 
         protected:
-            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
             void pickupTimerCallback(void); //!< Function that gets called when timer ends.
 
@@ -112,5 +110,5 @@
         private:
             void initialize(void); //!< Initializes the member variables.
-            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceSHip, and throw an error message if the conversion fails.
+            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
 
             Timer durationTimer_; //!< Timer.
Index: code/trunk/src/modules/pong/Pong.cc
===================================================================
--- code/trunk/src/modules/pong/Pong.cc	(revision 9347)
+++ code/trunk/src/modules/pong/Pong.cc	(revision 9348)
@@ -256,7 +256,7 @@
         Is called when the player scored.
     */
-    void Pong::playerScored(PlayerInfo* player)
-    {
-        Deathmatch::playerScored(player);
+    void Pong::playerScored(PlayerInfo* player, int score)
+    {
+        Deathmatch::playerScored(player, score);
 
         if (this->center_ != NULL) // If there is a centerpoint.
Index: code/trunk/src/modules/pong/Pong.h
===================================================================
--- code/trunk/src/modules/pong/Pong.h	(revision 9347)
+++ code/trunk/src/modules/pong/Pong.h	(revision 9348)
@@ -73,5 +73,5 @@
             virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
 
-            virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored.
+            virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored.
 
             /**
Index: code/trunk/src/modules/tetris/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/tetris/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/modules/tetris/CMakeLists.txt	(revision 9348)
@@ -3,4 +3,6 @@
   TetrisCenterpoint.cc
   TetrisStone.cc
+  TetrisBrick.cc
+  TetrisScore.cc
 )
 
@@ -10,4 +12,5 @@
   LINK_LIBRARIES
     orxonox
+    overlays
   SOURCE_FILES ${TETRIS_SRC_FILES}
 )
Index: code/trunk/src/modules/tetris/Tetris.cc
===================================================================
--- code/trunk/src/modules/tetris/Tetris.cc	(revision 9347)
+++ code/trunk/src/modules/tetris/Tetris.cc	(revision 9348)
@@ -23,6 +23,12 @@
  *      ...
  *   Co-authors:
- *      ...
- *
+ *      Johannes Ritz
+ *
+ *
+ *
+ *
+ *TASK c) end the game in a nicer way
+ *TASK d) save the highscore
+ *TASK e) eye candy
  */
 
@@ -42,4 +48,5 @@
 #include "TetrisCenterpoint.h"
 #include "TetrisStone.h"
+#include "TetrisBrick.h"
 #include "infos/PlayerInfo.h"
 
@@ -52,4 +59,5 @@
     @brief
         Constructor. Registers and initializes the object.
+    @ingroup Tetris
     */
     Tetris::Tetris(BaseObject* creator) : Deathmatch(creator)
@@ -57,11 +65,13 @@
         RegisterObject(Tetris);
 
-        this->activeStone_ = NULL;
+        this->activeBrick_ = 0;
 
         // Pre-set the timer, but don't start it yet.
-        this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Tetris::startStone, this)));
+        this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Tetris::startBrick, this)));
         this->starttimer_.stopTimer();
 
         this->player_ = NULL;
+        this->setHUDTemplate("TetrisHUD");
+        this->futureBrick_ = 0;
     }
 
@@ -82,5 +92,18 @@
     void Tetris::cleanup()
     {
-
+        if (this->activeBrick_)
+        {
+            this->activeBrick_->destroy();
+            this->activeBrick_ = 0;
+        }
+        if (this->futureBrick_)
+        {
+            this->futureBrick_->destroy();
+            this->futureBrick_ = 0;
+        }
+
+        for (std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+            (*it)->destroy();
+        this->stones_.clear();
     }
 
@@ -89,11 +112,14 @@
         SUPER(Tetris, tick, dt);
 
-        if(this->activeStone_ != NULL)
-        {
-            if(!this->isValidStonePosition(this->activeStone_, this->activeStone_->getPosition()))
-            {
-                this->activeStone_->setVelocity(Vector3::ZERO);
-                this->createStone();
-                this->startStone();
+        if((this->activeBrick_ != NULL)&&(!this->hasEnded()))
+        {
+            if(!this->isValidBrickPosition(this->activeBrick_))
+            {
+                for (unsigned int i = 0; i < this->activeBrick_->getNumberOfStones(); i++)
+                    this->stones_.push_back(this->activeBrick_->getStone(i));
+                this->activeBrick_->setVelocity(Vector3::ZERO);
+                this->activeBrick_->releaseStones(this->center_);
+                this->findFullRows();
+                this->startBrick();
             }
         }
@@ -109,9 +135,6 @@
             return false;
 
-        for(std::vector<TetrisStone*>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
-        {
-            if(stone == *it)
-                continue;
-
+        for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        {
             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
 
@@ -123,19 +146,61 @@
     }
 
+    /**
+    @brief
+        Check for each stone in a brick if it is moved the right way.
+    */
+    bool Tetris::isValidMove(TetrisBrick* brick, const Vector3& position, bool isRotation = false)
+    {
+        assert(brick);
+
+        for (unsigned int i = 0; i < brick->getNumberOfStones(); i++ )
+        {
+            TetrisStone* stone = brick->getStone(i);
+            Vector3 stonePosition; //the current stone's offset to position
+            if(isRotation)
+                stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount()+1);
+            else
+                stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount());
+
+            if(! this->isValidMove(stone, position + stonePosition ))
+            {
+                return false;
+            }
+
+            //catch illegal rotation (such that collisions with ground are not permitted)
+            if(isRotation)
+            {
+                if((position + stonePosition).y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
+                {
+                    return false;
+                }
+            }
+        }
+        return true;
+
+    }
+
+
+
     bool Tetris::isValidStonePosition(TetrisStone* stone, const Vector3& position)
     {
         assert(stone);
 
-        // we use a reverse iterator because we have to check for collisions with the topmost stones first
-        for(std::vector<TetrisStone*>::const_reverse_iterator it = this->stones_.rbegin(); it != this->stones_.rend(); ++it)
-        {
-            if(stone == *it)
+        // check for collisions with all stones
+        for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        {
+            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
+            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
+            //!< Saves the position of the currentStone
+
+            //filter out cases where the falling stone is already below a steady stone
+            if(position.y < currentStonePosition.y - this->center_->getStoneSize()/2.0f)
                 continue;
-
-            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
-
             if((position.x == currentStonePosition.x) && (position.y < currentStonePosition.y + this->center_->getStoneSize()))
             {
-                this->activeStone_->setPosition(Vector3(this->activeStone_->getPosition().x, currentStonePosition.y+this->center_->getStoneSize(), this->activeStone_->getPosition().z));
+                float y_offset = static_cast<int>((this->activeBrick_->getPosition().y-currentStonePosition.y+10)/10)*10 + currentStonePosition.y;
+                if(y_offset < 0) //filter out extreme cases (very rare bug)
+                    y_offset = 0;
+                this->activeBrick_->setPosition(Vector3(this->activeBrick_->getPosition().x, y_offset, this->activeBrick_->getPosition().z));
                 return false;
             }// This case applies if the stones overlap partially vertically
@@ -145,5 +210,8 @@
         if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
         {
-            stone->setPosition(Vector3(stone->getPosition().x, this->center_->getStoneSize()/2.0f, stone->getPosition().z));
+            float yOffset = stone->getPosition().y + this->center_->getStoneSize()/2.0f;//calculate offset
+            if(yOffset < 0) //catch brake-throughs
+                yOffset = 0;
+            this->activeBrick_->setPosition(Vector3(this->activeBrick_->getPosition().x, yOffset, this->activeBrick_->getPosition().z));
             return false;
         }
@@ -151,4 +219,44 @@
         return true;
     }
+    /**
+     * @brief This function determines wether a brick touches another brick or the ground.
+     *
+     */
+    bool Tetris::isValidBrickPosition(TetrisBrick* brick)
+    {
+        assert(brick);
+
+        const Vector3& brickPosition = this->activeBrick_->getPosition();
+
+        // check all stones in the brick
+        for (unsigned int i = 0; i < brick->getNumberOfStones(); i++ )
+        {
+            TetrisStone* stone = brick->getStone(i);
+            const Vector3& stonePosition = rotateVector(stone->getPosition(), brick->getRotationCount());
+            if(! this->isValidStonePosition(stone, brickPosition + stonePosition) )
+            {
+                // recurse because all stones have to checked again after the brick was re-positioned
+                this->isValidBrickPosition(brick);
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+    @brief
+        A Vector3 is rolled 90 * degrees * amount (anticlockwise rotation)
+    */
+    Vector3 Tetris::rotateVector(Vector3 position, unsigned int amount)
+    {
+        float temp = 0;
+        for(unsigned int i = 0; i < amount; i++)
+        {
+            temp = position.x;
+            position.x = -position.y;
+            position.y = temp;
+        }
+        return position;
+    }
 
     /**
@@ -160,6 +268,6 @@
         if (this->center_ != NULL) // There needs to be a TetrisCenterpoint, i.e. the area the game takes place.
         {
-            // Create the first stone.
-            this->createStone();
+            // Create the first brick.
+            this->createBrick();
         }
         else // If no centerpoint was specified, an error is thrown and the level is exited.
@@ -190,4 +298,10 @@
     void Tetris::end()
     {
+        this->activeBrick_->setVelocity(Vector3::ZERO);
+        if(this->activeBrick_ != NULL)
+        {
+            this->player_->stopControl();
+        }
+
         this->cleanup();
 
@@ -225,9 +339,7 @@
     }
 
-    /**
-    @brief
-        Starts the first stone.
-    */
-    void Tetris::startStone(void)
+
+
+    void Tetris::startBrick(void)
     {
         if(this->player_ == NULL)
@@ -235,39 +347,50 @@
 
         unsigned int cameraIndex = 0;
-        if(this->activeStone_ != NULL)
+        if(this->activeBrick_ != NULL)
         {
             // Get camera settings
-            cameraIndex = this->activeStone_->getCurrentCameraIndex();
+            cameraIndex = this->activeBrick_->getCurrentCameraIndex();
             this->player_->stopControl();
-        }
-        
-        // Make the last stone to be created the active stone.
-        this->activeStone_ = this->stones_.back();
-        
-        this->player_->startControl(this->activeStone_);
-        this->activeStone_->setVelocity(0.0f, -this->center_->getStoneSpeed(), 0.0f);
-        this->activeStone_->setCameraPosition(cameraIndex);
-    }
-
-    /**
-    @brief
-        Creates a new stone.
-    */
-    void Tetris::createStone(void)
-    {
-        // Create a new stone and add it to the list of stones.
-        TetrisStone* stone = new TetrisStone(this->center_);
-        this->stones_.push_back(stone);
-        
-        // Apply the stone template to the stone.
-        stone->addTemplate(this->center_->getStoneTemplate());
-        
-        // Attach the stone to the Centerpoint and set the position of the stone to be at the top middle.
-        this->center_->attach(stone);
+            // destroy old active brick
+            this->activeBrick_->destroy();
+        }
+
+        // Make the last brick to be created the active brick.
+        this->activeBrick_ = this->futureBrick_;
+        this->futureBrick_ = 0;
+
+        // set its position
+        this->player_->startControl(this->activeBrick_);
         float xPos = (this->center_->getWidth()/2 + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
         float yPos = (this->center_->getHeight()-0.5f)*this->center_->getStoneSize();
-        stone->setPosition(xPos, yPos, 0.0f);
-        stone->setGame(this);
-    }
+        this->activeBrick_->setPosition(xPos, yPos, 0.0f);
+        this->activeBrick_->setVelocity(0.0f, -this->center_->getStoneSpeed(), 0.0f);
+        this->activeBrick_->setCameraPosition(cameraIndex);
+
+        // create a new future brick
+        this->createBrick();
+
+        // check if the new brick is in a valid position, otherwise end the game
+        if (!this->isValidBrickPosition(this->activeBrick_))
+            this->end();
+    }
+
+    void Tetris::createBrick(void)             //TODO: random rotation offset between 0 and 3 (times 90°)
+    {
+        // create new futureBrick_
+        this->futureBrick_ = new TetrisBrick(this->center_);
+
+
+        // Apply the stone template to the stone.
+        this->futureBrick_->addTemplate(this->center_->getBrickTemplate());
+
+        // Attach the brick to the Centerpoint and set the position of the brick to be at the left side.
+        this->center_->attach(this->futureBrick_);
+        float xPos = (this->center_->getWidth()*1.6f + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
+        float yPos = (this->center_->getHeight()-5.1f)*this->center_->getStoneSize();
+        this->futureBrick_->setPosition(xPos, yPos, 0.0f);
+        this->futureBrick_->setGame(this);
+    }
+
 
     /**
@@ -282,4 +405,9 @@
     }
 
+    /*TetrisCenterpoint* Tetris::getCenterpoint(void) const
+    {
+        return this->center_;
+    }*/
+
     /**
     @brief Set the TetrisCenterpoint (the playing field).
@@ -291,3 +419,56 @@
     }
 
+    /**
+    @brief Check each row if it is full. Removes all full rows. Update
+    @brief Manages score.
+    */
+    void Tetris::findFullRows()
+    {
+        unsigned int correctPosition = 0;
+        unsigned int stonesPerRow = 0;
+        for (unsigned int row = 0; row < this->center_->getHeight(); row++)
+        {
+            stonesPerRow = 0;
+            for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+            {
+                std::list<SmartPtr<TetrisStone> >::iterator it_temp = it++;
+                correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
+                if(correctPosition == row)
+                {
+                    stonesPerRow++;
+                    if(stonesPerRow == this->center_->getWidth())
+                    {
+                        clearRow(row);
+                        row--; //the row counter has to be decreased in order to detect multiple rows!
+                        this->playerScored(this->player_);// add points
+                        //increase the stone's speed
+                        this->center_->setStoneSpeed(this->center_->getStoneSpeed()+1.0f);
+                    }
+                }
+            }
+        }
+    }
+
+    void Tetris::clearRow(unsigned int row)
+    {// clear the full row
+        for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
+        {
+            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
+            {
+                (*it)->destroy();
+                this->stones_.erase(it++);
+            }
+            else
+                ++it;
+        }
+      // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
+        for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        {
+            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
+                (*it)->setPosition((*it)->getPosition()-Vector3(0,10,0));
+        }
+
+    }
+
+
 }
Index: code/trunk/src/modules/tetris/Tetris.h
===================================================================
--- code/trunk/src/modules/tetris/Tetris.h	(revision 9347)
+++ code/trunk/src/modules/tetris/Tetris.h	(revision 9348)
@@ -56,5 +56,5 @@
         public:
             Tetris(BaseObject* creator); //!< Constructor. Registers and initializes the object.
-            virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.           
+            virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.
 
             virtual void start(void); //!< Starts the Tetris minigame.
@@ -68,23 +68,32 @@
 
             PlayerInfo* getPlayer(void) const; //!< Get the player.
+            WeakPtr<TetrisCenterpoint> getCenterpoint(void)
+                { return this->center_; }
 
             bool isValidMove(TetrisStone* stone, const Vector3& position);
+            bool isValidMove(TetrisBrick* brick, const Vector3& position, bool isRotation);
+            Vector3 rotateVector(Vector3 position, unsigned int amount);
 
         protected:
             virtual void spawnPlayersIfRequested(); //!< Spawns player.
 
+
         private:
-            void startStone(void); //!< Starts with the first stone.
-            void createStone(void);
+            void startBrick(void);
+            void createBrick(void);
             void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
             bool isValidStonePosition(TetrisStone* stone, const Vector3& position);
-            
+            bool isValidBrickPosition(TetrisBrick* brick);
+            void findFullRows(void);
+            void clearRow(unsigned int row);
+
+
             PlayerInfo* player_;
 
             WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
-            std::vector<TetrisStone*> stones_; //!< A list of all stones in play.
-            std::vector< std::vector<bool> > grid_;
-            TetrisStone* activeStone_;
-            
+            std::list<SmartPtr<TetrisStone> > stones_; //!< A list of all stones in play.
+            WeakPtr<TetrisBrick> activeBrick_;
+            WeakPtr<TetrisBrick> futureBrick_;
+
             Timer starttimer_; //!< A timer to delay the start of the game.
     };
Index: code/trunk/src/modules/tetris/TetrisBrick.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisBrick.cc	(revision 9348)
+++ code/trunk/src/modules/tetris/TetrisBrick.cc	(revision 9348)
@@ -0,0 +1,247 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file TetrisBrick.cc
+    @brief Implementation of the TetrisBrick class.
+*/
+
+#include "TetrisBrick.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "TetrisCenterpoint.h"
+#include "TetrisStone.h"
+#include "Tetris.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(TetrisBrick);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    @ingroup Tetris
+    */
+    TetrisBrick::TetrisBrick(BaseObject* creator): ControllableEntity(creator)
+    {
+        RegisterObject(TetrisBrick);
+        this->shapeIndex_ = static_cast<unsigned int>(rnd(7.0f)); //<! random number between 0 and 7
+        this->stonesPerBrick_ = 4; //<! most tetris bricks is formed by 4 stones
+        this->delay_ = false;
+        this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisBrick::enableMovement, this)));
+        this->lockRotation_ = false;
+        this->tetris_ = this->getTetris();
+        this->size_ = 10.0f; //TODO: fix this via this->tetris_->center_->getStoneSize();
+        this->rotationCount_ = 0;
+        this->createBrick(); //<! create a whole new Brick;
+    }
+
+    /**
+    @brief
+        This function partly initializes a TetrisBrick as an array of TetrisStones
+    */
+    void TetrisBrick::createBrick(void)
+    { //Index 0 : single stone, 1 : 4 in a row; 2: 4-Block right shifted; 3: 'T' 4: 4-Block left shifted;
+      //Index 5 : 4-Block; 6 : 'L'; 7 : mirrored 'L';
+        if(this->shapeIndex_ == 0)
+            this->stonesPerBrick_ = 1;
+        for (unsigned int i = 0; i < this->stonesPerBrick_; i++)
+        {
+            // Create a new stone and add it to the brick.
+            TetrisStone* stone = new TetrisStone(this);
+            this->brickStones_.push_back(stone);
+            this->attach(stone);
+            this->formBrick(stone, i);
+            if(this->tetris_ != NULL)
+            {
+                stone->setGame(this->tetris_);
+                if(this->tetris_->getCenterpoint() != NULL)
+                    stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate());
+                else
+                	orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl;
+            }
+            else
+                orxout()<< "tetris_ == NULL in TetrisBrick.cc"<< endl;
+        }
+    }
+
+    /**
+    @brief
+        This function creates the shape of a TetrisBrick. ! Spaghetti-Code !
+    @param i
+        The stone's number.
+    @param stone
+        The TetrisStone that is placed relative to the brick's position.
+    */
+    void TetrisBrick::formBrick(TetrisStone* stone, unsigned int i)
+    {
+        if(i == 0) //setting the first stone as
+        {
+            stone->setPosition(0.0f, 0.0f, 0.0f);
+        }
+        else if(i == 1)
+        {
+            stone->setPosition(0.0f, size_, 0.0f);
+        }
+        else if(i == 2)
+        {
+            if(this->shapeIndex_ == 1 || this->shapeIndex_ == 6 || this->shapeIndex_ == 7)
+            {
+            	stone->setPosition(0.0f, 2*size_, 0.0f);
+            }
+            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5)
+            {
+            	stone->setPosition(size_, 0, 0.0f);
+            }
+            else if(this->shapeIndex_ == 2)
+            {
+            	stone->setPosition(-size_, 0, 0.0f);
+            }
+        }
+        else if(i == 3)
+        {
+            if(this->shapeIndex_ == 2 || this->shapeIndex_ == 5)
+            {
+            	stone->setPosition(size_, size_, 0.0f);
+            }
+            else if(this->shapeIndex_ == 1)
+            {
+            	stone->setPosition(0, 3*size_, 0.0f);
+            }
+            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7)
+            {
+            	stone->setPosition(-size_, 0, 0.0f);
+            }
+            else if(this->shapeIndex_ == 4)
+            {
+            	stone->setPosition(-size_, size_, 0.0f);
+            }
+            else if(this->shapeIndex_ == 6)
+            {
+            	stone->setPosition(size_, 0, 0.0f);
+            }
+        }
+    }
+
+    bool TetrisBrick::isValidMove(const Vector3& position, bool isRotation = false)
+    {
+    	return this->tetris_->isValidMove(this,position, isRotation);
+    }
+
+    TetrisStone* TetrisBrick::getStone(unsigned int i)
+    {
+    	if(i < this->brickStones_.size())
+            return this->brickStones_[i];
+    	else return NULL;
+    }
+
+
+    Tetris* TetrisBrick::getTetris()
+    {
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris)))
+        {
+            Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype().get());
+            return tetrisGametype;
+        }
+        return NULL;
+    }
+
+    /**
+    @brief
+        Overloaded the function to rotate the Brick.
+    @param value
+        A vector whose first component is the angle by which to rotate.
+    */
+    void TetrisBrick::moveFrontBack(const Vector2& value)
+    {
+        if(value.x < 0) //speedup on key down
+        {
+            this->setVelocity(this->getVelocity()*1.1);
+        }
+        else if(!this->lockRotation_) //rotate when key up is pressed
+        {
+        	if(!isValidMove(this->getPosition(), true)) //catch illegal rotations
+        	    return;
+            this->lockRotation_ = true; // multiple calls of this function have to be filtered out.
+            this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisBrick::unlockRotation, this)));
+            Quaternion q(Degree(90), Vector3::UNIT_Z);
+            this->setOrientation(this->getOrientation()*q); //rotation: roll 90°
+            this->rotationCount_ = (this->rotationCount_ + 1) % 4;
+        }
+    }
+
+    /**
+    @brief
+        Overloaded the function to steer the Brick right and left
+    @param value
+        A vector whose first component is the direction in which we want to steer the Brick.
+    */
+    void TetrisBrick::moveRightLeft(const Vector2& value)
+    {
+        if(!this->delay_)
+        {
+            const Vector3& position = this->getPosition();
+            Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
+            if(!this->isValidMove(newPos))
+                return;
+
+            this->setPosition(newPos);
+            this->delay_ = true;
+            this->delayTimer_.startTimer();
+        }
+    }
+
+    /**
+    @brief
+        Is called when the player changed.
+    */
+    void TetrisBrick::changedPlayer()
+    {
+        this->setVelocity(0.0f, 0.0f, 0.0f);
+    }
+
+    /**
+    @brief
+        Attaches stones to the Centerpoint.
+    */
+    void TetrisBrick::releaseStones(TetrisCenterpoint* center)
+    {
+        assert(this->tetris_);
+        for(unsigned int i = 0; i < this->brickStones_.size(); i++)
+        {
+            this->brickStones_[i]->detachFromParent();
+            this->brickStones_[i]->attachToParent(center);
+            this->brickStones_[i]->setPosition(this->getPosition()+this->tetris_->rotateVector(this->brickStones_[i]->getPosition(),this->rotationCount_ ));
+        }
+        this->brickStones_.clear();
+    }
+
+}
Index: code/trunk/src/modules/tetris/TetrisBrick.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisBrick.h	(revision 9348)
+++ code/trunk/src/modules/tetris/TetrisBrick.h	(revision 9348)
@@ -0,0 +1,106 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file TetrisBrick.h
+    @brief Declaration of the TetrisBrick class.
+    @ingroup Tetris
+*/
+
+#ifndef _TetrisBrick_H__
+#define _TetrisBrick_H__
+
+#include "tetris/TetrisPrereqs.h"
+
+#include "worldentities/ControllableEntity.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        ContainerClass in order to create TetrisBricks by combining TetrisStones.
+    @author
+
+    @ingroup Tetris
+    */
+    class _TetrisExport TetrisBrick : public ControllableEntity
+    {
+        public:
+            TetrisBrick(BaseObject* creator); //!< Constructor. Registers and initializes the object.
+            virtual ~TetrisBrick() {}
+
+            virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+            virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+            virtual void changedPlayer(); //!< Is called when the player changed.
+
+            bool isValidMove(const Vector3& position, bool isRotation);
+            unsigned int getNumberOfStones(void) const
+                { return this->brickStones_.size(); }
+            TetrisStone* getStone(unsigned int i);
+
+            void setGame(Tetris* tetris)
+                { assert(tetris); tetris_ = tetris; }
+            unsigned int getRotationCount(void)
+                { return this->rotationCount_;}
+
+            void releaseStones(TetrisCenterpoint* center);
+
+        protected:
+            void createBrick(void); //!< Create a cluster of TetrisStones
+            void formBrick(TetrisStone* stone, unsigned int i);
+            Tetris* getTetris();
+
+            unsigned int shapeIndex_; //!< My way to represent the different brick shapes.
+            unsigned int stonesPerBrick_; //!< So many stones are contained in this brick.
+            std::vector<TetrisStone*> brickStones_; //!< A list of all stones in a brick.
+
+
+            void enableMovement(void)
+                { this->delay_ = false; }
+            void unlockRotation(void)
+                { this->lockRotation_ = false; }
+
+            float getSize(void) const
+                { return this->size_; }
+
+
+            float size_; //!< The dimensions a stone has in the game world. //TODO: get stone dimensions
+            bool delay_;
+            bool lockRotation_;
+
+            unsigned int rotationCount_; //!< Stores the bricks orientation
+            Timer delayTimer_;
+            Timer rotationTimer_; ///!< This timer is used to filter out multiple rotation inputs.
+            Tetris* tetris_; //<! The Tetris class is responsible to initialize this value.
+
+    };
+}
+
+#endif /* _TetrisBrick_H__ */
Index: code/trunk/src/modules/tetris/TetrisCenterpoint.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.cc	(revision 9347)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.cc	(revision 9348)
@@ -30,4 +30,5 @@
     @file TetrisCenterpoint.cc
     @brief Implementation of the TetrisCenterpoint class.
+    @ingroup Tetris
 */
 
@@ -55,4 +56,5 @@
         this->stoneSize_ = 10.0f;
         this->stoneTemplate_ = "";
+        this->brickTemplate_ = "";
         this->stoneSpeed_ = 20.0f;
         
@@ -69,7 +71,8 @@
 
         XMLPortParam(TetrisCenterpoint, "width", setWidth, getWidth, xmlelement, mode); // die Breite
-        XMLPortParam(TetrisCenterpoint, "height", setHeight, setWidth, xmlelement, mode); // die Grösse
+        XMLPortParam(TetrisCenterpoint, "height", setHeight, getHeight, xmlelement, mode); // die Grösse //was sollte das mit setWidth??
         XMLPortParam(TetrisCenterpoint, "stoneSize", setStoneSize, getStoneSize, xmlelement, mode); 
         XMLPortParam(TetrisCenterpoint, "stoneTemplate", setStoneTemplate, getStoneTemplate, xmlelement, mode);
+        XMLPortParam(TetrisCenterpoint, "brickTemplate", setBrickTemplate, getBrickTemplate, xmlelement, mode);
         XMLPortParam(TetrisCenterpoint, "stoneSpeed", setStoneSpeed, getStoneSpeed, xmlelement, mode);
     }
Index: code/trunk/src/modules/tetris/TetrisCenterpoint.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisCenterpoint.h	(revision 9347)
+++ code/trunk/src/modules/tetris/TetrisCenterpoint.h	(revision 9348)
@@ -45,5 +45,6 @@
 
 namespace orxonox
-{
+{//idea: add 2 triggers to the centerpoint (one to determine when a box would go above the centerpoint;
+//the other to find out when the lowest row is filled totally)
     
     /**
@@ -118,4 +119,17 @@
             
             /**
+            @brief Set the template for the bricks.
+            @param template The template name to be applied to each brick.
+            */
+            void setBrickTemplate(const std::string& templateName)
+                { this->brickTemplate_ = templateName; }
+            /**
+            @brief Get the template for the bricks.
+            @return Returns the template name to be applied to each brick.
+            */
+            const std::string& getBrickTemplate(void) const
+                { return this->brickTemplate_; }
+
+            /**
             @brief Set the speed of the stones.
             @param speed The speed to be set.
@@ -137,4 +151,5 @@
             float stoneSize_;
             std::string stoneTemplate_;
+            std::string brickTemplate_;
             float stoneSpeed_;
 
Index: code/trunk/src/modules/tetris/TetrisPrereqs.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisPrereqs.h	(revision 9347)
+++ code/trunk/src/modules/tetris/TetrisPrereqs.h	(revision 9348)
@@ -68,4 +68,6 @@
     class TetrisCenterpoint;
     class TetrisStone;
+    class TetrisBrick;
+    class TetrisScore;
 }
 
Index: code/trunk/src/modules/tetris/TetrisScore.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisScore.cc	(revision 9348)
+++ code/trunk/src/modules/tetris/TetrisScore.cc	(revision 9348)
@@ -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:
+ *      Johannes Ritz
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file TetrisScore.cc
+    @brief Implementation of the TetrisScore class.
+    @ingroup Tetris
+*/
+
+#include "TetrisScore.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+#include "infos/PlayerInfo.h"
+
+#include "Tetris.h"
+
+namespace orxonox
+{
+    CreateFactory(TetrisScore);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    @ingroup Tetris
+    */
+    TetrisScore::TetrisScore(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(TetrisScore);
+
+        this->owner_ = 0;
+        this->player_ = NULL;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    TetrisScore::~TetrisScore()
+    {
+    }
+
+    /**
+    @brief
+        Method to create a TetrisScore through XML.
+    */
+    void TetrisScore::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TetrisScore, XMLPort, xmlelement, mode);
+    }
+
+    /**
+    @brief
+        Is called each tick.
+        Creates and sets the caption to be displayed by the TetrisScore.
+    @param dt
+        The time that has elapsed since the last tick.
+    */
+    void TetrisScore::tick(float dt)
+    {
+        SUPER(TetrisScore, tick, dt);
+
+        // If the owner is set. The owner being a Tetris game.
+        if (this->owner_ != NULL)
+        {
+            std::string score("0");
+	        if(!this->owner_->hasEnded())
+            {
+                //get the player
+                player_ = this->owner_->getPlayer();
+            }
+
+            if(this->owner_->hasStarted())
+            {
+                // Save the name and score of each player as a string.
+                if (player_ != NULL)
+                    score = multi_cast<std::string>(this->owner_->getScore(player_));
+            }
+            this->setCaption(score);
+        }
+    }
+
+    /**
+    @brief
+        Is called when the owner changes.
+        Sets the owner to NULL, if it is not a pointer to a Tetris game.
+    */
+    void TetrisScore::changedOwner()
+    {
+        SUPER(TetrisScore, changedOwner);
+
+        if (this->getOwner() != NULL && this->getOwner()->getGametype())
+            this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype().get());
+        else
+            this->owner_ = 0;
+    }
+}
Index: code/trunk/src/modules/tetris/TetrisScore.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisScore.h	(revision 9348)
+++ code/trunk/src/modules/tetris/TetrisScore.h	(revision 9348)
@@ -0,0 +1,71 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @file TetrisScore.h
+    @brief Declaration of the TetrisScore class.
+    @ingroup Tetris
+*/
+
+#ifndef _TetrisScore_H__
+#define _TetrisScore_H__
+
+#include "tetris/TetrisPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The TetrisScore class displays the score for a game of @ref orxonox::Tetris "Tetris".
+
+    @author
+        Johannes Ritz
+
+    @ingroup Tetris
+    */
+    class _TetrisExport TetrisScore : public OverlayText, public Tickable
+    {
+        public:
+            TetrisScore(BaseObject* creator);
+            virtual ~TetrisScore();
+
+            virtual void tick(float dt); //!< Creates and sets the caption to be displayed by the TetrisScore.
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void changedOwner(); //!< Is called when the owner changes.
+
+        private:
+            Tetris* owner_; //!< The Tetris game that owns this TetrisScore.
+            PlayerInfo* player_; //!< Store information about the player permanently.
+    };
+}
+#endif /* _TetrisScore_H__ */
Index: code/trunk/src/modules/tetris/TetrisStone.cc
===================================================================
--- code/trunk/src/modules/tetris/TetrisStone.cc	(revision 9347)
+++ code/trunk/src/modules/tetris/TetrisStone.cc	(revision 9348)
@@ -30,4 +30,5 @@
     @file TetrisStone.cc
     @brief Implementation of the TetrisStone class.
+    @ingroup Tetris
 */
 
@@ -47,11 +48,13 @@
         Constructor. Registers and initializes the object.
     */
-    TetrisStone::TetrisStone(BaseObject* creator) : ControllableEntity(creator)
+    TetrisStone::TetrisStone(BaseObject* creator) : MovableEntity(creator)
     {
         RegisterObject(TetrisStone);
-        
+
         this->size_ = 10.0f;
         this->delay_ = false;
         this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
+        this->lockRotation_ = false;
+
     }
 
@@ -64,7 +67,15 @@
     void TetrisStone::moveFrontBack(const Vector2& value)
     {
-        if(value.x < 0)
+        if(value.x < 0) //speedup on key down
         {
             this->setVelocity(this->getVelocity()*1.1);
+        }
+        else if(!this->lockRotation_) //rotate when key up is pressed
+        {
+            this->lockRotation_ = true; // multiple calls of this function have to be filtered out.
+            this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisStone::unlockRotation, this)));
+            Quaternion q(Degree(90), Vector3::UNIT_Z);
+            this->setOrientation(this->getOrientation()*q); //rotation: roll 90°
+
         }
     }
Index: code/trunk/src/modules/tetris/TetrisStone.h
===================================================================
--- code/trunk/src/modules/tetris/TetrisStone.h	(revision 9347)
+++ code/trunk/src/modules/tetris/TetrisStone.h	(revision 9348)
@@ -38,5 +38,5 @@
 #include "tetris/TetrisPrereqs.h"
 
-#include "worldentities/ControllableEntity.h"
+#include "worldentities/MovableEntity.h"
 #include "tools/Timer.h"
 
@@ -51,5 +51,5 @@
     @ingroup Tetris
     */
-    class _TetrisExport TetrisStone : public ControllableEntity
+    class _TetrisExport TetrisStone : public MovableEntity
     {
         public:
@@ -81,8 +81,12 @@
             void enableMovement(void)
                 { this->delay_ = false; }
-            
+            void unlockRotation(void)
+                { this->lockRotation_ = false; }
+
             float size_; //!< The dimensions a stone has in the game world.
             bool delay_;
+            bool lockRotation_;
             Timer delayTimer_;
+            Timer rotationTimer_; ///!< This timer is used to filter out multiple rotation inputs.
 
             Tetris* tetris_;
Index: code/trunk/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 9348)
+++ code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 9348)
@@ -0,0 +1,17 @@
+SET_SOURCE_FILES(TOWERDEFENSE_SRC_FILES
+  TowerDefense.cc
+  Tower.cc
+  TowerDefenseCenterpoint.cc
+  TowerDefenseHUDController.cc
+  TowerDefensePlayerStats.cc
+
+)
+
+ORXONOX_ADD_LIBRARY(TowerDefense
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+    overlays
+  SOURCE_FILES ${TOWERDEFENSE_SRC_FILES}
+)
Index: code/trunk/src/modules/towerdefense/TDEnemy.h
===================================================================
--- code/trunk/src/modules/towerdefense/TDEnemy.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TDEnemy.h	(revision 9348)
@@ -0,0 +1,26 @@
+/*
+ * TDEnemy.h
+ *
+ *  Created on: Mar 30, 2012
+ *      Author: weigeltm
+ */
+
+#ifndef TDENEMY_H_
+#define TDENEMY_H_
+
+class TDEnemy
+{
+
+private:
+    float health;
+    float speed;
+    float armour;
+
+
+
+
+
+};
+
+
+#endif /* TDENEMY_H_ */
Index: code/trunk/src/modules/towerdefense/Tower.cc
===================================================================
--- code/trunk/src/modules/towerdefense/Tower.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/Tower.cc	(revision 9348)
@@ -0,0 +1,113 @@
+//
+//  Tower.cc
+//  Orxonox
+//
+//  Created by Fabian Mentzer on 29.04.12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/* Not implemented fully */
+
+#include "Tower.h"
+
+#include "core/CoreIncludes.h"
+//#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(Tower);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Tower::Tower(BaseObject* creator) : Pawn(creator)
+    {
+        RegisterObject(Tower);
+
+        this->setCollisionType(WorldEntity::Dynamic);
+
+        //this->removeAllEngines();
+
+        /*
+        this->size_ = 10.0f;
+        this->delay_ = false;
+        this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
+        */
+    }
+
+    void Tower::setOrientation(const Quaternion& orientation)
+    {
+        static int ori;
+        orxout() << "orientation " << ++ori << endl;
+    }
+
+    void Tower::rotateYaw(const Vector2& value)
+    {
+        static int yaw;
+        orxout() << "rotateYaw " << ++yaw << endl;
+    }
+
+    void Tower::rotatePitch(const Vector2& value)
+    {
+        static int pitch;
+        orxout() << "rotatePitch " << ++pitch << endl;
+    }
+
+    void Tower::rotateRoll(const Vector2& value)
+    {
+        static int roll;
+        orxout() << "rotateRoll" << ++roll << endl;
+    }
+
+    // This function is called whenever a player presses the up or the down key.
+    // You have to implement what happens when the up or the down key is pressed.
+    // value.x < 0 means: down key is pressed.
+    // I suggest to create a new class which is a controllable entity I will refer to as "TowerMover". This is the controllable entity that the
+    // player controls in order to move the tower along the centerpoint and in order to place the tower at the appropriate position.
+    //
+
+    // The tower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint.
+    //(don't forget to set the team_ parameter such that all tower are in the same team)
+
+    //How to move a tower: simply attach the tower to the TowerMover
+    //How to place a tower: detach the tower from the TowerMover
+
+    /**
+    @brief
+        Overloaded the function to rotate the stone.
+    @param value
+        A vector whose first component is the angle by which to rotate.
+    */
+    /*
+    void Tower::moveFrontBack(const Vector2& value)
+    {
+        //orxout() << "frontBack.x: " << value.x << endl;
+    }
+    */
+
+    /**
+    @brief
+        Overloaded the function to steer the stone right and left
+    @param value
+        A vector whose first component is the direction in which we want to steer the stone.
+    */
+    /*
+    void Tower::moveRightLeft(const Vector2& value)
+    {
+        //orxout() << "rightLeft.x: " << value.x << endl;
+
+        if(!this->delay_)
+        {
+            const Vector3& position = this->getPosition();
+            Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
+            if(!this->tetris_->isValidMove(this, newPos))
+                return;
+
+            this->setPosition(newPos);
+            this->delay_ = true;
+            this->delayTimer_.startTimer();
+        }
+    }
+    */
+}
Index: code/trunk/src/modules/towerdefense/Tower.h
===================================================================
--- code/trunk/src/modules/towerdefense/Tower.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/Tower.h	(revision 9348)
@@ -0,0 +1,52 @@
+//
+//  Tower.h
+//  Orxonox
+//
+//  Created by Fabian Mentzer on 29.04.12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/**
+@brief
+See TowerDefenseReadme.txt for Information.
+
+@ingroup TowerDefense
+*/
+
+
+#ifndef Orxonox_Tower_h
+#define Orxonox_Tower_h
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/pawns/SpaceShip.h"
+
+
+namespace orxonox
+{
+    class _TowerDefenseExport Tower : public Pawn
+    {
+    public:
+        Tower(BaseObject* creator);
+        virtual ~Tower() {};
+
+        // Maybe later override these to move towers with cursor keys
+        /*
+        virtual void moveFrontBack(const Vector2& value);
+        virtual void moveRightLeft(const Vector2& value);
+        */
+
+        // Overriding these to stop towers from spasing out
+        void setOrientation(const Quaternion& orientation);
+        virtual void rotateYaw(const Vector2& value);
+        virtual void rotatePitch(const Vector2& value);
+        virtual void rotateRoll(const Vector2& value);
+
+        void setGame(TowerDefense* towerdefense)
+        { assert(towerdefense); game_ = towerdefense; }
+    private:
+        TowerDefense* game_;
+    };
+}
+
+
+#endif
Index: code/trunk/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 9348)
@@ -0,0 +1,307 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ *
+ *NACHRICHT:
+ *
+ * Hier empfehle ich euch die gesamte Spielogik unter zu bringen. Viele Funktionen werden automatisch
+ * bei gewissen Ereignissen aufgerufen bzw. lösen Ereignisse aus
+ *
+ *Z.B:
+ * start() //wird aufgerufen, bevor das Spiel losgeht
+ * end() //wenn man diese Funktion aufruft wird
+ * pawnKilled() // wird aufgerufen, wenn ein Pawn stirbt (z.B: wenn )
+ * playerScored() // kann man aufrufen um dem Spieler Punkte zu vergeben.
+ *
+ *
+ *
+ *TIPP: Eclipse hilft euch schnell auf bereits vorhanden Funktionen zuzugreifen:
+ * einfach "this->" eingeben und kurz warten. Dann tauch eine Liste mit Vorschlägen auf. Wenn ihr jetzt weiter
+ * tippt, werden die Vorschläge entsprechend gefiltert.
+ *
+ *
+ *TIPP: schaut euch mal Tetris::createStone() an. Dort wird ein TetrisStone-Objekt (ControllableEntity) erzeugt,
+ * ihm ein Template zugewiesen (welches vorher im Level definiert wurde und dem CenterPoint übergeben wurde)
+ * Ähnlich könnt ihr vorgehen, um einen Turm zu erzeugen. (Zusätzlich braucht ein Turm noch einen Controller)
+ * z.B: WaypointPatrolController. Wenn kein Team zugewiesen wurde bekämpft ein WaypointPatrolController alles,
+ * was in seiner Reichweite liegt.
+ *
+ *
+ *HUD:
+ * Ein Gametype kann ein HUD (Head up Display haben.) Z.B: hat Pong eine Anzeige welcher Spieler wieviele Punkte hat.
+ * Generell kann man a) Grafiken oder b) Zeichen in einer HUD anzeigen.
+ * Fuer den ersten Schritt reicht reiner Text.
+ *
+ * a)
+ * PongScore.cc uebernehmen und eigene Klasse draus machen.
+ * Wenn ihr bloss anzeigen wollt wieviele Punkte der Spieler bereits erspielt hat (Punkte = Kapital fuer neue Tuerme) dann orientiert ihr euch an
+ * TetrisScore.cc (im pCuts branch): http://www.orxonox.net/browser/code/branches/pCuts/src/modules/tetris/TetrisScore.cc
+ * Ich habe TetrisScore lediglich dazu gebraucht, um eine Variable auf dem HUD auszugeben. Ein Objekt fuer statischen Text gibt es bereits.
+ *
+ * b)
+ * Im naesten Schritt erstellt man die Vorlage fuer das HUD-Objekt: siehe /data/overlays/pongHUD
+ * OverlayText ist eine Vorlage fuer statischen text zb: "Points Scored:". Aus mir nicht erklaerlichen Gruenden sollte man die OverlayText
+ * Objekte immer erst nach dem PongScore anlegen.
+ *
+ * c)  Im TowerDefense gamtype muss im Constructor noch das HUD-Template gesetzt werden.
+ *
+ * d) in CMakeLists.txt noch das Module includen das fuer die Overlays zustaendig ist. Siehe das gleiche File im Pong module.
+ *
+ *
+ *
+ */
+
+#include "TowerDefense.h"
+#include "Tower.h"
+#include "TowerDefenseCenterpoint.h"
+
+#include "worldentities/SpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "controllers/WaypointController.h"
+
+#include "graphics/Model.h"
+#include "infos/PlayerInfo.h"
+
+#include "chat/ChatManager.h"
+
+/* Part of a temporary hack to allow the player to add towers */
+#include "core/command/ConsoleCommand.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TowerDefense);
+
+    TowerDefense::TowerDefense(BaseObject* creator) : Deathmatch(creator)
+    {
+        RegisterObject(TowerDefense);
+
+        this->setHUDTemplate("TowerDefenseHUD");
+
+        this->stats_ = new TowerDefensePlayerStats();
+
+        /* Temporary hack to allow the player to add towers */
+        this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
+    }
+
+    TowerDefense::~TowerDefense()
+    {
+        /* Part of a temporary hack to allow the player to add towers */
+        if (this->isInitialized())
+        {
+            if( this->dedicatedAddTower_ )
+                delete this->dedicatedAddTower_;
+        }
+    }
+
+    void TowerDefense::setCenterpoint(TowerDefenseCenterpoint *centerpoint)
+    {
+        orxout() << "Centerpoint now setting..." << endl;
+        this->center_ = centerpoint;
+        orxout() << "Centerpoint now set..." << endl;
+    }
+
+    void TowerDefense::start()
+    {
+        Deathmatch::start();
+
+        const int kInitialTowerCount = 3;
+        Coordinate initialTowerCoordinates[kInitialTowerCount] = {{3,2}, {8,5}, {12,10}};
+
+        for (int i = 0; i < kInitialTowerCount; i++)
+        {
+            Coordinate coordinate = initialTowerCoordinates[i];
+            addTower(coordinate.x, coordinate.y);
+        }
+
+        ChatManager::message("Use the console command addTower x y to add towers");
+
+        //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player
+    }
+
+    void TowerDefense::end()
+    {
+        Deathmatch::end();
+
+        ChatManager::message("Match is over");
+    }
+
+    void TowerDefense::addTower(int x, int y)
+    {
+        const TowerCost towerCost = TDDefaultTowerCost;
+
+        if (!this->hasEnoughCreditForTower(towerCost))
+        {
+            orxout() << "not enough credit: " << (this->stats_->getCredit()) << " available, " << TDDefaultTowerCost << " needed.";
+            return;
+        }
+
+        if (this->towerExists(x,y))
+        {
+            orxout() << "tower exists!!" << endl;
+            return;
+        }
+
+        /*
+        unsigned int width = this->center_->getWidth();
+        unsigned int height = this->center_->getHeight();
+        */
+
+        int tileScale = (int) this->center_->getTileScale();
+
+        if (x > 15 || y > 15 || x < 0 || y < 0)
+        {
+            //Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
+            orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
+            return;
+        }
+
+        orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
+
+        // Add tower to coordinatesStack
+        Coordinate newTowerCoordinates = {x, y};
+        addedTowersCoordinates_.push_back(newTowerCoordinates);
+
+        // Reduce credit
+        this->stats_->buyTower(towerCost);
+
+        // Create tower
+        Tower* newTower = new Tower(this->center_);
+        newTower->addTemplate(this->center_->getTowerTemplate());
+
+        newTower->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 75);
+        newTower->setGame(this);
+    }
+
+    bool TowerDefense::hasEnoughCreditForTower(TowerCost towerCost)
+    {
+        return ((this->stats_->getCredit()) >= towerCost);
+    }
+
+    bool TowerDefense::towerExists(int x, int y)
+    {
+        for(std::vector<Coordinate>::iterator it = addedTowersCoordinates_.begin(); it != addedTowersCoordinates_.end(); ++it)
+        {
+            Coordinate currentCoordinates = (Coordinate) (*it);
+            if (currentCoordinates.x == x && currentCoordinates.y == y)
+                return true;
+        }
+
+        return false;
+    }
+
+
+    void TowerDefense::tick(float dt)
+    {
+        SUPER(TowerDefense, tick, dt);
+    }
+
+    // Function to test if we can add waypoints using code only. Doesn't work yet
+
+    // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL???
+    /*
+    void TowerDefense::addWaypointsAndFirstEnemy()
+    {
+        SpaceShip *newShip = new SpaceShip(this->center_);
+        newShip->addTemplate("spaceshipassff");
+
+        WaypointController *newController = new WaypointController(newShip);
+        newController->setAccuracy(3);
+
+        Model *wayPoint1 = new Model(newController);
+        wayPoint1->setMeshSource("crate.mesh");
+        wayPoint1->setPosition(7,-7,5);
+        wayPoint1->setScale(0.2);
+
+        Model *wayPoint2 = new Model(newController);
+        wayPoint2->setMeshSource("crate.mesh");
+        wayPoint2->setPosition(7,7,5);
+        wayPoint2->setScale(0.2);
+
+        newController->addWaypoint(wayPoint1);
+        newController->addWaypoint(wayPoint2);
+
+        // The following line causes the game to crash
+
+        newShip->setController(newController);
+//        newController -> getPlayer() -> startControl(newShip);
+        newShip->setPosition(-7,-7,5);
+        newShip->setScale(0.1);
+        //newShip->addSpeed(1);
+
+
+
+//      this->center_->attach(newShip);
+    }
+    */
+    /*
+    void TowerDefense::playerEntered(PlayerInfo* player)
+    {
+        Deathmatch::playerEntered(player);
+
+        const std::string& message = player->getName() + " entered the game";
+        ChatManager::message(message);
+    }
+
+    bool TowerDefense::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Deathmatch::playerLeft(player);
+
+        if (valid_player)
+        {
+            const std::string& message = player->getName() + " left the game";
+            ChatManager::message(message);
+        }
+
+        return valid_player;
+    }
+
+
+    void TowerDefense::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer())
+        {
+            std::string message;
+            if (killer)
+            {
+                if (killer->getPlayer())
+                    message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+                else
+                    message = victim->getPlayer()->getName() + " was killed";
+            }
+            else
+                message = victim->getPlayer()->getName() + " died";
+
+            ChatManager::message(message);
+        }
+
+        Deathmatch::pawnKilled(victim, killer);
+    }
+
+    void TowerDefense::playerScored(PlayerInfo* player, int score)
+    {
+        Gametype::playerScored(player, score);
+    }*/
+}
Index: code/trunk/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefense.h	(revision 9348)
@@ -0,0 +1,98 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /**
+    @brief
+        GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
+
+    @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefense_H__
+#define _TowerDefense_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "gametypes/Deathmatch.h"
+
+ #include "TowerDefensePlayerStats.h"
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerDefense : public Deathmatch
+    {
+    public:
+        TowerDefense(BaseObject* creator);
+        virtual ~TowerDefense();
+
+        virtual void start(); //<! The function is called when the gametype starts
+        virtual void end();
+        virtual void tick(float dt);
+        //virtual void playerEntered(PlayerInfo* player);
+        //virtual bool playerLeft(PlayerInfo* player);
+
+        //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+        //virtual void playerScored(PlayerInfo* player, int score);
+
+
+        /*  Called by TowerDefenseCenterpoint upon game start
+            The centerpoint is used to create towers
+        */
+        void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
+
+        /* Adds a tower at x, y in the playfield */
+        void addTower(int x, int y);
+
+        /* Part of a temporary hack to allow the player to add towers */
+        ConsoleCommand* dedicatedAddTower_;
+
+        //TODO: void spawnNewWave()
+        //TODO: create a timer which regularly calls the spawnNewWave function  (time driven)
+        //      or spawn a new wave when the old wave has been killed           (event driven)
+
+
+    private:
+        TowerDefenseCenterpoint *center_;
+
+        /* handles stats */
+        TowerDefensePlayerStats *stats_;
+        bool hasEnoughCreditForTower(TowerCost towerCost);
+
+        bool towerExists(int x, int y);
+
+        typedef struct {
+            int x;
+            int y;
+        } Coordinate;
+
+        std::vector<Coordinate> addedTowersCoordinates_;
+        std::vector<Tower*> towers_;
+    };
+}
+
+#endif /* _TowerDefense_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 9348)
@@ -0,0 +1,109 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file TowerDefenseCenterpoint.cc
+    @brief Implementation of the TowerDefenseCenterpoint class.
+*/
+
+#include "TowerDefenseCenterpoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "TowerDefense.h"
+
+namespace orxonox
+{
+    CreateFactory(TowerDefenseCenterpoint);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
+    */
+    TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : MobileEntity(creator)
+    {
+        RegisterObject(TowerDefenseCenterpoint);
+
+        this->width_ = 15;
+        this->height_ = 15;
+        this->towerTemplate_ = "";
+
+        //this->setCollisionType(Static);
+
+        this->checkGametype();
+
+    }
+
+    /**
+    @brief
+        Method to create a TowerDefenseCenterpoint through XML.
+    */
+    void TowerDefenseCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TowerDefenseCenterpoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TowerDefenseCenterpoint, "width", setWidth, getWidth, xmlelement, mode);
+        XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, getHeight, xmlelement, mode);
+        XMLPortParam(TowerDefenseCenterpoint, "tileScale", setTileScale, getTileScale, xmlelement, mode);
+        XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode);
+
+        //TODO: add XMLPortObject(TowerDefenseCenterpoint, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
+        // This was copied and shightly modified from WaypointController.cc ; there are no getters and setters and no membervariable yet
+        // The centerpoint should have all waypoints for "attached" to it. By using this function you can seperately add waypoints
+        // When you spawn a new enemy you should let it be controlled by a WaypointController. And that controller should get the waypoints.
+
+        // Alternatively you can manage the waypoints directly in TowerDefense.cc
+    }
+
+    /**
+    @brief
+        Is called when the gametype has changed.
+    */
+    void TowerDefenseCenterpoint::changedGametype()
+    {
+        SUPER(TowerDefenseCenterpoint, changedGametype);
+
+        // Check, whether it's still TowerDefense.
+        this->checkGametype();
+    }
+
+    /**
+    @brief
+        Checks whether the gametype is TowerDefense and if it is, sets its centerpoint.
+    */
+    void TowerDefenseCenterpoint::checkGametype()
+    {
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(TowerDefense)))
+        {
+            // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
+            TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype().get());
+            towerDefenseGametype->setCenterpoint(this);
+        }
+    }
+}
Index: code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 9348)
@@ -0,0 +1,102 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @brief
+ See TowerDefenseReadme.txt for Information.
+ @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefenseCenterpoint_H__
+#define _TowerDefenseCenterpoint_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+#include <string>
+#include <util/Math.h>
+
+#include "worldentities/MobileEntity.h"
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerDefenseCenterpoint : public MobileEntity
+    {
+        public:
+            TowerDefenseCenterpoint(BaseObject* creator);
+            virtual ~TowerDefenseCenterpoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void changedGametype();
+
+            /**
+            @brief The width and hight in number of tiles. Default is 15 for both.
+            */
+            void setWidth(unsigned int width)
+                { this->width_ = width; }
+
+            unsigned int getWidth(void) const
+                { return this->width_; }
+
+            void setHeight(unsigned int height)
+                { this->height_ = height; }
+
+            unsigned int getHeight(void) const
+                { return this->height_; }
+
+            /**
+                @brief How to convert to world coordinates, e.g. that 0,15 is not at -8,-8 but at -80,-80 (if scale would be 10)
+            */
+            void setTileScale(unsigned int tileScale)
+                { this->tileScale_ = tileScale; }
+
+            unsigned int getTileScale(void) const
+                { return this->tileScale_; }
+
+            /**
+            @brief Set the template for the towers.
+            @param template The template name to be applied to each tower.
+            */
+            void setTowerTemplate(const std::string& templateName)
+                { this->towerTemplate_ = templateName; }
+
+            const std::string& getTowerTemplate(void) const
+                { return this->towerTemplate_; }
+
+        private:
+            void checkGametype();
+
+            unsigned int width_;
+            unsigned int height_;
+            unsigned int tileScale_;
+
+            std::string towerTemplate_;
+    };
+}
+
+#endif /* _TowerDefenseCenterpoint_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefenseController.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseController.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseController.cc	(revision 9348)
@@ -0,0 +1,144 @@
+/*
+ *   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 "TowerDefenseController.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(TowerDefenseController);
+
+    TowerDefenseController::TowerDefenseController(BaseObject* creator) : WaypointController(creator)
+    {
+        RegisterObject(TowerDefenseController);
+
+        this->alertnessradius_ = 500;
+
+        this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&TowerDefenseController::searchEnemy, this)));
+    }
+
+    void TowerDefenseController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TowerDefenseController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TowerDefenseController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
+    }
+
+    void TowerDefenseController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->target_)
+        {
+            this->aimAtTarget();
+
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+            if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
+                this->getControllableEntity()->fire(0);
+        }
+        else
+        {
+            SUPER(TowerDefenseController, tick, dt);
+        }
+    }
+
+
+    bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+    {
+        if (entity1 == entity2)
+            return true;
+
+        int team1 = -1;
+        int team2 = -1;
+
+        Controller* controller = 0;
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team1 = ac->getTeam();
+        }
+
+        if (entity2->getController())
+            controller = entity2->getController();
+        else
+            controller = entity2->getXMLController();
+        if (controller)
+        {
+            FormationController* ac = orxonox_cast<FormationController*>(controller);
+            if (ac)
+                team2 = ac->getTeam();
+        }
+
+
+
+        return (team1 == team2 && team1 != -1);
+    }
+
+
+
+
+
+    void TowerDefenseController::searchEnemy()
+    {
+        this->patrolTimer_.setInterval(rnd());
+
+        if (!this->getControllableEntity())
+            return;
+
+        Vector3 myposition = this->getControllableEntity()->getPosition();
+        float shortestsqdistance = (float)static_cast<unsigned int>(-1);
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        {
+            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            float sqdistance = it->getPosition().squaredDistance(myposition);
+            if (sqdistance < shortestsqdistance)
+            {
+                shortestsqdistance = sqdistance;
+                this->target_ = (*it);
+            }
+        }
+
+        if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
+            this->target_ = 0;
+    }
+}
Index: code/trunk/src/modules/towerdefense/TowerDefenseController.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseController.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseController.h	(revision 9348)
@@ -0,0 +1,61 @@
+/*
+ *   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 _TowerDefenseController_H__
+#define _TowerDefenseController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "WaypointController.h"
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerDefenseController : public WaypointController
+    {
+        public:
+            TowerDefenseController(BaseObject* creator);
+            virtual ~TowerDefenseController() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            inline void setAlertnessRadius(float radius)
+                { this->alertnessradius_ = radius; }
+            inline float getAlertnessRadius() const
+                { return this->alertnessradius_; }
+
+        protected:
+            void searchEnemy();
+
+            float alertnessradius_;
+            Timer patrolTimer_;
+    };
+}
+
+#endif /* _TowerDefenseController_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 9348)
@@ -0,0 +1,70 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ */
+
+#include "TowerDefenseHUDController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+
+namespace orxonox
+{
+    CreateFactory(TowerDefenseHUDController);
+
+    TowerDefenseHUDController::TowerDefenseHUDController(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(TowerDefenseHUDController);
+    }
+
+    TowerDefenseHUDController::~TowerDefenseHUDController()
+    {
+
+    }
+
+    void TowerDefenseHUDController::tick(float dt)
+    {
+        SUPER(TowerDefenseHUDController, tick, dt);
+    }
+
+    void TowerDefenseHUDController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TowerDefenseHUDController, XMLPort, xmlelement, mode);
+    }
+
+    void TowerDefenseHUDController::changedOwner()
+    {
+        SUPER(TowerDefenseHUDController, changedOwner);
+        /*
+        if (this->getOwner() != NULL && this->getOwner()->getGametype())
+            this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
+        else
+            this->owner_ = 0;
+        */
+    }
+
+}
Index: code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h	(revision 9348)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /**
+    @brief
+        This subclass of OverlayText is used to display the stats of the player in the HUD
+
+    @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefenseHUDController_H__
+#define _TowerDefenseHUDController_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerDefenseHUDController : public OverlayText, public Tickable
+    {
+    public:
+        TowerDefenseHUDController(BaseObject* creator);
+        virtual ~TowerDefenseHUDController();
+
+        virtual void tick(float dt);
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void changedOwner();
+    };
+}
+
+#endif /* _TowerDefenseHUDController_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc	(revision 9348)
@@ -0,0 +1,44 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ */
+
+#include "TowerDefensePlayerStats.h"
+
+namespace orxonox
+{
+    const int kDefaultCredit = 200;
+
+    TowerDefensePlayerStats::TowerDefensePlayerStats()
+    {
+        this->credit_ = kDefaultCredit;
+        this->waveNumber_ = 0;
+    }
+    /*
+    TowerDefensePlayerStats::~TowerDefensePlayerStats()
+    {
+    }
+    */
+}
Index: code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h	(revision 9348)
@@ -0,0 +1,76 @@
+/*
+ *   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:
+ *
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /**
+    @brief
+        This manages the stats of the player. It is used by 'TowerDefense', the gametype
+
+    @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefensePlayerStats_H__
+#define _TowerDefensePlayerStats_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+namespace orxonox
+{
+    typedef enum _TowerCosts {
+        // Set to 0 for debug...
+        TDDefaultTowerCost = 0
+    } TowerCost;
+
+    class _TowerDefenseExport TowerDefensePlayerStats
+    {
+    public:
+        TowerDefensePlayerStats();
+
+        inline int getCredit()
+            { return credit_; }
+
+        inline void setCredit(int credit)
+            { credit_ = credit; }
+
+        inline void buyTower(TowerCost cost)
+            { credit_ -= cost;}
+
+        inline int getWaveNumber()
+            { return waveNumber_; }
+
+        inline void didLoadNextWave()
+            { waveNumber_++; }
+
+    private:
+        int credit_;
+        int waveNumber_;
+        //int baseHealth_;
+    };
+}
+
+#endif /* _TowerDefensePlayerStats_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h	(revision 9348)
+++ code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h	(revision 9348)
@@ -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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the TowerDefense module
+*/
+
+#ifndef _TowerDefensePrereqs_H__
+#define _TowerDefensePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(TOWERDEFENSE_STATIC_BUILD)
+#  ifdef TOWERDEFENSE_SHARED_BUILD
+#    define _TowerDefenseExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _TowerDefenseExport
+#    else
+#      define _TowerDefenseExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _TowerDefenseExport  __attribute__ ((visibility("default")))
+#else
+#  define _TowerDefenseExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class TowerDefense;
+    class Tower;
+    class TowerDefenseCenterpoint;
+    class TowerDefenseHUDController;
+    class TowerDefensePlayerStats;
+}
+
+#endif /* _TowerDefensePrereqs_H__ */
Index: code/trunk/src/modules/towerdefense/towerdefensereadme.txt
===================================================================
--- code/trunk/src/modules/towerdefense/towerdefensereadme.txt	(revision 9348)
+++ code/trunk/src/modules/towerdefense/towerdefensereadme.txt	(revision 9348)
@@ -0,0 +1,38 @@
+===============================================================================
+Classes
+===============================================================================
+
+TowerDefense:
+GameType class
+
+TowerDefenseCenterpoint
+Centerpoint class. Store tower template
+
+Tower
+Represents a Tower
+I'm not actually sure if you have to code C++ in order to have your result. I would suggest to simply create a new spaceship template or maybe better a
+new template for a pawn. (The tower don't need to be spaceships; pawn is just fine.)
+Example for a template: /data/levels/templates/assff.oxt && /data/levels/include/weaponSettingsAssff.oxi
+@ assff.oxt: you don't need an engine (or your towers could fly away :-) and probably no Cameras. (just try what happens if you leave them out.) 
+@ weaponSettingsAssff.oxi:
+<weaponslots>: location where you want to have your tower to be equiped with weapons
+<weaponsets> : if you press fire, you actually always fire a whole set of weapons. The amount of weaponsets is defined here. (I'm not 100% sure whether this explanation is right.)
+
+There are three <Weapon> tags - one for each weaponslot. Each weapon can contain several objects which you would probably
+refer to as "weapons":
+
+LightningGun: Shoots a slow, rotation, yellow "ball".
+HsW01: the default laser weapon
+SimpleRocketFire: a weak (self steering) rocket
+RocketFire: a strong rocket
+                         
+About your Tower's Template location - either keep it in the level or do it similarly to the Assff templates.
+(If your towers behave & look nicely, I'm quite sure others want to include them in other levels, too.)
+
+
+===============================================================================
+Other files
+===============================================================================
+
+/data/levels/towerdefense.oxw
+Loads the level. In <Level>, we first create a SpawnPoint. It spawns a cylinder using the 'centerpointmark' Template, which uses the 'centerpointmarkcamera' Template to create a static camera. Then, we create an instance of TowerDefenseCenterpoint and pass the 'towertemplate' Template, so that we can later create towers using this template. We also plase the playfield.mesh in a way that maps every field on the playfield.mesh to nice coordinates: the playfield spans as a square from -8,-8 to 8,8.
Index: code/trunk/src/modules/weapons/RocketController.cc
===================================================================
--- code/trunk/src/modules/weapons/RocketController.cc	(revision 9347)
+++ code/trunk/src/modules/weapons/RocketController.cc	(revision 9348)
@@ -53,5 +53,5 @@
         this->rocket_ = new SimpleRocket(this);
         this->rocket_->setController(this);
-        this->setControllableEntity(dynamic_cast<ControllableEntity*> (this->rocket_));
+        this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_));
     }
 
Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 9347)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 9348)
@@ -50,5 +50,4 @@
 ADD_SUBDIRECTORY(items)
 ADD_SUBDIRECTORY(overlays)
-ADD_SUBDIRECTORY(pickup)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(weaponsystem)
Index: code/trunk/src/orxonox/CameraManager.cc
===================================================================
--- code/trunk/src/orxonox/CameraManager.cc	(revision 9347)
+++ code/trunk/src/orxonox/CameraManager.cc	(revision 9348)
@@ -48,4 +48,6 @@
     CameraManager::CameraManager()
     {
+        RegisterRootObject(CameraManager);
+
         assert(GameMode::showsGraphics());
     }
Index: code/trunk/src/orxonox/LevelInfo.cc
===================================================================
--- code/trunk/src/orxonox/LevelInfo.cc	(revision 9347)
+++ code/trunk/src/orxonox/LevelInfo.cc	(revision 9348)
@@ -42,5 +42,5 @@
 
     // LevelInfoItem
-    
+
     //! The list of allowed tags.
     /*static*/ std::set<std::string> LevelInfoItem::possibleTags_s = std::set<std::string>();
@@ -93,4 +93,5 @@
             LevelInfoItem::possibleTags_s.insert("gametype");
             LevelInfoItem::possibleTags_s.insert("minigame");
+            LevelInfoItem::possibleTags_s.insert("shipselection");
         }
     }
@@ -106,8 +107,23 @@
         SubString substr = SubString(tags, ",", " "); // Split the string into tags.
         const std::vector<std::string>& strings = substr.getAllStrings();
+        for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
+            this->addTag(*it, false);
+
+        this->tagsUpdated();
+    }
+    /**
+    @brief
+        Set the starting ship models of the level
+    @param tags
+        A comma-seperated string of all the allowed ship models for the shipselection.
+    */
+    void LevelInfoItem::setStartingShips(const std::string& ships)
+    {
+        SubString substr = SubString(ships, ",", " "); // Split the string into tags.
+        const std::vector<std::string>& strings = substr.getAllStrings();
         for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
-            this->addTag(*it, false);
-
-        this->tagsUpdated();
+            this->addStartingShip(*it, false);
+
+        this->startingshipsUpdated();
     }
 
@@ -137,4 +153,24 @@
     /**
     @brief
+        Add a ship model to allowed models for the shipselection
+    @param ship
+        The ship model to be added.
+    @param update
+        Whether the comma-seperated string of all ship models should be updated. Default is true.
+    @return
+        Returns true if the ship was successfully added, if the ship was already present it returns false.
+    */
+    bool LevelInfoItem::addStartingShip(const std::string& ship, bool update)
+    {
+        bool success = this->startingShips_.insert(ship).second;
+        if(update && success)
+            this->startingshipsUpdated();
+
+        return success;
+    }
+
+
+    /**
+    @brief
         Updates the comma-seperated string of all tags, if the set of tags has changed.
     */
@@ -155,4 +191,53 @@
     }
 
+    /**
+    @brief
+        Updates the comma-seperated string of all ships, if the set of tags has changed.
+    */
+    void LevelInfoItem::startingshipsUpdated(void)
+    {
+        std::stringstream stream;
+        std::set<std::string>::iterator temp;
+        for(std::set<std::string>::iterator it = this->startingShips_.begin(); it != this->startingShips_.end(); )
+        {
+            temp = it;
+            if(++it == this->startingShips_.end()) // If this is the last ship we don't add a comma.
+                stream << *temp;
+            else
+                stream << *temp << ", ";
+        }
+
+        this->startingShipsString_ = std::string(stream.str());
+    }
+
+    void LevelInfoItem::changeStartingShip(const std::string& model)
+    {
+        static std::string shipSelectionTag = "shipselection";
+        //HACK: Read Level XML File, find "shipselection", replace with ship model
+        std::string levelPath = "../levels/";
+        levelPath.append(this->getXMLFilename());
+        std::string tempPath = "../levels/";
+        tempPath.append("_temp.oxw");
+        orxout(user_status) << levelPath << endl;
+        orxout(user_status) << tempPath << endl;
+        std::ifstream myLevel (levelPath.c_str());
+        std::ofstream tempLevel (tempPath.c_str());
+        while(!myLevel.eof())
+        {
+            std::string buff;
+            std::getline(myLevel, buff);
+            std::string pawndesignString = "pawndesign=";
+            size_t found = buff.find(pawndesignString.append(shipSelectionTag));
+            if (found!= std::string::npos)
+                buff = buff.substr(0, found + 11) + model + buff.substr(found+11+shipSelectionTag.length(), std::string::npos);
+            tempLevel.write(buff.c_str(), buff.length());
+            tempLevel << std::endl;
+        }
+        myLevel.close();
+        tempLevel.close();
+        orxout(user_status) << "done" << endl;
+    }
+
+
     // LevelInfo
 
@@ -192,4 +277,5 @@
         XMLPortParam(LevelInfo, "screenshot", setScreenshot, getScreenshot, xmlelement, mode);
         XMLPortParam(LevelInfo, "tags", setTags, getTags, xmlelement, mode);
+        XMLPortParam(LevelInfo, "startingships", setStartingShips, getStartingShips, xmlelement, mode);
     }
 
@@ -207,4 +293,5 @@
         info->setScreenshot(this->getScreenshot());
         info->setTags(this->getTags());
+        info->setStartingShips(this->getStartingShips());
         return info;
     }
Index: code/trunk/src/orxonox/LevelInfo.h
===================================================================
--- code/trunk/src/orxonox/LevelInfo.h	(revision 9347)
+++ code/trunk/src/orxonox/LevelInfo.h	(revision 9348)
@@ -43,4 +43,6 @@
 
 #include "core/BaseObject.h"
+#include <iostream>
+#include <fstream>
 #include "core/OrxonoxClass.h"
 
@@ -77,5 +79,5 @@
             */
             inline const std::string& getName(void) const { return this->name_; } // tolua_export
-        
+
             /**
             @brief Set the screenshot of the Level.
@@ -116,4 +118,19 @@
             inline bool hasTag(const std::string& tag) const { return this->tags_.find(tag) != this->tags_.end(); } // tolua_export
 
+            void setStartingShips(const std::string& ships); //!< Set the starting ship models of the level
+            bool addStartingShip(const std::string& ship, bool update = true); //!< Add a model to shipselection
+            /**
+            @brief Get the set of starting ship models the Level allows
+            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
+            */
+            inline const std::string& getStartingShips(void) const
+                { return this->startingShipsString_; }
+            /**
+            @brief Get whether the Level allows a specific starting ship model
+            @param ship The ship model for which is checked.
+            @return Returns true if the Level allows the input ship model
+            */
+            inline bool hasStartingShip(const std::string& ship) const { return this->startingShips_.find(ship) != this->startingShips_.end(); } // tolua_export
+            inline void selectStartingShip(const std::string& ship) { this->changeStartingShip(ship); } // tolua_export
             /**
             @brief Get the XML-filename of the Level.
@@ -122,4 +139,5 @@
             inline const std::string& getXMLFilename(void) const { return this->xmlfilename_; } // tolua_export
 
+
         protected:
             /**
@@ -133,6 +151,7 @@
 
         private:
+            void changeStartingShip (const std::string& model);
+            void startingshipsUpdated(void); //!< Updates the comma-seperated string of all possible starting ships.
             void tagsUpdated(void); //!< Updates the comma-seperated string of all tags, if the set of tags has changed.
-
             static void initializeTags(void); //!< Initialize the set of allowed tags.
             /**
@@ -152,4 +171,6 @@
             std::set<std::string> tags_; //!< The set of tags the Level is tagged with.
             std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with.
+            std::set<std::string> startingShips_; //!< The set of starting ship models the Level allows.
+            std::string startingShipsString_; //!< The comma-seperated string of all the allowed ship models for the shipselection.
     }; // tolua_export
 
@@ -161,6 +182,6 @@
         - @b description The description of the level.
         - @b screenshot The screenshot of the level.
-        - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>.
-
+        - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>, <em>shipselection</em>.
+        - @b (optional) startingships The comma-seperated string of starting ship models
         An example would be:
         @code
@@ -176,5 +197,6 @@
     @author
         Damian 'Mozork' Frick
-
+    @edit
+        Matthias Hutter
     @ingroup Orxonox
     */
@@ -186,5 +208,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML.
-        
+
             /**
             @brief Set the screenshot of the Level.
@@ -223,7 +245,18 @@
             inline const std::string& getTags(void) const
                 { return this->LevelInfoItem::getTags(); }
+            /**
+            @brief Set the starting ship models of the level
+            @param A comma-seperated string of all the allowed ship models for the shipselection.
+            */
+            inline void setStartingShips(const std::string& ships)
+                { this->LevelInfoItem::setStartingShips(ships); }
+            /**
+            @brief Get the starting ship models of the level
+            @return Returns a comma-seperated string of all the allowed ship models for the shipselection.
+            */
+            inline const std::string& getStartingShips(void) const
+                { return this->LevelInfoItem::getStartingShips(); }
 
             LevelInfoItem* copy(void); //!< Copies the contents of this LevelInfo object to a new LevelInfoItem object.
-
     };
 
@@ -243,5 +276,5 @@
             }
     };
-    
+
 } // tolua_export
 
Index: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 9347)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 9348)
@@ -109,4 +109,5 @@
     class TeamDeathmatch;
     class UnderAttack;
+    class TeamGametype;
 
     // graphics
@@ -150,7 +151,4 @@
     class OrxonoxOverlay;
     class OverlayGroup;
-
-    // pickup
-    class PickupIdentifier;
 
     //sound
Index: code/trunk/src/orxonox/Scene.cc
===================================================================
--- code/trunk/src/orxonox/Scene.cc	(revision 9347)
+++ code/trunk/src/orxonox/Scene.cc	(revision 9348)
@@ -258,6 +258,14 @@
     void Scene::setSkybox(const std::string& skybox)
     {
-        if (GameMode::showsGraphics() && this->sceneManager_)
-            this->sceneManager_->setSkyBox(true, skybox);
+        try
+        {
+            if (GameMode::showsGraphics() && this->sceneManager_)
+                this->sceneManager_->setSkyBox(true, skybox);
+        }
+        catch (const Ogre::Exception&)
+        {
+            orxout(internal_error) << "Could not load skybox '" << skybox << "':" << endl;
+            orxout(internal_error) << Exception::handleMessage() << endl;
+        }
 
         this->skybox_ = skybox;
Index: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc	(revision 9347)
+++ code/trunk/src/orxonox/controllers/FormationController.cc	(revision 9348)
@@ -50,25 +50,25 @@
 {
 
-  SetConsoleCommand("FormationController", "formationflight",  &FormationController::formationflight);
-  SetConsoleCommand("FormationController", "masteraction",     &FormationController::masteraction);
-  SetConsoleCommand("FormationController", "followme",         &FormationController::followme);
-  SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
-  SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
-
-
-
-
-  static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
-  static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
-  static const float FORMATION_LENGTH =  110;
-  static const float FORMATION_WIDTH =  110;
-  static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
-  static const float SPEED_MASTER = 0.6f;
-  static const float ROTATEFACTOR_MASTER = 0.2f;
-  static const float SPEED_FREE = 0.8f;
-  static const float ROTATEFACTOR_FREE = 0.8f;
-
-  FormationController::FormationController(BaseObject* creator) : Controller(creator)
-  {
+    SetConsoleCommand("FormationController", "formationflight",  &FormationController::formationflight);
+    SetConsoleCommand("FormationController", "masteraction",     &FormationController::masteraction);
+    SetConsoleCommand("FormationController", "followme",         &FormationController::followme);
+    SetConsoleCommand("FormationController", "passivebehaviour", &FormationController::passivebehaviour);
+    SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
+
+
+
+
+    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
+    static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
+    static const float FORMATION_LENGTH =  110;
+    static const float FORMATION_WIDTH =  110;
+    static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
+    static const float SPEED_MASTER = 0.6f;
+    static const float ROTATEFACTOR_MASTER = 0.2f;
+    static const float SPEED_FREE = 0.8f;
+    static const float ROTATEFACTOR_FREE = 0.8f;
+
+    FormationController::FormationController(BaseObject* creator) : Controller(creator)
+    {
         RegisterObject(FormationController);
 
@@ -91,9 +91,9 @@
         this->team_=-1;
         this->target_.setCallback(createFunctor(&FormationController::targetDied, this));
-  }
-
-  FormationController::~FormationController()
-  {
-    if (this->isInitialized())
+    }
+
+    FormationController::~FormationController()
+    {
+        if (this->isInitialized())
         {
             this->removeFromFormation();
@@ -123,7 +123,7 @@
             }
         }
-  }
-
-  void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    }
+
+    void FormationController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(FormationController, XMLPort, xmlelement, mode);
@@ -137,9 +137,9 @@
 
 
-  /**
+    /**
         @brief Activates / deactivates formationflight behaviour
         @param form activate formflight if form is true
     */
-  void FormationController::formationflight(const bool form)
+    void FormationController::formationflight(const bool form)
     {
         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
@@ -168,5 +168,5 @@
     }
 
-  /**
+    /**
         @brief Get all masters to do a "specific master action"
         @param action which action to perform (integer, so it can be called with a console command (tmp solution))
@@ -198,5 +198,5 @@
     }
 
-  /**
+    /**
         @brief Sets shooting behaviour of pawns.
         @param passive if true, bots won't shoot.
@@ -225,5 +225,5 @@
     }
 
-  /**
+    /**
         @brief Sets maximal formation size
         @param size maximal formation size.
@@ -280,7 +280,8 @@
         }
 
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
         float distance = (target - this->getControllableEntity()->getPosition()).length();
-
+        float rotateX = clamp(coord.x * 10, -1.0f, 1.0f);
+        float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
 
         if(this->state_ == FREE)
@@ -289,9 +290,9 @@
             {
                 // Multiply with ROTATEFACTOR_FREE to make them a bit slower
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
-            }
-
-            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * rotateX);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * rotateY);
+            }
+
+            if (this->target_ && distance <  200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
             {
               this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
@@ -305,6 +306,6 @@
             if (this->target_ || distance > 10)
             {
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * rotateX);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * rotateY);
             }
 
@@ -320,22 +321,22 @@
         {
 
-           this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
-           this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+            this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * rotateX);
+            this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * rotateY);
 
             if (distance < 300)
             {
-		 if (bHasTargetOrientation_)
-		    {
-			copyTargetOrientation();
-		    }
+                if (bHasTargetOrientation_)
+                {
+                    copyTargetOrientation();
+                }
                 if (distance < 100)
-                {   //linear speed reduction
+                { //linear speed reduction
                     this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
-
-                } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
-
-            } else {
+                }
+                else
+                    this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
+            }
+            else
                 this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
-            }
         }
 
@@ -343,17 +344,17 @@
         {
             this->positionReached();
-	    bHasTargetOrientation_=false;
-        }
-    }
-
-
-
-  void FormationController::moveToTargetPosition()
+            bHasTargetOrientation_=false;
+        }
+    }
+
+
+
+    void FormationController::moveToTargetPosition()
     {
         this->moveToPosition(this->targetPosition_);
     }
 
-  //copy the Roll orientation of given Quaternion.
-  void FormationController::copyOrientation(const Quaternion& orient)
+    //copy the Roll orientation of given Quaternion.
+    void FormationController::copyOrientation(const Quaternion& orient)
     {
         //roll angle difference in radian
@@ -373,5 +374,5 @@
 
 
-   /**
+    /**
         @brief Unregisters a slave from its master. Initiated by a slave.
     */
@@ -463,9 +464,9 @@
         }
     }
- /**
+
+    /**
         @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master.
     */
-
-void FormationController::commandSlaves()
+    void FormationController::commandSlaves()
     {
         if(this->state_ != MASTER) return;
@@ -481,9 +482,9 @@
         }
         else
-	// formation:
+        // formation:
         {
             dest += 1.0f*orient*WorldEntity::BACK;
             Vector3 pos = Vector3::ZERO;
-	         bool left=true;
+            bool left=true;
             int i = 1;
 
@@ -683,9 +684,10 @@
 
         if (specificMasterActionHoldCount_ == 0)
-         {
+        {
             this->specificMasterAction_ = NONE;
             this->searchNewTarget();
-         }
-        else specificMasterActionHoldCount_--;
+        }
+        else
+            specificMasterActionHoldCount_--;
     }
 
@@ -711,10 +713,10 @@
     void FormationController::turn180()
     {
-            Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
-
-            this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
-            this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
-
-            this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
+
+        this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
+        this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
+
+        this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
     }
 
@@ -734,6 +736,6 @@
     void FormationController::spin()
     {
-            this->moveToTargetPosition();
-            this->getControllableEntity()->rotateRoll(0.8f);
+        this->moveToTargetPosition();
+        this->getControllableEntity()->rotateRoll(0.8f);
     }
 
@@ -773,24 +775,19 @@
         if((humanPawn != NULL) && (allMasters.size() != 0))
         {
-                float posHuman = humanPawn->getPosition().length();
-                float distance = 0.0f;
-                float minDistance = FLT_MAX;
-                int index = 0;
-                int i = 0;
-
-                for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
-                    {
-                        if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
-                        distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
-                        if(distance < minDistance) index = i;
-                    }
-                allMasters[index]->followInit(humanPawn);
-            }
-
-    }
-
-
-
-
+            float posHuman = humanPawn->getPosition().length();
+            float distance = 0.0f;
+            float minDistance = FLT_MAX;
+            int index = 0;
+            int i = 0;
+
+            for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
+            {
+                if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
+                distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+                if(distance < minDistance) index = i;
+            }
+            allMasters[index]->followInit(humanPawn);
+        }
+    }
 
     /**
@@ -814,5 +811,5 @@
     }
 
-   /**
+    /**
         @brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action".
     */
@@ -842,5 +839,5 @@
 
 
-  /**
+    /**
         @brief Master follows target with adjusted speed. Called within tick.
     */
@@ -854,5 +851,5 @@
 
 
-  void FormationController::setTargetPosition(const Vector3& target)
+    void FormationController::setTargetPosition(const Vector3& target)
     {
         this->targetPosition_ = target;
@@ -918,5 +915,5 @@
     }
 
-  void FormationController::forgetTarget()
+    void FormationController::forgetTarget()
     {
         this->target_ = 0;
@@ -924,5 +921,5 @@
     }
 
-   void FormationController::targetDied()
+    void FormationController::targetDied()
     {
         this->forgetTarget();
@@ -930,5 +927,5 @@
     }
 
-  bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+    bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
     {
         if (entity1 == entity2)
@@ -1054,5 +1051,5 @@
             return;
 
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
         float distance = (target - this->getControllableEntity()->getPosition()).length();
 
@@ -1060,6 +1057,6 @@
             {
                 // Multiply with ROTATEFACTOR_FREE to make them a bit slower
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * clamp(coord.x * 10, -1.0f, 1.0f));
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * clamp(coord.y * 10, -1.0f, 1.0f));
                 this->getControllableEntity()->moveFrontBack(SPEED_FREE);
             }
Index: code/trunk/src/orxonox/controllers/FormationController.h
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.h	(revision 9347)
+++ code/trunk/src/orxonox/controllers/FormationController.h	(revision 9348)
Index: code/trunk/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 9347)
+++ code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 9348)
@@ -298,5 +298,5 @@
         //Used in HumanController for formationFlight
         HumanController::hit(originator,contactpoint,damage);
-        
+
         if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
         {
@@ -397,5 +397,5 @@
                 try
                 {
-                    wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
+                    wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
                 }
                 catch (...)
Index: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 9347)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 9348)
@@ -76,6 +76,7 @@
         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
         {
-            if (dynamic_cast<Synchronisable*>(*it))
-                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << endl;
+            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
+            if (synchronisable)
+                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
             else
                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
Index: code/trunk/src/orxonox/gametypes/Deathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.cc	(revision 9348)
@@ -114,7 +114,7 @@
     }
 
-    void Deathmatch::playerScored(PlayerInfo* player)
+    void Deathmatch::playerScored(PlayerInfo* player, int score)
     {
-        Gametype::playerScored(player);
+        Gametype::playerScored(player, score);
 
         if (player)
Index: code/trunk/src/orxonox/gametypes/Deathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.h	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.h	(revision 9348)
@@ -48,5 +48,5 @@
 
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
     };
 }
Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 9348)
@@ -31,16 +31,17 @@
 //Low; Codeoptimierung und Dokumentation
 
-/*
-short gaming manual:
-There are three different parties a player can belong to: victim, chaser or killer
-Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
-In order to win you have to earn as much points as possible:
-- as victim by escaping the chasers
-- as chaser by shooting the victim
-- as killer by killing the chasers
-
-
-What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
-P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
+/**
+@brief
+    Short Gaming Manual:
+    There are three different parties a player can belong to: victim, chaser or killer
+    Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them.
+    In order to win you have to earn as much points as possible:
+    - as victim by escaping the chasers
+    - as chaser by shooting the victim
+    - as killer by killing the chasers
+
+
+    What you shouldn't do is shooting at players of your own party. By doing so your score will decrease.
+    P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser.
 */
 #include "Dynamicmatch.h"
@@ -81,5 +82,5 @@
         this->numberOf[killer]=0;
         this->tutorial=true;
-        this->pointsPerTime=0.0f;
+        this->pointsPerTime=1.0f;
         this->setHUDTemplate("DynamicmatchHUD");
     }
@@ -95,5 +96,4 @@
             ColourValue(0.3f, 0.3f, 1.0f),  //piggycolour
             ColourValue(0.3f, 1.0f, 0.3f)   //killercolour  what about black: 0.0f, 0.0f, 0.0f
-
         };
         static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
@@ -111,6 +111,6 @@
         if (victim && victim->getPlayer()) //&& originator && originator->getPlayer() ??
         {
-        int target= playerParty_[victim->getPlayer()];
-        int source= playerParty_[originator->getPlayer()];
+            int target = playerParty_[victim->getPlayer()];
+            int source = playerParty_[originator->getPlayer()];
 
             //Case: Not Enough Pigs: party change (= party management)
@@ -151,5 +151,5 @@
 
                 //Give new pig boost
-                SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
+                SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
                 this->grantPigBoost(spaceship);
             }
@@ -245,5 +245,5 @@
                 }
                 //Give new pig boost
-                SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
+                SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
                 this->grantPigBoost(spaceship);
             }
@@ -276,11 +276,7 @@
             else if (friendlyfire && (source == target))
             {
-                std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer());
-                if (it != this->players_.end())
-                    {
-                        it->second.frags_--;
-                    }
-            }
-        }// from far far away not to be removed!
+           	    this->playerScored(originator->getPlayer(), -1);
+            }
+        }
         return false; //default: no damage
     }
@@ -296,11 +292,7 @@
             if (playerParty_[originator->getPlayer()] == killer) //reward the killer
             {
-                std::map<PlayerInfo*, Player>::iterator it = this->players_.find(originator->getPlayer());
-                if (it != this->players_.end())
-                {
-                    it->second.frags_+=20; //value must be tested
-                }
-            }
-        return true;
+           	    this->playerScored(originator->getPlayer(), 25);
+            }
+            return true;
         }
         else return false;
@@ -309,5 +301,5 @@
     /**
     @brief
-        Grant the piggy a boost.
+        Grant the victim a boost.
     @param spaceship
         The SpaceShip to give the boost.
@@ -315,9 +307,11 @@
     void Dynamicmatch::grantPigBoost(SpaceShip* spaceship)
     {
-        // Give pig boost
+        // Give victim boost
         if (spaceship)
         {
+            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
+            if(ptr == NULL)
+                return;
             spaceship->addSpeedFactor(5);
-            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
             ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
             executor->setDefaultValue(0, ptr);
@@ -374,9 +368,10 @@
 
         if (this->hasStarted() && !gameEnded_)
-        {   pointsPerTime =pointsPerTime + dt;
-            gameTime_ = gameTime_ - dt;
-            if (pointsPerTime > 2.0f)//hard coded!! should be changed
-            {
-                pointsPerTime=0.0f;
+        {
+            pointsPerTime = pointsPerTime + dt; //increase points
+            gameTime_ = gameTime_ - dt; // decrease game time
+            if (pointsPerTime > 2.0f) //hard coded points for victim! should be changed
+            {
+                pointsPerTime = 0.0f;
                 rewardPig();
             }
@@ -408,16 +403,14 @@
     }
 
+/**
+    @brief The reward function is called every 2 seconds via the tick function and makes the victim score points.
+*/
     void Dynamicmatch::rewardPig()
     {
         for (std::map< PlayerInfo*, int >::iterator it = this->playerParty_.begin(); it != this->playerParty_.end(); ++it) //durch alle Spieler iterieren und alle piggys finden
         {
-            if (it->second==piggy)
-            {
-                 //Spieler mit der Pig-party frags++
-                 std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(it->first);// still not sure if right syntax
-                 if (it2 != this->players_.end())
-                 {
-                     it2->second.frags_++;
-                 }
+            if (it->second==piggy)//Spieler mit der Pig-party frags++
+            {
+            	 this->playerScored(it->first);
             }
         }
@@ -426,5 +419,5 @@
     {
         std::map<PlayerInfo*, int>::const_iterator it_player = this->playerParty_.find(player);
-        Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+        Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
             if (pawn)
             {
@@ -446,5 +439,5 @@
     {
         //pigs: 1 + every 6th player is a pig
-        if ( (1+this->getNumberOfPlayers()/6) > numberOf[piggy])
+        if ( (1 + getPlayerCount()/6) > numberOf[piggy])
         {
             notEnoughPigs=true;
@@ -495,5 +488,5 @@
         }
         //killers: every 4th player is a killer
-        if (getNumberOfPlayers()/4 > numberOf[killer])
+        if ( static_cast<unsigned int>(getPlayerCount()/4) > numberOf[killer])
         {
             notEnoughKillers=true;
Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 9348)
@@ -81,5 +81,8 @@
             SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
 
+
         protected:
+            inline int getPlayerCount() const
+                 { return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; }
 
             std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
Index: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 9348)
@@ -301,9 +301,9 @@
     }
 
-    void Gametype::playerScored(PlayerInfo* player)
+    void Gametype::playerScored(PlayerInfo* player, int score)
     {
         std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
         if (it != this->players_.end())
-            it->second.frags_++;
+            it->second.frags_ += score;
     }
 
Index: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	(revision 9348)
@@ -90,5 +90,5 @@
             virtual bool playerChangedName(PlayerInfo* player);
 
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
 
             virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
@@ -153,6 +153,11 @@
             virtual void resetTimer(float t);
 
+            /**
+            @brief Get number of Players in game.
+            */
             inline unsigned int getNumberOfPlayers() const
-                { return this->gtinfo_->getNumberOfPlayers(); }
+                { return this->players_.size(); }
+
+
 
         protected:
Index: code/trunk/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/LastManStanding.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/LastManStanding.cc	(revision 9348)
@@ -211,5 +211,5 @@
             if(!player->getControllableEntity())
                 return;
-            Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+            Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
             if(!pawn)
                 return;
Index: code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/LastTeamStanding.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/LastTeamStanding.cc	(revision 9348)
@@ -283,5 +283,5 @@
             if(!player->getControllableEntity())
                 return;
-            Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
+            Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
             if(!pawn)
                 return;
Index: code/trunk/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/Mission.cc	(revision 9348)
@@ -63,5 +63,5 @@
         {
             this->missionAccomplished_ = false;
-	    this->end();
+            this->end();
         }
     }
@@ -78,9 +78,9 @@
     {
         Gametype::end();
-	/*if (this->missionAccomplished_) 
+        /*if (this->missionAccomplished_)
             this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
-	else
+        else
             this->gtinfo_->sendAnnounceMessage("Mission failed!");
-	 * */
+        */
     }
 
Index: code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc	(revision 9348)
@@ -128,5 +128,5 @@
 
     // collect Points for killing oppenents
-    void TeamBaseMatch::playerScored(PlayerInfo* player)
+    void TeamBaseMatch::playerScored(PlayerInfo* player, int score)
     {
         int teamnr = this->getTeam(player);
Index: code/trunk/src/orxonox/gametypes/TeamBaseMatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.h	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.h	(revision 9348)
@@ -47,5 +47,5 @@
             virtual bool allowPawnDamage(Pawn* victim, Pawn* originator);
 
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
             virtual void showPoints();
             virtual void endGame();
Index: code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 9348)
@@ -30,7 +30,6 @@
 
 #include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "interfaces/TeamColourable.h"
-#include "worldentities/TeamSpawnPoint.h"
+#include "chat/ChatManager.h"
+#include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -39,193 +38,89 @@
     CreateUnloadableFactory(TeamDeathmatch);
 
-    TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : Deathmatch(creator)
+    TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : TeamGametype(creator)
     {
         RegisterObject(TeamDeathmatch);
-
-        this->teams_ = 2;
-
-        this->setConfigValues();
     }
 
-    void TeamDeathmatch::setConfigValues()
+    void TeamDeathmatch::start()
     {
-        SetConfigValue(teams_, 2);
+        TeamGametype::start();
 
-        static ColourValue colours[] =
-        {
-            ColourValue(1.0f, 0.3f, 0.3f),
-            ColourValue(0.3f, 0.3f, 1.0f),
-            ColourValue(0.3f, 1.0f, 0.3f),
-            ColourValue(1.0f, 1.0f, 0.0f)
-        };
-        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+        std::string message("The match has started!");
+        ChatManager::message(message);
+    }
 
-        SetConfigValue(teamcolours_, defaultcolours);
+    void TeamDeathmatch::end()
+    {
+        TeamGametype::end();
+
+        std::string message("The match has ended.");
+        ChatManager::message(message);
     }
 
     void TeamDeathmatch::playerEntered(PlayerInfo* player)
     {
-        Deathmatch::playerEntered(player);
+        TeamGametype::playerEntered(player);
 
-        std::vector<unsigned int> playersperteam(this->teams_, 0);
-
-        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
-            if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
-                playersperteam[it->second]++;
-
-        unsigned int minplayers = static_cast<unsigned int>(-1);
-        size_t minplayersteam = 0;
-        for (size_t i = 0; i < this->teams_; ++i)
-        {
-            if (playersperteam[i] < minplayers)
-            {
-                minplayers = playersperteam[i];
-                minplayersteam = i;
-            }
-        }
-
-        this->teamnumbers_[player] = minplayersteam;
+        const std::string& message = player->getName() + " entered the game";
+        ChatManager::message(message);
     }
 
     bool TeamDeathmatch::playerLeft(PlayerInfo* player)
     {
-        bool valid_player = Deathmatch::playerLeft(player);
+        bool valid_player = TeamGametype::playerLeft(player);
 
         if (valid_player)
-            this->teamnumbers_.erase(player);
+        {
+            const std::string& message = player->getName() + " left the game";
+            ChatManager::message(message);
+        }
+
+        return valid_player;
+    }
+    bool TeamDeathmatch::playerChangedName(PlayerInfo* player)
+    {
+        bool valid_player = TeamGametype::playerChangedName(player);
+
+        if (valid_player)
+        {
+            const std::string& message = player->getOldName() + " changed name to " + player->getName();
+            ChatManager::message(message);
+        }
 
         return valid_player;
     }
 
-    bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator)
+    void TeamDeathmatch::pawnKilled(Pawn* victim, Pawn* killer)
     {
-        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
+        if (victim && victim->getPlayer())
+        {
+            std::string message;
+            if (killer)
+            {
+                if (killer->getPlayer())
+                    message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+                else
+                    message = victim->getPlayer()->getName() + " was killed";
+            }
+            else
+                message = victim->getPlayer()->getName() + " died";
+
+            ChatManager::message(message);
+        }
+
+        Gametype::pawnKilled(victim, killer);
     }
 
-    bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator)
+    void TeamDeathmatch::playerScored(PlayerInfo* player, int score)
     {
-        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
-    }
+        TeamGametype::playerScored(player, score);
 
-    bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator)
-    {
-        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
-    }
-
-    SpawnPoint* TeamDeathmatch::getBestSpawnPoint(PlayerInfo* player) const
-    {
-        int desiredTeamNr = -1;
-        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
-        if (it_player != this->teamnumbers_.end())
-            desiredTeamNr = it_player->second;
-
-        // Only use spawnpoints of the own team (or non-team-spawnpoints)
-        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
-        for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        if (player)
         {
-            if ((*it)->isA(Class(TeamSpawnPoint)))
-            {
-                TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
-                if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
-                {
-                    teamSpawnPoints.erase(it++);
-                    continue;
-                }
-            }
-
-            ++it;
-        }
-
-        SpawnPoint* fallbackSpawnPoint = NULL;
-        if (teamSpawnPoints.size() > 0)
-        {
-            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
-            unsigned int index = 0;
-            // Get random fallback spawnpoint in case there is no active SpawnPoint.
-            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
-            {
-                if (index == randomspawn)
-                {
-                    fallbackSpawnPoint = (*it);
-                    break;
-                }
-
-                ++index;
-            }
-
-            // Remove all inactive SpawnPoints from the list.
-            for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
-            {
-                if(!(*it)->isActive())
-                {
-                    teamSpawnPoints.erase(it++);
-                    continue;
-                }
-
-                ++it;
-            }
-
-            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
-            index = 0;
-            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
-            {
-                if (index == randomspawn)
-                    return (*it);
-
-                ++index;
-            }
-
-            return fallbackSpawnPoint;
-        }
-
-        return 0;
-    }
-
-    void TeamDeathmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
-    {
-        if (!player)
-            return;
-
-        // Set the team colour
-        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
-        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
-        {
-            if (pawn)
-            {
-                pawn->setRadarObjectColour(this->teamcolours_[it_player->second]);
-
-                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
-                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
-                {
-                    if ((*it)->isA(Class(TeamColourable)))
-                    {
-                        TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
-                        tc->setTeamColour(this->teamcolours_[it_player->second]);
-                    }
-                }
-            }
+            const std::string& message = player->getName() + " scores!";
+            ChatManager::message(message);
         }
     }
 
-    bool TeamDeathmatch::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
-    {
-        if (pawn1 && pawn2)
-        {
-            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
-            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
-
-            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
-                return (it1->second == it2->second);
-        }
-        return false;
-    }
-
-    int TeamDeathmatch::getTeam(PlayerInfo* player)
-    {
-        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
-        if (it_player != this->teamnumbers_.end())
-            return it_player->second;
-        else
-            return -1;
-    }
 }
Index: code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	(revision 9348)
@@ -31,12 +31,9 @@
 
 #include "OrxonoxPrereqs.h"
-
-#include <map>
-#include <vector>
-#include "Deathmatch.h"
+#include "TeamGametype.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport TeamDeathmatch : public Deathmatch
+    class _OrxonoxExport TeamDeathmatch : public TeamGametype
     {
         public:
@@ -44,26 +41,12 @@
             virtual ~TeamDeathmatch() {}
 
-            void setConfigValues();
-
+            virtual void start();
+            virtual void end();
             virtual void playerEntered(PlayerInfo* player);
             virtual bool playerLeft(PlayerInfo* player);
+            virtual bool playerChangedName(PlayerInfo* player);
 
-            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
-            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
-            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
-
-            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
-
-            int getTeam(PlayerInfo* player);
-            inline const ColourValue& getTeamColour(int teamnr) const
-                { return this->teamcolours_[teamnr]; }
-
-        protected:
-            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
-            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
-
-            std::map<PlayerInfo*, int> teamnumbers_;
-            std::vector<ColourValue> teamcolours_;
-            unsigned int teams_;
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            virtual void playerScored(PlayerInfo* player, int score = 1);
     };
 }
Index: code/trunk/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamGametype.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/TeamGametype.cc	(revision 9348)
@@ -89,4 +89,9 @@
     }
 
+    /**
+    @brief
+        Function that determines the player's team number when entering the game for the first time.
+        Override this function for other team structures.
+    */
     void TeamGametype::findAndSetTeam(PlayerInfo* player)
     {
@@ -130,5 +135,4 @@
             this->allowedInGame_.erase(player);
         }
-
 
         return valid_player;
Index: code/trunk/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/UnderAttack.cc	(revision 9347)
+++ code/trunk/src/orxonox/gametypes/UnderAttack.cc	(revision 9348)
@@ -49,6 +49,4 @@
         this->gameEnded_ = false;
 
-        //this->setHUDTemplate("UnderAttackHUD"); 
-        //This HUD is in conflict with the HUDEnemyHealthBar
         this->setConfigValues();
         this->timesequence_ = static_cast<int>(this->gameTime_);
Index: code/trunk/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 9347)
+++ code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 9348)
@@ -68,5 +68,5 @@
     {
         RegisterObject(GametypeInfo);
-        
+
         this->bStarted_ = false;
         this->bEnded_ = false;
@@ -165,9 +165,9 @@
         if(this->bStarted_)
            { return;}
-        
+
         this->bStarted_ = true;
         this->changedStarted();
-        
-       
+
+
     }
 
@@ -195,5 +195,5 @@
         if(this->startCountdown_ == countdown || countdown < 0.0f)
             return;
-        
+
         this->startCountdown_ = countdown;
         // Set the counter to the ceiling of the current countdown.
@@ -225,5 +225,5 @@
         if(this->counter_ == 0)
             return;
-        
+
         this->counter_--;
         this->changedCountdownCounter();
@@ -325,5 +325,5 @@
         if(this->spawned_ == spawned)
             return;
-        
+
         this->spawned_ = spawned;
         // Clear the notifications if the Player has spawned.
@@ -395,5 +395,5 @@
     // TODO: Replace with notifications.
 
-    void GametypeInfo::sendAnnounceMessage(const std::string& message)
+    void GametypeInfo::sendAnnounceMessage(const std::string& message) const
     {
         if (GameMode::isMaster())
@@ -404,5 +404,5 @@
     }
 
-    void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID)
+    void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID) const
     {
         if (GameMode::isMaster())
@@ -415,5 +415,5 @@
     }
 
-    void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID)
+    void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID) const
     {
         if (GameMode::isMaster())
@@ -426,5 +426,5 @@
     }
 
-    void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID)
+    void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID) const
     {
         if (GameMode::isMaster())
@@ -437,5 +437,5 @@
     }
 
-    void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour)
+    void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const
     {
         if (GameMode::isMaster())
@@ -448,5 +448,5 @@
     }
 
-    void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID)
+    void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) const
     {
         if (GameMode::isMaster())
@@ -459,5 +459,5 @@
     }
 
-    void GametypeInfo::dispatchAnnounceMessage(const std::string& message)
+    void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
     {
         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
@@ -465,5 +465,5 @@
     }
 
-    void GametypeInfo::dispatchKillMessage(const std::string& message)
+    void GametypeInfo::dispatchKillMessage(const std::string& message) const
     {
         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
@@ -471,5 +471,5 @@
     }
 
-    void GametypeInfo::dispatchDeathMessage(const std::string& message)
+    void GametypeInfo::dispatchDeathMessage(const std::string& message) const
     {
         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
@@ -477,5 +477,5 @@
     }
 
-     void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour)
+     void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const
     {
         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
@@ -483,5 +483,5 @@
     }
 
-     void GametypeInfo::dispatchFadingMessage(const std::string& message)
+     void GametypeInfo::dispatchFadingMessage(const std::string& message) const
     {
         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
Index: code/trunk/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.h	(revision 9347)
+++ code/trunk/src/orxonox/infos/GametypeInfo.h	(revision 9348)
@@ -68,5 +68,5 @@
                 { return this->bStarted_; }
             void changedStarted(void); // Is called when the game has changed to started.
-            
+
             /**
             @brief Get whether the game has ended yet.
@@ -108,5 +108,5 @@
                 { return this->readyToSpawn_; }
             void changedReadyToSpawn(bool ready); // Inform the GametypeInfo that the local player has changed its spawned status.
-            
+
             /**
             @brief Get whether the local player is spawned.
@@ -119,21 +119,18 @@
             inline const std::string& getHUDTemplate() const
                 { return this->hudtemplate_; }
-            
-            inline unsigned int getNumberOfPlayers() const
-                {  return this->spawnedPlayers_.size(); }
 
-            void sendAnnounceMessage(const std::string& message);
-            void sendAnnounceMessage(const std::string& message, unsigned int clientID);
-            void sendKillMessage(const std::string& message, unsigned int clientID);
-            void sendDeathMessage(const std::string& message, unsigned int clientID);
-            void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour);
-            void sendFadingMessage(const std::string& message, unsigned int clientID);
+            void sendAnnounceMessage(const std::string& message) const;
+            void sendAnnounceMessage(const std::string& message, unsigned int clientID) const;
+            void sendKillMessage(const std::string& message, unsigned int clientID) const;
+            void sendDeathMessage(const std::string& message, unsigned int clientID) const;
+            void sendStaticMessage(const std::string& message, unsigned int clientID, const ColourValue& colour) const;
+            void sendFadingMessage(const std::string& message, unsigned int clientID) const;
 
-            void dispatchAnnounceMessage(const std::string& message);
-            void dispatchKillMessage(const std::string& message);
-            void dispatchDeathMessage(const std::string& message);
-            void dispatchStaticMessage(const std::string& message,const ColourValue& colour);
-            void dispatchFadingMessage(const std::string& message);
-            
+            void dispatchAnnounceMessage(const std::string& message) const;
+            void dispatchKillMessage(const std::string& message) const;
+            void dispatchDeathMessage(const std::string& message) const;
+            void dispatchStaticMessage(const std::string& message,const ColourValue& colour) const;
+            void dispatchFadingMessage(const std::string& message) const;
+
         protected:
             void start(void); // Inform the GametypeInfo that the game has started.
@@ -165,5 +162,5 @@
             unsigned int counter_; //!< The current integer value of the start countdown, the start countdown counter.
             std::string hudtemplate_;
-            
+
             std::set<PlayerInfo*> spawnedPlayers_; //!< A set of players that are currently spawned.
             bool spawned_; //!< Whether the local Player is currently spawned.
Index: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 9347)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 9348)
@@ -173,5 +173,5 @@
         this->changedControllableEntity();
 
-		RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
+        RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
         if (radarviewable != NULL)
             radarviewable->setRadarName(this->getName());
Index: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc	(revision 9347)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc	(revision 9348)
@@ -39,5 +39,4 @@
 
 #include "infos/PlayerInfo.h"
-#include "pickup/PickupIdentifier.h"
 #include "worldentities/pawns/Pawn.h"
 
@@ -52,5 +51,5 @@
         Constructor. Registers the objects and initializes its member variables.
     */
-    Pickupable::Pickupable() : pickupIdentifier_(NULL), used_(false), pickedUp_(false)
+    Pickupable::Pickupable() : used_(false), pickedUp_(false)
     {
         RegisterRootObject(Pickupable);
@@ -58,5 +57,4 @@
         this->carrier_ = NULL;
 
-        this->pickupIdentifier_ = new PickupIdentifier(this);
         this->beingDestroyed_ = false;
         this->enabled_ = true;
@@ -69,9 +67,4 @@
     Pickupable::~Pickupable()
     {
-        if(this->pickupIdentifier_ != NULL)
-        {
-            orxout(verbose, context::pickups) << "Pickupable (&" << this << ") destroyed." << endl;
-            this->pickupIdentifier_->destroy();
-        }
     }
 
@@ -104,5 +97,5 @@
     void Pickupable::destroyPickup(void)
     {
-        if(!this->beingDestroyed_)
+        if(!this->isBeingDestroyed())
             this->OrxonoxClass::destroy();
         else
@@ -329,21 +322,4 @@
     /**
     @brief
-        Creates a duplicate of the Pickupable.
-    @return
-        Returns the clone of this pickup as a pointer to a Pickupable.
-    */
-    Pickupable* Pickupable::clone(void)
-    {
-        OrxonoxClass* item = NULL;
-        this->clone(item);
-
-        Pickupable* pickup = dynamic_cast<Pickupable*>(item);
-
-        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << endl;
-        return pickup;
-    }
-
-    /**
-    @brief
         Method to transcribe a Pickupable as a Rewardable to the player.
     @param player
Index: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h	(revision 9347)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h	(revision 9348)
@@ -53,6 +53,4 @@
         Pickups (@ref orxonox::Pickupable "Pickupables") are objects that (quite unsurprisingly) can be picked up. Additionally they can be used and unused (transition from used to not used), and also dropped.
 
-        A class of Pickups can incorporate many different types of pickups (see @ref orxonox::PickupIdentifier "PickupIdentifier"), each type is uniquely defined by a @ref orxonox::PickupIdentifier "PickupIdentifier". Each pickup has such an identifier identiying its type. This means that two pickups of the same type have identifiers which are equal.
-
     @author
         Damian 'Mozork' Frick
@@ -69,4 +67,7 @@
         public:
             virtual ~Pickupable(); //!< Default destructor.
+
+            //! @brief Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup.
+            virtual const std::string& getRepresentationName() const = 0;
 
             /**
@@ -136,19 +137,4 @@
             bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this Pickupable.
 
-            Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.
-            /**
-            @brief Creates a duplicate of the input OrxonoxClass.
-                   This method needs to be implemented by any Class inheriting from Pickupable.
-            @param item A reference to a pointer to the OrxonoxClass that is to be duplicated.
-            */
-            virtual void clone(OrxonoxClass*& item) {}
-
-            /**
-            @brief Get the PickupIdentifier of this Pickupable.
-            @return Returns a pointer to the PickupIdentifier of this Pickupable.
-            */
-            virtual const PickupIdentifier* getPickupIdentifier(void) const
-                { return this->pickupIdentifier_; }
-
             bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
             bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up.
@@ -158,9 +144,4 @@
 
         protected:
-            /**
-            @brief Helper method to initialize the PickupIdentifier.
-            */
-            void initializeIdentifier(void) {}
-
             virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
             virtual void destroyPickup(void); //!< Destroys a Pickupable.
@@ -174,12 +155,16 @@
 
             /**
+            @brief Check whether the Pickupable is in the process of being destroyed.
+            @return Returns true if so.
+            */
+            inline bool isBeingDestroyed(void)
+                { return this->beingDestroyed_; }
+
+            /**
             @brief Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-                   This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
-                   DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance);
+                   This method must be implemented by any class directly inheriting from Pickupable.
             @return Returns true if a spawner was created, false if not.
             */
             virtual bool createSpawner(void) = 0;
-
-            PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
 
         private:
@@ -203,7 +188,6 @@
     //! SUPER functions.
     SUPER_FUNCTION(10, Pickupable, changedUsed, false);
-    SUPER_FUNCTION(12, Pickupable, changedCarrier, false);
-    SUPER_FUNCTION(13, Pickupable, changedPickedUp, false);
-    SUPER_FUNCTION(11, Pickupable, clone, false);
+    SUPER_FUNCTION(11, Pickupable, changedCarrier, false);
+    SUPER_FUNCTION(12, Pickupable, changedPickedUp, false);
 }
 
Index: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 9347)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 9348)
@@ -61,14 +61,14 @@
         virtual ~RadarViewable();
 
-		virtual void setRadarName(const std::string& name)
-			{
-				if (this->radarName_ != name)
-				{
-					this->radarName_ = name;
-					this->settingsChanged();
-				}
-			}
-		const std::string& getRadarName() const
-			{ return this->radarName_; }
+        virtual void setRadarName(const std::string& name)
+            {
+                if (this->radarName_ != name)
+                {
+                    this->radarName_ = name;
+                    this->settingsChanged();
+                }
+            }
+        const std::string& getRadarName() const
+            { return this->radarName_; }
 
         inline void setRadarObjectCamouflage(float camouflage)
@@ -163,5 +163,5 @@
         ColourValue radarObjectColour_;
         float scale_;
-		std::string radarName_;
+        std::string radarName_;
     };
 }
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 9347)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 9348)
@@ -87,5 +87,5 @@
         this->setPriority( Priority::VeryHigh );
         this->registerVariables();
-	this->team_ = -1;
+        this->team_ = -1;
     }
 
@@ -266,5 +266,5 @@
                 this->cameraPositionRootNode_->_update(true, false); // update the camera node because otherwise the camera will drag back in position which looks strange
 
-                NewHumanController* controller = dynamic_cast<NewHumanController*>(this->getController());
+                NewHumanController* controller = orxonox_cast<NewHumanController*>(this->getController());
                 if (controller)
                     controller->centerCursor();
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 9347)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 9348)
@@ -164,8 +164,8 @@
             void setTargetInternal( uint32_t targetID );
 
-	    inline void setTeam(int team)
-	        { this->team_ = team; }
-	    inline int getTeam() const
-	        { return this->team_; }
+            inline void setTeam(int team)
+                { this->team_ = team; }
+            inline int getTeam() const
+                { return this->team_; }
 
         protected:
@@ -243,5 +243,5 @@
             WeakPtr<WorldEntity> target_;
 
-	    int team_ ; //<! teamnumber
+            int team_ ; //<! teamnumber
     };
 }
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 9348)
@@ -75,4 +75,7 @@
         this->lastHitOriginator_ = 0;
 
+        // set damage multiplier to default value 1, meaning nominal damage
+        this->damageMultiplier_ = 1;
+
         this->spawnparticleduration_ = 3.0f;
 
@@ -228,4 +231,8 @@
     void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
     {
+        // Applies multiplier given by the DamageBoost Pickup.
+        if (originator)
+            damage *= originator->getDamageMultiplier();
+
         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
         {
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 9348)
@@ -144,7 +144,4 @@
             virtual void addedWeaponPack(WeaponPack* wPack) {}
 
-            inline const WorldEntity* getWorldEntity() const
-                { return const_cast<Pawn*>(this); }
-
             inline void setSpawnParticleSource(const std::string& source)
                 { this->spawnparticlesource_ = source; }
@@ -162,4 +159,11 @@
                 { return this->numexplosionchunks_; }
 
+            // These are used with the Damage Boost Pickup to use the damage multiplier.
+            inline void setDamageMultiplier(float multiplier)
+                { this->damageMultiplier_ = multiplier; }
+            inline float getDamageMultiplier() const
+                { return this->damageMultiplier_; }
+
+
             virtual void startLocalHumanControl();
 
@@ -203,8 +207,10 @@
             float maxShieldHealth_;
             float initialShieldHealth_;
-            float shieldAbsorption_; // Has to be between 0 and 1
+            float shieldAbsorption_; ///< Has to be between 0 and 1
             float reloadRate_;
             float reloadWaitTime_;
             float reloadWaitCountdown_;
+
+            float damageMultiplier_; ///< Used by the Damage Boost Pickup.
 
             WeakPtr<Pawn> lastHitOriginator_;
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 9347)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 9348)
@@ -133,5 +133,5 @@
     {
         SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
-        
+
         SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
             .description("Enable or disable the motion blur effect when moving very fast")
@@ -503,6 +503,6 @@
     void SpaceShip::resetCamera()
     {
-	if(this->hasLocalController() && this->hasHumanController())
-	{
+        if(this->hasLocalController() && this->hasHumanController())
+        {
             Camera *camera = this->getCamera();
             if (camera == 0)
@@ -514,5 +514,5 @@
             camera->setPosition(this->cameraOriginalPosition_);
             camera->setOrientation(this->cameraOriginalOrientation_);
-	}
+        }
     }
 
