Index: code/trunk/cmake/LibraryConfig.cmake
===================================================================
--- code/trunk/cmake/LibraryConfig.cmake	(revision 10257)
+++ code/trunk/cmake/LibraryConfig.cmake	(revision 10258)
@@ -161,5 +161,5 @@
 SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0
                               1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1 1.49.0
-			      1.53.0)
+                              1.53.0)
 IF(NOT TARDIS)
   FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time)
Index: code/trunk/data/defaultConfig/orxonox.ini
===================================================================
--- code/trunk/data/defaultConfig/orxonox.ini	(revision 10258)
+++ code/trunk/data/defaultConfig/orxonox.ini	(revision 10258)
@@ -0,0 +1,5 @@
+[LevelManager]
+campaignMissions_[0] = "missionOne.oxw"
+campaignMissions_[1] = "fightInOurBack.oxw"
+campaignMissions_[2] = "pirateAttack.oxw"
+campaignMissions_[3] = "iJohnVane_TriptoArea51.oxw"
Index: code/trunk/data/gui/layouts/CampaignMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/CampaignMenu.layout	(revision 10258)
+++ code/trunk/data/gui/layouts/CampaignMenu.layout	(revision 10258)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="MenuWidgets/StaticImage" Name="orxonox/CampaignBackground" >
+        <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,0},{1.0,0}}" />
+        <Property Name="BackgroundEnabled" Value="False" />
+        <Window Type="MenuWidgets/Button" Name="orxonox/MissionOneButton" >
+            <Property Name="Text" Value="Mission 1" />
+            <Property Name="Visible" Value="False"/>
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2875,0},{0.6,0},{0.3375,0}}" />
+            <Event Name="Clicked" Function="CampaignMenu.MissionOneButton_clicked"/>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/MissionTwoButton" >
+            <Property Name="Text" Value="Mission 2" />
+            <Property Name="Visible" Value="False"/>
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.3625,0},{0.6,0},{0.4125,0}}" />
+            <Property Name="Disabled" Value="True" />
+            <Event Name="Clicked" Function="CampaignMenu.MissionTwoButton_clicked"/>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/MissionThreeButton" >
+            <Property Name="Text" Value="Mission 3" />
+            <Property Name="Visible" Value="False"/>
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4375,0},{0.6,0},{0.4875,0}}" />
+            <Property Name="Disabled" Value="True" />
+            <Event Name="Clicked" Function="CampaignMenu.MissionThreeButton_clicked"/>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/MissionFourButton" >
+            <Property Name="Text" Value="Mission 4" />
+            <Property Name="Visible" Value="False"/>
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.5125,0},{0.6,0},{0.5625,0}}" />
+            <Property Name="Disabled" Value="True" />
+            <Event Name="Clicked" Function="CampaignMenu.MissionFourButton_clicked"/>
+        </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/CampaignMenuBackButton" >
+            <Property Name="Text" Value="Back" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8,0},{0.6,0},{0.85,0}}" />
+            <Event Name="Clicked" Function="CampaignMenu.CampaignMenuBackButton_clicked"/> 
+        </Window>
+        <Window Type="MenuWidgets/StaticText" Name="orxonox/CampaignMenuCongratulation" >
+            <Property Name="Text" Value="Campaign Completed!!!" />
+            <Property Name="Visible" Value="False"/>
+            <Property Name="InheritsAlpha" Value="False" />
+            <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Property Name="VertFormatting" Value="TopAligned" />
+            <Property Name="UnifiedMaxSize" Value="{{2,1},{2,1}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.15,0},{0.6,0},{0.2,0}}" />
+        </Window>
+    </Window>
+</GUILayout>
Index: code/trunk/data/gui/layouts/SingleplayerMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/SingleplayerMenu.layout	(revision 10257)
+++ code/trunk/data/gui/layouts/SingleplayerMenu.layout	(revision 10258)
@@ -55,4 +55,10 @@
             <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerBackButton_clicked"/>
         </Window>
+        <Window Type="MenuWidgets/Button" Name="orxonox/CampaignButton" >
+            <Property Name="Text" Value="Campaign" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8,0},{0.6,0},{0.85,0}}" />
+            <Event Name="Clicked" Function="SingleplayerMenu.CampaignButton_clicked"/>
+        </Window>
     </Window>
 </GUILayout>
Index: code/trunk/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/CampaignMenu.lua	(revision 10258)
+++ code/trunk/data/gui/scripts/CampaignMenu.lua	(revision 10258)
@@ -0,0 +1,97 @@
+--CampaignMenu.lua
+
+local P = createMenuSheet("CampaignMenu")
+
+function P:onShow()
+    P:updateButtons()
+end
+
+function P.updateButtons()
+    P.updateButton(0, winMgr:getWindow("orxonox/MissionOneButton"))
+    P.updateButton(1, winMgr:getWindow("orxonox/MissionTwoButton"))
+    P.updateButton(2, winMgr:getWindow("orxonox/MissionThreeButton"))
+    P.updateButton(3, winMgr:getWindow("orxonox/MissionFourButton"))
+
+    if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then
+        local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")
+        label:setProperty("Visible","True")
+    end
+end
+
+function P.updateButton(index, button)
+    if (P.shouldDisplayButton(index)) then
+        button:setProperty("Visible", "True")
+
+        if (P.shouldEnableButton(index)) then
+            button:setProperty("Disabled", "False")
+        end
+    end
+end
+
+function P.shouldDisplayButton(index)
+    local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
+    return index < size
+end
+
+function P.shouldEnableButton(index)
+    return index <= P.getIndexOfLastFinishedMission() + 1
+end
+
+function P.getIndexOfLastFinishedMission()
+    local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission()
+    if (lastMission and lastMission ~= "") then
+        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
+        local index = 0
+        while index < size do
+            local mission = orxonox.LevelManager:getInstance():getCampaignMission(index)
+            if (mission == lastMission) then 
+                return index
+            end
+            index = index + 1
+        end
+    end
+    return -1
+end
+
+function P.MissionOneButton_clicked(e)
+    P.loadLevel(P.FindLevel(0))
+end
+
+function P.MissionTwoButton_clicked(e)
+    P.loadLevel(P.FindLevel(1))
+end
+
+function P.MissionThreeButton_clicked(e)
+    P.loadLevel(P.FindLevel(2))
+end
+
+function P.MissionFourButton_clicked(e)
+    P.loadLevel(P.FindLevel(3))
+end
+
+function P.loadLevel(level)
+    orxonox.execute("startGame " .. level:getXMLFilename())
+    hideAllMenuSheets()
+end
+
+function P.FindLevel(index)
+    local filename = orxonox.LevelManager:getInstance():getCampaignMission(index)
+    local level = nil
+    local templevel = nil
+    local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
+    local index = 0
+    while index < size do
+        templevel = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
+        if(templevel:getXMLFilename()==filename) then 
+            level = templevel
+        end
+    index=index+1
+    end
+    return level
+end
+
+function P.CampaignMenuBackButton_clicked(e)
+    hideMenuSheet(P.name)
+end
+
+return P
Index: code/trunk/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 10257)
+++ code/trunk/data/gui/scripts/SingleplayerMenu.lua	(revision 10258)
@@ -2,5 +2,5 @@
 
 local P = createMenuSheet("SingleplayerMenu")
-P.loadAlong = {"ShipSelectionMenu"}
+P.loadAlong = {"ShipSelectionMenu","CampaignMenu"}
 P.levelList = {}
 P.activeTabIndexes = {}
@@ -23,5 +23,5 @@
     P.SingleplayerSelectionChanged()
 
-    --buttons are arranged in a 1x3 matrix
+    --buttons are arranged in a 2x3 matrix
     P:setButton(1, 1, {
             ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
@@ -37,4 +37,9 @@
             ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
             ["callback"]  = P.SingleplayerBackButton_clicked
+    })
+
+    P:setButton(2, 2,{
+            ["button"] = winMgr:getWindow("orxonox/CampaignButton"),
+            ["callback"] = P.CampaignButton_clicked
     })
 end
@@ -166,3 +171,7 @@
 end
 
+function P.CampaignButton_clicked(e)
+    showMenuSheet("CampaignMenu", true)
+end
+
 return P
Index: code/trunk/data/levels/4Dtest.oxw
===================================================================
--- code/trunk/data/levels/4Dtest.oxw	(revision 10258)
+++ code/trunk/data/levels/4Dtest.oxw	(revision 10258)
@@ -0,0 +1,82 @@
+<LevelInfo
+ name = "4Dtest"
+ description = "Test of 4D minigame."
+  screenshot = "asteroidFieldTest.png"
+ tags = "test, showcase"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<!-- Templates here -->
+
+
+<Level
+ gametype=Mini4Dgame
+>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+	<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"/>
+    
+    
+    <SpawnPoint position="-330,330,165" lookat="0,0,0" />
+
+	<Mini4DgameBoard>
+    	<attached>
+      	<?lua
+        	for i = -90, 90, 60
+        	do
+        	?>
+        		<?lua
+        		for j = -90, 90, 60
+        		do
+        		?>
+        			<?lua
+        			for k = -90, 90, 60
+        			do
+        			?>
+        				<Model
+        				position="<?lua print(i) ?>,<?lua print(j) ?>,<?lua print(k) ?>"
+        				mesh="checkPoint.mesh"
+        				scale="5" />
+        			<?lua
+    		  		end
+    				?>
+    			<?lua
+    		  	end
+    			?>
+        	<?lua
+    		end
+    		?>
+    	</attached>
+    	
+  	</Mini4DgameBoard>
+
+<!--
+<attached>
+    <BlinkingBillboard position="0,0,0" frequency=0.6 amplitude=0.4 material="Flares/lensflare" colour="0,1,0" visabilaty=gone>
+	</BlinkingBillboard>
+</attached>
+-->
+
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/AnihilationThreat.oxw
===================================================================
--- code/trunk/data/levels/AnihilationThreat.oxw	(revision 10258)
+++ code/trunk/data/levels/AnihilationThreat.oxw	(revision 10258)
@@ -0,0 +1,750 @@
+<!--########################  Level by Jean-Marc Sujata #############################-->
+
+<LevelInfo
+	name= "Total Annihilation"
+	description= "Save humanity from its total annihilation."
+	tags= "mission"
+	screenshot= "screenshot.png"
+/>
+<!--########################  ALL INCLUSIONS #############################-->
+
+ <?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+
+
+<?lua
+  include("templates/spaceshipSwallow.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipEscort.oxt")
+  include("templates/spaceshipGhost.oxt")
+  include("templates/spaceshipCollateralDamage.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipAssff2.oxt")
+  include("templates/spaceshipTransporter.oxt")
+
+
+?>
+
+<Level 	gametype = "Mission" >
+ 
+<templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+  
+  <NotificationQueueCEGUI
+    name="narrative"
+    targets="simpleNotification"
+    size=8
+    displayTime=4
+    position="0.2, 0, 0.1, 0"
+    fontSize="23"
+    fontColor="0.8, 0.5, 0.2, 0.8"
+    alignment="HorzCentred"
+    displaySize="0.6, 0, 0, 0"
+    />
+
+
+   <?lua
+    dofile("includes/CuboidSpaceStation.lua")
+   ?>
+
+
+
+<Scene
+    ambientlight = "0.5, 0.5, 0.5"
+    skybox       = "Orxonox/Starbox"
+    hasPhysics = true
+ >
+
+<?lua
+      include("includes/pickups.oxi")
+   ?>
+  
+  <Light 
+  	type=directional position="0,0,0" 
+  	direction="0.522, 0.198, -0.354" 
+  	diffuse="1.0, 0.9, 0.9, 1.0" 
+  	specular="1.0, 0.9, 0.9, 1.0"/>
+  	
+  	
+  <SpawnPoint 
+	team=0 position="0,0,0" 
+	lookat="0,1,0" 
+	spawnclass=SpaceShip 
+	pawndesign=spaceshipassff >
+	<DistanceTriggerBeacon name="coolSpaceship" />
+	</SpawnPoint>
+	
+	<Template name=PortalDefault>
+        <PortalEndPoint>
+            <attached>
+                <Model mesh="Spacegate.mesh" yaw="90"/>
+            </attached>
+        </PortalEndPoint>
+    </Template>
+    
+    				
+    
+
+
+
+
+<!--########################  Billboards and Pickups #############################-->
+    
+    
+  
+    
+    
+    <!--Billboard which tirggers the next Quest and spawns the enemy ships-->
+<Billboard position=" 500,500, 500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 1500,1500, 1500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 2500,2500, 2500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 3500,3500, 3500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 4500,4500, 4500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 6500,6500, 6500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 8500,8500, 8500" material="Examples/Flare" colour="1.0, 0.0, 0.0" />  
+<Billboard position=" 9500,9500, 9500" material="Examples/Flare" colour="1.0, 1.0, 0.0" />  
+<Billboard position=" 16700,16700,16700" material="Examples/Flare" colour="0.8, 0.2, 1.0" />  
+
+
+						<!--#########Pickups##########-->
+			
+<PickupSpawner pickup=largedamageboostpickup position="1000,1000,1000" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=crazyhealthpickup position="3500,3500, 3500" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=hugeshieldpickup position="4000,4500, 4500" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+<PickupSpawner pickup=smalljumppickup position="6500,6500, 6000" triggerDistance="20" respawnTime="10" maxSpawnedItems="99" />
+<PickupSpawner pickup=largedamageboostpickup position="9500,9500, 9500" triggerDistance="20" respawnTime="30" maxSpawnedItems="10" />
+<PickupSpawner pickup=largedamageboostpickup position="13000,13000,13000" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+
+    
+    	    <!--******************************-Mission starts here****************************-->
+    			
+    			
+    	    <!--########################  On screen notifications and distance triggers #############################-->
+    			 
+
+    
+<DistanceTrigger name="flying2" position="0,0,0" target="Pawn" distance=40 stayActive="true" delay=7/>
+    <SimpleNotification message="in order to reach our fleet,">
+        <events>
+            <trigger>
+                <EventListener event="flying2" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+    
+    
+<DistanceTrigger name="flying2" position="0,0,0" target="Pawn" distance=100 stayActive="true" delay=7/>
+    <SimpleNotification message="read the quest description">
+        <events>
+            <trigger>
+                <EventListener event="flying2" />
+            </trigger>
+        </events>
+    </SimpleNotification>
+    
+    <DistanceTrigger name="flying1" position="0,0,0" target="Pawn" distance=100 stayActive="true" delay=1/>
+    <SimpleNotification message="Welcome Major Walker">
+        <events>
+            <trigger>
+                <EventListener event="flying1" />
+            </trigger>
+        </events>
+    </SimpleNotification>        
+
+<DistanceTrigger name="flying3" position="500,500,500" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="follow the red dots">
+    <events>
+        <trigger>
+            <EventListener event="flying3" />
+        </trigger>
+    </events>
+</SimpleNotification>        
+
+
+<DistanceTrigger name="flying6" position="1000,1000,1000" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="Major! You can't face the enemy yet">
+    <events>
+        <trigger>
+            <EventListener event="flying6" />
+        </trigger>
+    </events>
+</SimpleNotification>        
+
+<DistanceTrigger name="flying7" position="1060,1060,1060" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="You'll ned to get some upgrades first">
+    <events>
+        <trigger>
+            <EventListener event="flying7" />
+        </trigger>
+    </events>
+</SimpleNotification>      
+
+<DistanceTrigger name="flying8" position="1110,1110,1110" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="You can find them close to the signals">
+    <events>
+        <trigger>
+            <EventListener event="flying8" />
+        </trigger>
+    </events>
+</SimpleNotification>     
+
+<DistanceTrigger name="flying9" position="6500,6500,6000" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="You're almost here!">
+    <events>
+        <trigger>
+            <EventListener event="flying9" />
+        </trigger>
+    </events>
+</SimpleNotification>     
+
+<DistanceTrigger name="flying4" position="9500,9500,9500" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="You're late!">
+    <events>
+        <trigger>
+            <EventListener event="flying4" />
+        </trigger>
+    </events>
+</SimpleNotification>
+
+
+<DistanceTrigger name="flying5" position="9550,9550,9550" target="Pawn" distance=50 stayActive="true" delay=1/>
+<SimpleNotification message="The enemy is eager to be beaten">
+    <events>
+        <trigger>
+            <EventListener event="flying5" />
+        </trigger>
+    </events>
+</SimpleNotification>
+
+<DistanceTrigger name="flying11" position="13000,13000,13000" target="Pawn" distance=200 stayActive="true" delay=1/>
+<SimpleNotification message="There they are. Destroy them!">
+    <events>
+        <trigger>
+            <EventListener event="flying11" />
+        </trigger>
+    </events>
+</SimpleNotification>
+
+<DistanceTrigger name="flying12" position="13050,13050,13050" target="Pawn" distance=200 stayActive="true" delay=1/>
+<SimpleNotification message="Don't fotget to loot the final boss">
+    <events>
+        <trigger>
+            <EventListener event="flying12" />
+        </trigger>
+    </events>
+</SimpleNotification>
+
+<SimpleNotification message="Congratulations! You saved humanity!" broadcast="true">
+    <events>
+        <trigger>
+            <EventListener event="endboss" />
+        </trigger>
+    </events>
+</SimpleNotification>
+
+<DistanceTrigger name="endMissio" position="16700,16700,16700" target="Pawn" distance=50 stayActive="true" delay=1/>
+
+
+
+
+<!--######################## Meteoriten #############################-->
+
+   <?lua
+      for i = 1, 800, 1
+      do
+      j = math.random()
+      x = math.random()
+      y = math.random()
+      z = math.random()
+   ?>
+
+   <MovableEntity    
+      position = "<?lua print(math.random()* 10000) ?>,<?lua print(math.random() * 10000 + 0) ?>,<?lua print(math.random() * 10000) ?>"
+      scale = "<?lua print(j * 40)?>"
+      velocity = "0,0,0"
+      collisionType = dynamic
+      collisiondamage = 0.5
+      enablecollisiondamage = true 
+      active = true
+      visible = true
+   >                 
+          <attached>           
+              <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" >
+                  
+              </Model>                          
+          </attached> 
+         <collisionShapes>
+             <SphereCollisionShape radius="<?lua print(j * 50) ?>" />
+         </collisionShapes>   
+   </MovableEntity>
+
+   <?lua
+      end
+   ?>
+      	<!--****************************In the Asteroid Field***************************-->
+ <!--Enemy team-->
+  
+ <!--########################  spaceships within the asteroid field #############################-->
+
+       
+  <SpaceShip position="1900,1500,1500" lookat="2050,0,-1000" name="allied" health="200" maxhealth="200" initialhealth="200" >
+	  <templates>
+            <Template link=spaceshipassff />
+      </templates>
+       <controller>
+          <WaypointPatrolController alertnessradius=300 team=1 >
+				<waypoints>
+	  	  	  	  <Model mesh="cube.mesh" scale=0 position="1000,1500,1500" />
+                  <Model mesh="cube.mesh" scale=0 position="1900,1500,1500" />
+     	  	  	                    
+              </waypoints>
+						
+          </WaypointPatrolController>
+
+       </controller>
+	  
+  </SpaceShip>
+      
+            
+      <SpaceShip position="2900,2500,2500" lookat="2050,0,-1000" name="allied" health="200" maxhealth="200" initialhealth="200" >
+    	  <templates>
+                <Template link=spaceshippirate />
+          </templates>
+           <controller>
+              <WaypointPatrolController alertnessradius=300 team=1 >
+    				<waypoints>
+    	  	  	  	  <Model mesh="cube.mesh" scale=0 position="2000,2500,2500" />
+                      <Model mesh="cube.mesh" scale=0 position="2900,2500,2500" />
+         	  	  	                        
+                  </waypoints>
+    						
+              </WaypointPatrolController>
+
+           </controller>
+    	  
+      </SpaceShip>
+      
+      <SpaceShip position="2020,2400,2500" lookat="2050,0,-1000" name="allied" health="200" maxhealth="200" initialhealth="200" >
+    	  <templates>
+                <Template link=spaceshippirate />
+          </templates>
+           <controller>
+              <WaypointPatrolController alertnessradius=300 team=1 >
+    				<waypoints>
+    	  	  	  	  
+                      <Model mesh="cube.mesh" scale=0 position="2920,2500,2500" />
+         	  	  	  <Model mesh="cube.mesh" scale=0 position="2020,2500,2500" />
+                    
+                  </waypoints>
+    						
+              </WaypointPatrolController>
+
+           </controller>
+    	  
+      </SpaceShip>
+ 
+      <SpaceShip position="3520,3520, 3500" lookat="2050,0,-1000" name="allied" health="150" maxhealth="150" initialhealth="150" >
+         	  <templates>
+                     <Template link=spaceshippirate />
+               </templates>
+                <controller>
+                   <WaypointPatrolController alertnessradius=300 team=1 >
+         				<waypoints>
+         	  	  	  	  
+                           <Model mesh="cube.mesh" scale=0 position="3920,3500,3500" />
+              	  	  	  <Model mesh="cube.mesh" scale=0 position="3020,3500,3500" />
+                         
+                       </waypoints>
+         						
+                   </WaypointPatrolController>
+
+                </controller>
+         	  
+           </SpaceShip>
+      
+        <!--****************************After the Asteroid Field***************************-->
+        
+   <DistanceTrigger name="afterPortal" position="9500,9500, 9500" target="Pawn"  distance=50 stayActive="true" delay=1/>
+      
+    
+<!--Creating player's team OK-->
+        <!--Spaceships team 0 (player:team=0)-->
+
+        
+<!--####################################### allied team  ################################################-->
+
+
+             
+             
+
+             <SpaceShip position="10150,10150,10150" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+           	  <templates>
+                       <Template link=spaceshipassff />
+                 </templates>
+                  <controller>
+                     <WaypointPatrolController alertnessradius=2000 team=0 >
+                         <events>
+                                    <activity>
+                                        <EventListener event="afterPortal" />
+                                     </activity>
+                                </events>
+       					<waypoints>
+      	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15150,15150,15150" />
+
+                         </waypoints>
+       							
+                     </WaypointPatrolController>
+
+                  </controller>
+             </SpaceShip>
+
+      
+      <SpaceShip position="10300,10000,10300" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                 	  <templates>
+                             <Template link=spaceshipassff />
+                       </templates>
+                        <controller>
+                           <WaypointPatrolController alertnessradius=2000 team=0 >
+                               <events>
+                                          <activity>
+                                              <EventListener event="afterPortal" />
+                                           </activity>
+                                      </events>
+             					<waypoints>
+            	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15300,15300,15300" />
+
+                               </waypoints>
+             							
+                           </WaypointPatrolController>
+
+                        </controller>
+                   </SpaceShip>
+      
+      <SpaceShip position="10450,10000,10300" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                      	  <templates>
+                                  <Template link=spaceshipassff />
+                            </templates>
+                             <controller>
+                                <WaypointPatrolController alertnessradius=2000 team=0 >
+                                    <events>
+                                               <activity>
+                                                   <EventListener event="afterPortal" />
+                                                </activity>
+                                           </events>
+                  					<waypoints>
+                 	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15450,15000,15300" />
+
+                                    </waypoints>
+                  							
+                                </WaypointPatrolController>
+
+                             </controller>
+                        </SpaceShip>
+      
+      <SpaceShip position="10450,10000,10450" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                            	  <templates>
+                                        <Template link=spaceshipassff />
+                                  </templates>
+                                   <controller>
+                                      <WaypointPatrolController alertnessradius=2000 team=0 >
+                                          <events>
+                                                     <activity>
+                                                         <EventListener event="afterPortal" />
+                                                      </activity>
+                                                 </events>
+                        					<waypoints>
+                       	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15450,15000,15450" />
+
+                                          </waypoints>
+                        							
+                                      </WaypointPatrolController>
+
+                                   </controller>
+                              </SpaceShip>
+      
+      
+      <SpaceShip position="10300,10000,9850" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                                	  <templates>
+                                            <Template link=spaceshipassff />
+                                      </templates>
+                                       <controller>
+                                          <WaypointPatrolController alertnessradius=2000 team=0 >
+                                              <events>
+                                                         <activity>
+                                                             <EventListener event="afterPortal" />
+                                                          </activity>
+                                                     </events>
+                            					<waypoints>
+                           	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="17300,17000,17850" />
+
+                                              </waypoints>
+                            							
+                                          </WaypointPatrolController>
+
+                                       </controller>
+                                  </SpaceShip>
+      
+      <SpaceShip position="10150,10000,9700" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                                      	  <templates>
+                                                  <Template link=spaceshipassff />
+                                            </templates>
+                                             <controller>
+                                                <WaypointPatrolController alertnessradius=2000 team=0 >
+                                                    <events>
+                                                               <activity>
+                                                                   <EventListener event="afterPortal" />
+                                                                </activity>
+                                                           </events>
+                                  					<waypoints>
+                                 	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="17150,17000,17700" />
+
+                                                    </waypoints>
+                                  							
+                                                </WaypointPatrolController>
+
+                                             </controller>
+                                        </SpaceShip>
+      
+      <SpaceShip position="10300,10000,9700" lookat="2050,0,-1000" name="allied" health="800" maxhealth="800" initialhealth="800" >
+                                      	  <templates>
+                                                  <Template link=spaceshipassff />
+                                            </templates>
+                                             <controller>
+                                                <WaypointPatrolController alertnessradius=2000 team=0 >
+                                                    <events>
+                                                               <activity>
+                                                                   <EventListener event="afterPortal" />
+                                                                </activity>
+                                                           </events>
+                                  					<waypoints>
+                                 	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="17300,17000,17700" />
+
+                                                    </waypoints>
+                                  							
+                                                </WaypointPatrolController>
+
+                                             </controller>
+                                        </SpaceShip>
+      
+<!--Creating player's team END  -->
+
+<!--#########################################Creating enemy team END #################################  -->
+        
+
+<SpaceShip position="15500,15500,15500" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                	  <templates>
+                                            <Template link=spaceshipghost />
+                                      </templates>
+                                       <controller>
+                                          <WaypointPatrolController alertnessradius=2000 team=1 >
+                                             <waypoints>
+                           	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15500,15500,15500" />
+
+                                              </waypoints>
+                            							
+                                          </WaypointPatrolController>
+
+                                       </controller>
+                                  </SpaceShip>
+      
+      
+      <SpaceShip position="15750,15500,15750" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                          	  <templates>
+                                                      <Template link=spaceshipghost />
+                                                </templates>
+                                                 <controller>
+          	  	  	  	  	  	  	  	  	  	  	  <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                       <waypoints>
+                                     	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15750,15500,15750" />
+
+                                                        </waypoints>
+                                      							
+                                                    </WaypointPatrolController>
+
+                                                 </controller>
+                                            </SpaceShip>
+      <SpaceShip position="16000,15500,16000" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                               	  <templates>
+                                                   <Template link=spaceshipghost />
+                                                     </templates>
+                                                      <controller>
+               	  	  	  	  	  	  	  	  	  	  	  <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                            <waypoints>
+                                          	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="16000,15500,16000" />
+
+                                                             </waypoints>
+                                           							
+                                                         </WaypointPatrolController>
+                                                           
+
+                                                      </controller>
+                                                 </SpaceShip>
+               
+               
+               
+               <SpaceShip position="15250,15500,15250" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                               	  <templates>
+                                                    <Template link=spaceshipghost />
+                                                     </templates>
+                                                      <controller>
+                                                         <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                            <waypoints>
+                                          	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15250,15500,15250" />
+
+                                                             </waypoints>
+                                           							
+                                                         </WaypointPatrolController>
+
+                                                      </controller>
+                                                 </SpaceShip>
+               
+               
+               
+               <SpaceShip position="15000,15500,15000" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                               	  <templates>
+                                                   <Template link=spaceshipghost />
+                                                     </templates>
+                                                      <controller>
+                                                         <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                            <waypoints>
+                                          	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15000,15500,15000" />
+
+                                                             </waypoints>
+                                           							
+                                                         </WaypointPatrolController>
+
+                                                      </controller>
+                                                 </SpaceShip>
+               
+               
+               
+               <SpaceShip position="15500,15500,15750" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                               	  <templates>
+                                                   <Template link=spaceshipghost />
+                                                     </templates>
+                                                      <controller>
+               	  	  	  	  	  	  	  	  	  	  	 <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                            <waypoints>
+                                          	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="15500,15500,15750" />
+
+                                                             </waypoints>
+                                           							
+                                                         </WaypointPatrolController>
+
+                                                      </controller>
+                                                 </SpaceShip>
+
+      <SpaceShip position="16000,15500,16250" lookat="2050,0,-1000" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+                                                  	  <templates>
+                                                      <Template link=spaceshipghost />
+                                                        </templates>
+                                                         <controller>
+                  	  	  	  	  	  	  	  	  	  	  	 <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                               <waypoints>
+                                             	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="16000,15500,16250" />
+
+                                                                </waypoints>
+                                              							
+                                                            </WaypointPatrolController>
+
+                                                         </controller>
+                                                    </SpaceShip>
+      
+      <SpaceShip position="16500,16500,16500" lookat="2050,0,-1000" name="endboss" health="800" maxhealth="800" initialhealth="800" >
+                                                              	  <templates>
+                                                                  <Template link=spaceshipTransporter />
+                                                                    </templates>
+                                                                     <controller>
+      	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  <WaypointPatrolController alertnessradius=2000 team=1 >
+                                                                           <waypoints>
+                                                         	  	  	  	  	  <Model mesh="cube.mesh" scale=0 position="16500,16500,16500" />
+
+                                                                            </waypoints>
+                                                          							
+                                                                        </WaypointPatrolController>
+
+                                                                     </controller>
+                                                                </SpaceShip>
+      
+      <!-- ##################### End the Mission (success) ##########################################-->
+     
+
+      
+      
+      <Script code="Mission endMission true" onLoad="false">
+          <events>
+              <trigger>
+                  <EventListener event="endMissio" />
+              </trigger>
+          </events>
+      </Script> 
+         
+      <!--########################  Quests #############################-->
+
+
+ <QuestEffectBeacon times=1>
+            <effects>
+                <AddQuest questId="quest0" />
+                   <AddQuestHint hintId ="quest1hint2" />
+                <AddQuestHint hintId ="quest1hint3" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=spawntrigger />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+    
+    
+
+<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
+
+<GlobalQuest id="quest0">
+		<QuestDescription title="Mission" description="Humanity is at war! Recently, an ashrocian ship attacked two transporters carrying highly expensive ETHium. Despite the fact, that the Ashrocs are a technological superpower, we, the human race cannot allow them to treat us like insects. Your mission's to group up with yout fellow soldiers and retaliate even harder. Follow the red marks which were left by the star fleet. But beware, there might be spies on your way. See to it, that you terminate their mission ;)" />
+	<hints>
+                <QuestHint id="quest1hint0">
+                    <QuestDescription title="The super Hint." description="Be proud of yourself." />
+                </QuestHint>
+    </hints>             
+</GlobalQuest>
+		
+		
+		
+	<DistanceTrigger name=QuestTrigger0 position="0,0,0" distance=10 target="Pawn" />
+
+
+
+ <QuestEffectBeacon times=1>
+            <effects>
+                <AddQuest questId="quest0" />
+                   <AddQuestHint hintId ="quest1hint2" />
+                <AddQuestHint hintId ="quest1hint3" />
+            </effects>
+            <events>
+                <execute>
+                    <EventListener event=QuestTrigger0 />
+                </execute>
+            </events>
+        </QuestEffectBeacon>
+    
+
+
+
+
+
+    
+    
+	
+    
+   
+    
+  </Scene>
+</Level>
Index: code/trunk/data/levels/DodgeRace.oxw
===================================================================
--- code/trunk/data/levels/DodgeRace.oxw	(revision 10258)
+++ code/trunk/data/levels/DodgeRace.oxw	(revision 10258)
@@ -0,0 +1,67 @@
+<LevelInfo
+ name = "Dodge Race"
+ description = "Try to come as far as possible"
+ tags = "minigame"
+ screenshot = "DodgeRace.png"
+/>
+<?lua
+  include("stats.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff2.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipDodgeRace.oxt")
+  include("templates/enemyInvader.oxt")
+  include("templates/DodgeRacePattern.oxt")
+  include("overlays/DodgeRaceHUD.oxo")
+?>
+
+<Level gametype = DodgeRace>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "1.0, 1.0, 1.0"
+    skybox       = "Orxonox/skyBoxClouds"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+  >
+
+  <WorldAmbientSound
+    source="Earth.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"/> -->
+    <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=DodgeRaceShip pawndesign=spaceshipdodgerace />
+
+    <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+
+
+    <DodgeRaceCenterPoint name=invadercenter />
+  
+  <StaticEntity position="0,-50,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
+      <attached>
+        <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" />
+      </attached>
+
+      <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
+      </collisionShapes>
+
+  </StaticEntity>
+    
+    
+    
+    
+    
+    
+  </Scene>
+</Level>
+
Index: code/trunk/data/levels/FPS_Level_HS14.oxw
===================================================================
--- code/trunk/data/levels/FPS_Level_HS14.oxw	(revision 10258)
+++ code/trunk/data/levels/FPS_Level_HS14.oxw	(revision 10258)
@@ -0,0 +1,348 @@
+<!--FPS mode level
+	autor: Florian Süess-->
+<LevelInfo
+ name = "FPS Level HS14"
+ description = "Entering a Space Station & finde a way through it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipEscort.oxt")
+  include("templates/bigship.oxt")
+  include("templates/spaceshipTurret.oxt")
+  include("templates/spaceshipCollateralDamage.oxt")
+  include("templates/FPS_HS14.oxt")
+  include("templates/HeavyCruiser.oxt")
+  include("templates/spacestation_elements.oxt")
+?>
+
+<Level
+  gametype = Deathmatch
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+
+  <Scene
+    ambientlight = "0.5, 0.5, 0.5"
+    skybox       = "Orxonox/skyBoxMoreNebula"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+    gravity      = "0,0,0"
+    hasPhysics   = true
+  >
+
+    <?lua
+      include("includes/pickups.oxi")
+    ?>
+	
+	<!-- my ships -->
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0,1.0,1.0,0.5" specular="1.0, 0.9, 0.9, 1.0"/>
+    
+    <SpawnPoint team=1 position="6000,2000,500" lookat="4000,-1000,-1000" spawnclass=SpaceShip pawndesign=spaceshipescort />
+	<!--Position normal Level: "6000,2000,500"; postion for work at the spacesation: "3000,0,0 "-->
+	
+	<!--1,200,0-->
+	<SpaceShip			
+        template            = "spaceshipassff"
+        team                = "1"
+        position            = "3337,-19,-320"
+        orientation         = "5800,-200,-1200,0"
+        health              = "200"
+        initialhealth       = "200"
+        maxhealth           = "200"
+        shieldhealth        = "50"
+        initialshieldhealth = "50"
+        maxshieldhealth     = "50"
+        shieldabsorption    = "0.8"
+        reloadrate          = "100"
+        reloadwaittime      = "0.1"
+        name                = "Tanis1"
+        radarname           = "Light Destroyer" >
+		<attached>
+        	<DockingTarget name="spaceShip" />
+        	<DistanceTriggerBeacon name="bcnSpaceShip" />
+		</attached>
+    </SpaceShip>
+	
+	
+        
+    <StaticEntity position  = "2800,0,0" mass=10000 collisionType=static >
+      <attached>
+        <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape  position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+        <BoxCollisionShape  position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+        <BoxCollisionShape  position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+        <BoxCollisionShape  position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+        <BoxCollisionShape  position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+        <BoxCollisionShape  position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+        <BoxCollisionShape  position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+        <BoxCollisionShape  position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+        <BoxCollisionShape  position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+        <BoxCollisionShape  position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+        <BoxCollisionShape  position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+        <BoxCollisionShape  position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+        <BoxCollisionShape  position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+      </collisionShapes>
+    </StaticEntity>
+
+
+	<!-- Docking I -->
+	    <Dock position="2830,20,50" roll=0 yaw=0 >
+	        <animations>
+	            <MoveToDockingTarget target="fistperson" />
+	        </animations>
+	        <effects>
+	            <DockToShip target="fistperson" />
+	        </effects>
+	        <events>
+	            <execute>
+	                <EventListener event="dockMe" />
+	            </execute>
+
+		    <undocking>
+			<EventListener event="undockMe" />
+		    </undocking>
+		
+	        </events>
+	        <attached>
+		<!-- Trigger for docking with billboard -->
+	            <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
+	            <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
+	                beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
+	            />
+		<!-- Trigger for undocking with billboard -2800,-20055,-700-->
+		    <Billboard position="-1500,-20021,-50" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
+		    <DistanceTrigger position="-1500,-20021,-50" distance="150" target="Pawn"
+	                beaconMode="identify" targetname="bcnDestroyer" name="undockMe"
+	            />
+	        </attached>
+
+	    </Dock>
+	    
+	<!-- FPS Player as destination of the dock -->
+	<!-- My position after docking -->
+	    <FpsPlayer template = "fps_HS14" radarname = "First Person Player" position = "1330,-20016,0" >
+	      <attached>
+	        <DistanceTriggerBeacon name="bcnDestroyer" />
+	        <DockingTarget name="fistperson" />
+	      </attached>
+	    </FpsPlayer>
+
+
+
+
+	<!-- Docking  II -->
+	    <Dock position="86,-20005,-700" roll=0 yaw=0 >
+	        <animations>
+	            <MoveToDockingTarget target="spaceShip" />
+	        </animations>
+	        <effects>
+	            <DockToShip target="spaceShip" />
+	        </effects>
+	        <events>
+	            <execute>
+	                <EventListener event="dockMe" />
+	            </execute>
+
+		    <undocking>
+				<EventListener event="undockMe" />
+		    </undocking>
+		
+	        </events>
+	        <attached>
+		<!-- Trigger for docking with billboard -->
+	            <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.3,0.4,0.5" scale=1 />
+	            <DistanceTrigger position="0,0,0" distance="100" target="Pawn"
+	                beaconMode="exclude" targetname="bcnSpaceShip" name="dockMe"
+	            />
+		<!-- Trigger for undocking with billboard -->
+		    <Billboard position="3251,20006,380" material="Flares/ringflare2" colour="0.3,0.4,0.5" scale=1 />
+		    <DistanceTrigger position="3251,20006,380" distance="100" target="Pawn"
+	                beaconMode="identify" targetname="bcnSpaceShip" name="undockMe"
+	            />
+	        </attached>	
+	 </Dock>
+	
+
+
+ <!-- Enemy ships -->
+ 
+ 	<SpaceShip			
+        template            = "HeavyCruiser"
+        team                = "0"
+        position            = "5800,-200,-1200"
+        orientation         = "1,200,0,0"
+        health              = "2000"
+        initialhealth       = "2000"
+        maxhealth           = "2000"
+        shieldhealth        = "200"
+        initialshieldhealth = "200"
+        maxshieldhealth     = "200"
+        shieldabsorption    = "0.8"
+        reloadrate          = "1"
+        reloadwaittime      = "1"
+        name                = "Tanis0"
+        radarname           = "Tanis big ship" >
+   </SpaceShip>
+		-->
+    
+	<SpaceShip			
+        template            = "spaceshippirate"
+        team                = "0"
+        position            = "11000,0,-2500"
+        orientation         = "1,200,0,0"
+        health              = "200"
+        initialhealth       = "200"
+        maxhealth           = "200"
+        shieldhealth        = "50"
+        initialshieldhealth = "50"
+        maxshieldhealth     = "50"
+        shieldabsorption    = "0.8"
+        reloadrate          = "1"
+        reloadwaittime      = "1"
+        name                = "Tanis0"
+        radarname           = "Pirate1" >
+        
+        <controller>
+            <AIController team=0/>           
+        </controller>
+        
+   </SpaceShip>
+   
+   <SpaceShip			
+        template            = "spaceshippirate"
+        team                = "0"
+        position            = "11000,0,-2500"
+        orientation         = "1,200,0,0"
+        health              = "200"
+        initialhealth       = "200"
+        maxhealth           = "200"
+        shieldhealth        = "50"
+        initialshieldhealth = "50"
+        maxshieldhealth     = "50"
+        shieldabsorption    = "0.8"
+        reloadrate          = "1"
+        reloadwaittime      = "1"
+        name                = "Tanis0"
+        radarname           = "Pirate2" >
+        
+        <controller>
+            <AIController team=0/>           
+        </controller>
+        
+   </SpaceShip>
+	
+
+<!-- SpaceStation
+
+The station can either be hidden outside of the skybox, within the hull of the space station if it is big enough or within a planet.
+Complex spacestations can be placed very far away from the spaceship so it is rendered at low resolution while the player uses the space ship.
+
+-->
+
+<!-- Hilfsobjekte fuer Koordinatensystem -->
+
+<!-- The axis from the coordinatesystem are "red,green,yellow" and the orange boxe shows the negative direction.
+	 But atention, each element is different! A few of them are already rotatet with yaw, roll and pitch:
+	 -> "pitch" is a rotation around "red" in the "yellow, green" plain.
+	 -> "yaw" is a rotation around "green" in the "red, yellow" plain.
+	 -> "roll" is a rotation around "yellow" in the "green,red" plain.
+	 this chanches their negativ/positiv direction of the axis.
+	 -->
+			
+
+<!--<Model position="0,0,0" mesh="cube_red.mesh" scale3D="10000,10,10" />
+<Model position="0,0,0" mesh="cube_green.mesh" scale3D="10,10000,10" />
+<Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10000" />
+
+<Model position="0,-100,0" mesh="cube_orange.mesh" scale3D="15,15,15" />
+<Model position="-100,0,0" mesh="cube_orange.mesh" scale3D="15,15,15" />
+<Model position="0,0,-100" mesh="cube_orange.mesh" scale3D="15,15,15" />
+
+<Model position="0,-20000,0" mesh="cube_red.mesh" scale3D="100,10,10" />
+<Model position="0,-20000,0" mesh="cube_green.mesh" scale3D="10,100,10" />
+<Model position="0,-20000,0" mesh="cube.mesh" scale3D="10,10,100" />
+
+<Model position="0,-20100,0" mesh="cube_orange.mesh" scale3D="15,15,15" />
+<Model position="-100,-20000,0" mesh="cube_orange.mesh" scale3D="15,15,15" />
+<Model position="0,-20000,-100" mesh="cube_orange.mesh" scale3D="15,15,15" /> -->
+
+
+<!-- Spacestation elements merged -->
+<StaticEntity position="0,-20000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 pitch=-90> 
+     
+ <attached>
+
+	<Model template	= "ss_flag_room" position="750,-16,0"	yaw=180 />
+	
+	<Model template	= "ss_machine"	 position="1545,190,370"	yaw=32 	pitch=180 />
+	<Model template	= "ss_flag_aean" position="1330,16,0"		pitch=180 />
+	<Model template	= "ss_chair" 	 position="1700,145,0" />
+	
+	<Model template	= "ss_tube"	 	 position="500,0,0" />
+	<Model template	= "ss_table" 	 position="650,100,0" />
+	<Model template	= "ss_cylinder"	 position="0,75,0" />
+	
+	<Model template	= "ss_curve" 	 position="-200,0,0" 	yaw=180 />
+	<Model template	= "ss_tube_x" 	 position="-10,0,700" />
+	 
+	<Model template	= "ss_curve" 	 position="-905,0,700" 	yaw=180 />
+	<Model template	= "ss_curve" 	 position="-810,0,1500" yaw=270/>
+	<Model template	= "ss_curve" 	 position="-10,0,1405" 	yaw=0 />
+	 
+	<Model template	= "ss_wall"  		  	yaw=0	position="250,20,700" />
+	<Model template	= "ss_table_cracked" 	yaw=0	position="-110,100,700" />
+
+		
+ </attached>
+  </StaticEntity>
+	
+   
+<!-- Homogenous gravitationfield to simulate local gravity (activating the normal gravity will affect the spaceship terribly) -->
+<ForceField position="0,-20200,0" mode="homogen" diameter="5000" forcedirection = "0,-500,0" />
+
+
+
+
+
+<!-- Some more stuff -->
+
+    <!-- triple large belt around the planet  -->
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(0, -19900, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+    ?>
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(0, -19900, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+    ?>
+    <?lua
+        dofile("includes/asteroidField.lua")
+        asteroidBelt(0, -19900, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+    ?>
+
+    <Model position="0,-19900,0" mesh="planets/ganymede.mesh" scale="5000" />
+    
+    
+
+  </Scene>
+
+</Level>
+
Index: code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi	(revision 10258)
+++ code/trunk/data/levels/includes/weaponSettingsFPS_HS14.oxi	(revision 10258)
@@ -0,0 +1,51 @@
+    <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="15,-1.5,-25" yaw=0 pitch=0 roll=0 />
+      <WeaponSlot position="0,0,-45" yaw=0 pitch=0 roll=0 />
+-->
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+      <WeaponSet firemode=1 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack firemode=0>
+        <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>
+        <LaserGun
+            position="0,0,0"
+            munitionType="LaserGunMunition"
+            bulletLoadingTime="0.2"
+            magazineLoadingTime="5.0"
+            speed="1000"
+            unlimitedMunition=true
+        />
+        <!--LaserGun
+            position="0,0,0"
+            munitionType="LaserGunMunition"
+            bulletLoadingTime="0.2"
+            magazineLoadingTime="5.0"
+            speed="1250"
+            unlimitedMunition=true
+        />
+      </WeaponPack>
+      <WeaponPack firemode=1>
+        <Fusion
+            position="0,0,0"
+            munitionType="FusionMunition"
+            bulletLoadingTime="0.3"
+            magazineLoadingTime="3"
+            speed="600"
+            unlimitedMunition=true
+        /-->
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/includes/weaponSettingsTurret1.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTurret1.oxi	(revision 10258)
+++ code/trunk/data/levels/includes/weaponSettingsTurret1.oxi	(revision 10258)
@@ -0,0 +1,22 @@
+    <weaponslots>
+      <WeaponSlot position="0,0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+        </links>
+        <Weapon>
+          <!-- <attached>
+            <Model mesh="sphere.mesh" position="1.7,1.7,-24.5" scale=0.6 />
+          </attached> -->
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=20 material="Flares/point_lensflare" muzzleoffset="1.7, 1.7,-30" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=20 material="Flares/point_lensflare" muzzleoffset="1.7, -1.7,-30" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=20 material="Flares/point_lensflare" muzzleoffset="-1.7, 1.7,-30" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=20 material="Flares/point_lensflare" muzzleoffset="-1.7, -1.7,-30" />
+        </Weapon>
+      </WeaponPack>
+    </weapons>
Index: code/trunk/data/levels/kecks.oxw
===================================================================
--- code/trunk/data/levels/kecks.oxw	(revision 10258)
+++ code/trunk/data/levels/kecks.oxw	(revision 10258)
@@ -0,0 +1,451 @@
+<LevelInfo
+ name = "kecks"
+ description = "Save your planet."
+ tags = "test"
+ screenshot = "kecks.png"
+ gametype=Mission
+/>
+
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+
+?>
+
+<?lua
+    dofile("includes/asteroidField.lua")
+?>
+
+<?lua
+  include("templates/spaceshipAssff2.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipHXY.oxt")
+?>
+
+<Level gametype = "Mission">
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+
+<?lua include("includes/notifications.oxi") ?>
+
+<NotificationQueueCEGUI
+    name="narrative"
+    targets="simpleNotification"
+    size=3
+    displayTime=3.9
+    position="0.2, 0, 0.1, 0"
+    fontSize="23"
+    fontColor="0.3, 1, 0.2, 0.8"
+    alignment="HorzCentred"
+    displaySize="0.6, 0, 0, 0"
+    />
+
+<Scene
+	ambientlight = "0.8, 0.8, 0.8"
+	skybox       = "Orxonox/skyBoxBasic"
+>
+<!-- TODO: Trigger fuer Boxen, SimpleNotification, Gegner sollen nicht explodieren, Spawnpoint 2 -->
+
+    <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 roll="180" position="0,0, 0" lookat="0, 1000, 0" spawnclass=SpaceShip pawndesign=spaceshipHXY team=0 active="true" />
+
+<!-- 2. Spawnpoint
+	<SpawnPoint roll="180" position="0, 114500, 0" lookat="0, 150000, 0" spawnclass=SpaceShip pawndesign=spaceshipHXY team=0 active="false" />	
+		<events>
+               <activity>
+                   <EventListener event="atPortal1" />
+               </activity>
+           </events>
+       </SpawnPoint>
+-->
+<DistanceTrigger name="startmission" position="0,100,0" target="SpaceShip" targetname="spaceshipHXY"  distance=90 activations=1 stayActive=true />
+
+	<SimpleNotification message="Follow the spaceships to escape" boadcast="true">
+		<events>
+			  <trigger>
+				  <EventListener event="startmission" />
+			  </trigger>
+		  </events>
+	</SimpleNotification>
+
+<SimpleNotification message="Destroy the box to free the spaceships." boadcast="true">
+	<events>
+		  <trigger>
+			  <EventListener event="atPortal1" />
+		  </trigger>
+	  </events>
+</SimpleNotification>
+
+	<SimpleNotification message="Defend your planet." broadcast="true">
+		<events>
+			  <trigger>
+				  <EventListener event="boxDestroyed" />
+			  </trigger>
+		  </events>
+	</SimpleNotification>
+
+
+	<!-- Distance Trigger-->
+	
+	<DistanceTrigger name="atPortal1" position="0,112000,0" target="SpaceShip" targetname="spaceshipHXY" distance=100 activations=1 stayActive=true />
+	<EventTrigger name="boxtrigger" activations="1" stayactive="true" delay=0.1>
+            <events>
+              <trigger>
+                <EventListener event="boxDestroyed" />
+              </trigger>
+            </events>
+          </EventTrigger>
+
+    <!--Asteroiden-Guertel Versuch Schlaufe
+    <?lua
+    	for i = 1, 3, 1
+    		do
+    ?>
+
+     asteroidBelt(0, 0, 0, 0, 0, 100, 50+10*i, 100+10*i, 3000*i+500, 3000*i, 100+100*i	, 0)
+
+	<?lua
+	end
+	?>
+    -->
+ 
+    
+    <!-- Asteroidenguertel-->
+    <?lua
+	asteroidBelt(0, 0, 0, 0, 0, 50, 60, 110, 3300, 3000, 100	, 1)
+	asteroidBelt(0, 0, 0, 0, 0, 50, 70, 120, 6400, 6000, 125	, 1)
+	asteroidBelt(0, 0, 0, 0, 0, 50, 80, 130, 9500, 9000, 150	, 1)
+	?>
+    <!--ENDE Asteroidenguertel-->
+
+	<!-- Beschuetzer und Wegweiser Innen-->		 
+				
+	<?lua
+			for i = 0, (3*math.pi/2), (math.pi/2)
+				  do       
+	?>
+				
+				
+	
+	<SpaceShip position="<?lua print(250*math.sin(i)) ?>, <?lua print(250*math.cos(i)) ?>,0" lookat="<?lua print(1500*math.sin(i)) ?>,  <?lua print(1500*math.cos(i)) ?>,0" maxhealt="150" initialhealth="150" roll="<?lua print(180-i*180/math.pi)?>"  >
+		<templates>
+		  <Template link=spaceshipassff2 /> <!--spaceshipTransporter -->
+		</templates>
+		  <controller>
+			 <WaypointPatrolController alertnessradius=1500 active=true team=0>
+			   <waypoints>
+				 <StaticEntity position="0,10350,0"/>
+			   </waypoints>
+			 </WaypointPatrolController>
+		  </controller>
+	</SpaceShip>
+		  
+				  
+	<?lua
+	end
+	?>
+				  
+	<!-- ENDE Beschuetzer und Wegweiser Innen-->	
+	
+	<!-- Gegner Innen-->		
+	
+	 <?lua
+			for i = 0, (3*math.pi/2), (math.pi/2)
+				  do
+	?>
+				  
+				  
+	<SpaceShip position="<?lua print(1500*math.sin(i)) ?>,<?lua print(1500*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0">
+	
+	  <templates>
+		  <Template link=spaceshippirate />
+	  </templates>
+		  <controller>
+		<WaypointPatrolController alertnessradius=1500 active=true team=1>
+		  <waypoints>
+			<StaticEntity position="0,0,0"/>
+		  </waypoints>
+		</WaypointPatrolController>
+		  </controller>
+	</SpaceShip>
+								  
+	<?lua
+	end
+	?>
+				  
+	<!-- ENDE Gegner Innen-->
+				 
+	<!-- Gegnerische Patrouille -->	
+			  
+	<?lua
+		for i = 0, (7*math.pi/4), (math.pi/4)
+			do
+	?>
+	
+		 <?lua
+			for j = 1, 3, 1
+			   do
+		 ?>
+			<SpaceShip position="<?lua print((600+3200*j)*math.sin(i)) ?>,<?lua print((600+3200*j)*math.cos(i)) ?>,0" roll="<?lua print(180-i*180/math.pi)?>" lookat="0, 0, 0" >
+	
+			   <templates>
+			   <Template link=spaceshippirate />
+			   </templates>
+				<controller>
+			   <WaypointPatrolController alertnessradius=1500 active=true team=1>
+			   <waypoints>
+					   <?lua
+						 for k = 0, (29*math.pi/15), (math.pi/15)
+							   do 
+						?>  
+				   
+						   <Model mesh="cube.mesh" scale=0 position="<?lua print((600+3200*j)*math.sin(i+k)) ?>,<?lua print((600+3200*j)*math.cos(i+k)) ?>,0" />
+	
+					   <?lua	
+						end
+						?>
+									
+			   </waypoints>
+				</WaypointPatrolController>
+			   </controller>
+			</SpaceShip>
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+	
+	<!-- ENDE Gegnerische Patrouille -->							   
+							   
+	<!-- Gegnerische Flotte/ Totenkopfflotte-->						   
+	
+	<?lua
+		for j = 0, 1, 1
+			do
+	?>
+		<?lua
+			for i = 0, 4, 1
+				do
+		?>
+		<SpaceShip position="<?lua print (50*i-100)?>, 120000 ,<?lua print (-200*j+150)?>" roll="180" lookat="0, 0, 0">
+		  <templates>
+			  <Template link=spaceshippirate />
+		  </templates>
+			  <controller>
+			<WaypointPatrolController alertnessradius=1000 active=false team=1>
+			  <waypoints>
+				<StaticEntity position="<?lua print (5000*i-10000)?>, 0 ,<?lua print (-20000*j+15000)?>"/>
+			  </waypoints>
+				 <events>
+					  <activity>
+						  <EventListener event="atPortal1" />
+					  </activity>
+				  </events>
+			</WaypointPatrolController>
+			  </controller>
+		</SpaceShip>			
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+				
+	<?lua
+		for j = 0, 1, 1
+			do
+	?>
+		<?lua
+				for i = 0, 6, 1
+					do
+		?>
+			<SpaceShip position="<?lua print (50*i-150)?>, 120000 ,<?lua print (100-100*j)?>" roll="180" lookat="0, 0, 0">
+			  <templates>
+				  <Template link=spaceshippirate />
+			  </templates>
+				  <controller>
+				<WaypointPatrolController alertnessradius=1250 active=false team=1>
+				  <waypoints>
+					<StaticEntity position="<?lua print (5000*i-15000)?>, 0 ,<?lua print (10000-10000*j)?>"/>
+				  </waypoints>
+					 <events>
+					  <activity>
+						  <EventListener event="atPortal1" />
+					  </activity>
+				  </events>
+				</WaypointPatrolController>
+				  </controller>
+			</SpaceShip>			
+		<?lua
+		end
+		?>
+	<?lua
+	end
+	?>
+	
+	<?lua
+		for i = 0, 6, 3
+			do
+	?>
+			<SpaceShip position="<?lua print (50*i-150)?>, 120000 ,50" roll="180" lookat="0, 0, 0">
+			  <templates>
+				  <Template link=spaceshippirate />
+			  </templates>
+				  <controller>
+				<WaypointPatrolController alertnessradius=1500 active=false team=1>
+				  <waypoints>
+					<StaticEntity position="<?lua print (5000*i-15000)?>, 0 ,5000"/>
+				  </waypoints>
+			 <events>
+				  <activity>
+					  <EventListener event="atPortal1" />
+				  </activity>
+			  </events>
+				</WaypointPatrolController>
+				  </controller>
+			</SpaceShip>			
+	<?lua
+	end
+	?>
+			
+		
+	<?lua
+		for i = 1, 5, 2
+			do
+	?>
+			
+		<SpaceShip position="<?lua print (50*i-150)?>, 120000 ,-100" roll="180" lookat="0, 0, 0">
+		  <templates>
+			  <Template link=spaceshippirate />
+		  </templates>
+			  <controller>
+			<WaypointPatrolController alertnessradius=1000 active=false team=1>
+			  <waypoints>
+				<StaticEntity position="<?lua print (5000*i-15000)?>, 0 ,-10000"/>
+			  </waypoints>
+			 <events>
+				  <activity>
+					  <EventListener event="atPortal1" />
+				  </activity>
+			  </events>
+			</WaypointPatrolController>
+			  </controller>
+		</SpaceShip>
+			
+	<?lua
+	end
+	?>
+			
+	<!-- ENDE Gegnerische Flotte/ Totenkopfflotte-->	
+	
+	<!-- Boxen um Flotte zu befreien -->
+
+
+			<Pawn health=20 position="0, 112900, 0" direction="0,-1,0" name="boxDestroyed" collisionType=dynamic mass=100000  radarname = "Gravitation Box" >
+				<attached>
+					<Model position="0,0,0" scale="10" mesh="CuboidBody.mesh"  />
+				</attached>
+				<collisionShapes>
+					<BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+				</collisionShapes>
+				<controller>
+					<WaypointController team=1>
+					</WaypointController>
+				</controller>
+			 </Pawn>
+
+	
+	<!-- Flotte Erde-->
+	<?lua
+			for j = 0, 2, 1
+				  do       
+	?>
+		<?lua
+			for i = 0, 2, 1
+				  do       
+		?>
+				
+
+			<SpaceShip position="<?lua print(50-i*50) ?>, 113000,<?lua print(50-j*50) ?>" lookat="0,150000,0" maxhealt="200" initialhealth="200" >
+				<templates>
+				  <Template link=spaceshipassff2 /> <!--spaceshipTransporter -->
+				</templates>
+				  <controller>
+					 <WaypointPatrolController alertnessradius=5000 active=false team=0>
+					   <waypoints>
+						 <StaticEntity position="<?lua print(200-i*200) ?>,113000,<?lua print(400-j*400) ?>"/>
+					   </waypoints>
+				  <events>
+					  <activity>
+						  <EventListener event="boxtrigger" />
+					  </activity>
+				  </events>
+					 </WaypointPatrolController>
+				  </controller>
+			</SpaceShip>  
+   
+					
+		<?lua
+		end
+		?>
+				  
+	<?lua
+	end
+	?>
+					  
+	<!-- ENDE Flotte Erde-->
+			
+	<!--Portal-->
+		<Template name=PortalDefault>
+			<PortalEndPoint>
+				<attached>
+					<Model mesh="Spacegate.mesh" />
+				</attached>
+			</PortalEndPoint>
+		</Template>
+	
+		<PortalEndPoint position="0,112000,0" id="1" pitch="90" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+		<PortalEndPoint position="0,10350,0" id="2"  pitch="90" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+		<PortalLink fromID="1" toID="2" />
+		<PortalLink fromID="2" toID="1" />
+	<!--ENDE Portal-->
+	   
+	<!--Heimatplanet-->
+		<Planet
+		  position="0,100000,0"
+		  scale="10000"
+		  collisionType="dynamic"
+		  linearDamping="0.8"
+		  angularDamping="0"
+		  mass="5000000"
+		  pitch="180"
+		  yaw="0"
+		  roll="0"
+		  mesh="planets/earth.mesh"
+		  atmosphere="atmosphere1"
+		  rotationaxis="0,0,1"
+		  rotationrate="5.0"
+		  atmospheresize="80.0f"
+		  imagesize="1024.0f"
+		  collisiondamage = 1
+		  enablecollisiondamage = true
+		  >
+		  <attached>
+			  <ForceField position="0,0,0" mode="sphere" diameter="1000" velocity="-500" />
+			</attached>
+			<collisionShapes>
+			  <SphereCollisionShape radius="10000" position="0,0,0" />
+			</collisionShapes>
+		  </Planet>	 
+	<!--ENDE Heimatplanet-->	
+
+  </Scene>
+						   
+</Level>
+
Index: code/trunk/data/levels/presentationHS13.oxw
===================================================================
--- code/trunk/data/levels/presentationHS13.oxw	(revision 10257)
+++ code/trunk/data/levels/presentationHS13.oxw	(revision 10258)
@@ -131,5 +131,5 @@
 
 	    <undocking>
-		<EventListener event="undockMe" />
+			<EventListener event="undockMe" />
 	    </undocking>
 	
Index: code/trunk/data/levels/templates/DodgeRacePattern.oxt
===================================================================
--- code/trunk/data/levels/templates/DodgeRacePattern.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/DodgeRacePattern.oxt	(revision 10258)
@@ -0,0 +1,61 @@
+<Template name=DodgeRaceCube01>
+  
+	<DodgeRaceCube position="0,0,0" direction="0,0,0"   scale="1" collisionType=dynamic mass=1 friction=0.01 >
+      <attached>
+        <Model position="700,0,50" 		mesh="CuboidBody.mesh" 		scale3D="300,50,50" 	/>
+		<Model position="700,0,1150" 	mesh="CuboidBody.mesh" 		scale3D="300,50,50" 	/>
+		<Model position="1200,0,200" 	mesh="CuboidBody.mesh" 		scale3D="100,50,100" 	/>
+		<Model position="1200,0,1000"	mesh="CuboidBody.mesh" 		scale3D="100,50,100" 	/>
+		<Model position="1250,-10,430"	mesh="CuboidBody.mesh" 		scale3D="50,40,30" 		/>
+		<Model position="1250,-10,600"	mesh="CuboidBody.mesh" 		scale3D="50,40,30" 		/>
+		<Model position="1250,-10,770"	mesh="CuboidBody.mesh" 		scale3D="50,40,30" 		/>
+		<Model position="1650,0,350"	mesh="CuboidBody.mesh" 		scale3D="50,50,150" 	/>
+		<Model position="1650,0,850"	mesh="CuboidBody.mesh" 		scale3D="50,50,150" 	/>
+		<Model position="2100,0,150" 	mesh="CuboidBody.mesh" 		scale3D="100,50,150" 	/>
+		<Model position="2100,0,1050"	mesh="CuboidBody.mesh" 		scale3D="100,50,150" 	/>
+		<Model position="2150,0,600"	mesh="CuboidBody.mesh"		scale3D="50,50,100"		/>
+      </attached>
+
+      <collisionShapes>
+		<BoxCollisionShape position="700,0,50" 		 		halfExtents="300,50,50" 	/>
+		<BoxCollisionShape position="700,0,1150" 	 		halfExtents="300,50,50" 	/>
+		<BoxCollisionShape position="1200,0,200" 	 		halfExtents="100,50,100" 	/>
+		<BoxCollisionShape position="1200,0,1000"	 		halfExtents="100,50,100" 	/>
+		<BoxCollisionShape position="1250,-10,430"	 		halfExtents="50,40,30" 		/>
+		<BoxCollisionShape position="1250,-10,600"	 		halfExtents="50,40,30" 		/>
+		<BoxCollisionShape position="1250,-10,770"	 		halfExtents="50,40,30" 		/>
+		<BoxCollisionShape position="1650,0,350"	 		halfExtents="50,50,150" 	/>
+		<BoxCollisionShape position="1650,0,850"	 		halfExtents="50,50,150" 	/>
+		<BoxCollisionShape position="2100,0,150" 	 		halfExtents="100,50,150" 	/>
+		<BoxCollisionShape position="2100,0,1050"	 		halfExtents="100,50,150" 	/>
+		<BoxCollisionShape position="2150,0,600"			halfExtents="50,50,100"		/>
+      </collisionShapes>
+	</DodgeRaceCube>
+
+</Template>
+
+<Template name=DodgeRaceCube02>
+  
+	<DodgeRaceCube position="0,0,0" direction="0,0,0"   scale="1" collisionType=dynamic mass=1 friction=0.01 >
+      <attached>
+		<Model position="450,0,300" 	mesh="CuboidBody.mesh" 		scale3D="50,50,300" 	/>
+		<Model position="950,0,850" 	mesh="CuboidBody.mesh" 		scale3D="50,50,350" 	/>
+		<Model position="1350,0,200" 	mesh="CuboidBody.mesh" 		scale3D="50,50,200" 	/>
+		<Model position="1350,0,700"	mesh="CuboidBody.mesh" 		scale3D="50,50,100" 	/>
+		<Model position="1750,0,350"	mesh="CuboidBody.mesh" 		scale3D="50,50,350" 	/>
+		<Model position="2000,0,1000"	mesh="CuboidBody.mesh" 		scale3D="100,50,100" 	/>
+		<Model position="1650,0,1150"	mesh="CuboidBody.mesh" 		scale3D="450,50,50" 	/>
+      </attached>
+
+      <collisionShapes>
+		<BoxCollisionShape position="450,0,300" 		 		halfExtents="50,50,300" 	/>
+		<BoxCollisionShape position="950,0,850" 	 		halfExtents="50,50,350" 	/>
+		<BoxCollisionShape position="1350,0,200" 	 		halfExtents="50,50,200" 	/>
+		<BoxCollisionShape position="1350,0,700"		 		halfExtents="50,50,100" 	/>
+		<BoxCollisionShape position="1750,0,350"	 		halfExtents="50,50,350" 	/>
+		<BoxCollisionShape position="2000,0,1000"	 		halfExtents="100,50,100" 	/>
+		<BoxCollisionShape position="1650,0,1150"	 		halfExtents="450,50,50" 	/>
+      </collisionShapes>
+	</DodgeRaceCube>
+
+</Template>
Index: code/trunk/data/levels/templates/FPS.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS.oxt	(revision 10257)
+++ code/trunk/data/levels/templates/FPS.oxt	(revision 10258)
@@ -21,6 +21,6 @@
    weapon            = "hs-w01.mesh"
   >
-    <collisionShapes>
-      <BoxCollisionShape position="0,-20,0" halfExtents="15,25,15" />
+    <collisionShapes>			<!-- old values: position="0,-20,0"  halfExtents="15,25,15"  -->
+      <BoxCollisionShape position="0,-25,0" halfExtents="15,20,15" />
     </collisionShapes>
 
Index: code/trunk/data/levels/templates/FPS_HS14.oxt
===================================================================
--- code/trunk/data/levels/templates/FPS_HS14.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/FPS_HS14.oxt	(revision 10258)
@@ -0,0 +1,54 @@
+<Template name=fps_HS14>
+  <FpsPlayer
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   primaryThrust     = 0;
+   auxilaryThrust    = 0;
+   rotationThrust    = 0;
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+   friction          = 0.01
+
+   weapon            = "hs-w01.mesh"
+  >
+    <collisionShapes>
+   <!--Normal values: position="0,-45,0" halfExtents="15,50,15" -->
+      <BoxCollisionShape position="0,-45,0" halfExtents="15,50,15" /> 
+    </collisionShapes>
+
+    <camerapositions>
+      <CameraPosition position="-1,1,2.2" drag=false mouselook=true />
+    </camerapositions>
+
+    <?lua
+        include("../includes/weaponSettingsFPS_HS14.oxi")
+    ?>
+
+  </FpsPlayer>
+</Template>
+<!--
+<Template name=fpscamera defaults=0>
+  <FpsPlayer>
+    <camerapositions>
+      <CameraPosition position="0,0,20" drag=false mouselook=true />
+
+      <!--
+      CameraPosition position="0,150,-25" pitch=-90 drag=true />
+      <CameraPosition position="0,0,-40" yaw=180 drag=true />
+      <CameraPosition position="0,3,-14" yaw=0 />
+      <CameraPosition position="-50,5,-8" yaw=-90 drag=true />
+      <CameraPosition position="50,5,-8" yaw=90 drag=true /
+
+    </camerapositions>
+  </FpsPlayer>
+</Template>
+-->
Index: code/trunk/data/levels/templates/enemytowerdefense.oxt
===================================================================
--- code/trunk/data/levels/templates/enemytowerdefense.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/enemytowerdefense.oxt	(revision 10258)
@@ -0,0 +1,234 @@
+<Template name=enemytowerdefense1>
+  <TowerDefenseEnemy
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 1
+   maxhealth         = 2
+   initialhealth     = 1
+
+   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
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <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>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
+
+
+<Template name=enemytowerdefense2>
+  <TowerDefenseEnemy
+   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
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <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="JumpEnemy3.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>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
+
+<Template name=enemytowerdefense3>
+  <TowerDefenseEnemy
+   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
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <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="JumpEnemy4.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>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
Index: code/trunk/data/levels/templates/spaceshipDodgeRace.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipDodgeRace.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/spaceshipDodgeRace.oxt	(revision 10258)
@@ -0,0 +1,117 @@
+<Template name=spaceshipdodgerace>
+  <DodgeRaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipescortcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 4
+
+   health            = 40
+   maxhealth         = 40
+   initialhealth     = 40
+
+   shieldhealth        = 20
+   initialshieldhealth = 20
+   maxshieldhealth     = 20
+   shieldabsorption    = 0.1
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 150
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 20
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 6
+
+   collisionType     = "dynamic"
+   mass              = 4200000
+   linearDamping     = 0.9999999
+   angularDamping    = 0.9999999
+
+   collisiondamage = 100
+   enablecollisiondamage = true
+   
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipinvaderengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipinvaderengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
+      <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0    ,0 ,  3" halfExtents="10,   4,8" />
+      <BoxCollisionShape position="12.6 ,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="-12.6,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="0,     0,-12" halfExtents="4  , 4 ,7" />
+    </collisionShapes>
+<?lua
+  include("../includes/invaderWeapon.oxi")
+?>
+  </DodgeRaceShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+  <DodgeRaceShip>
+    <camerapositions>
+		<CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true />
+		<CameraPosition position="0,200,250" direction="0, -0.4, -1" drag=false mouselook=true />
+		<CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
+		<CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
+    </camerapositions>
+  </DodgeRaceShip>
+</Template>
+
+<Template name=spaceshipinvaderengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2.2
+
+   speedfront     = 200
+   speedback      =  70
+   speedleftright =  70
+   speedupdown    =  70
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 700
+   accelerationbrake     = 700
+   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.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 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.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 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.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 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.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+
+  </MultiStateEngine>
+</Template>
Index: code/trunk/data/levels/templates/spacestation_elements.oxt
===================================================================
--- code/trunk/data/levels/templates/spacestation_elements.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/spacestation_elements.oxt	(revision 10258)
@@ -0,0 +1,466 @@
+<!--Templates of spacestation elements with alle their collisionshapes,
+	for creating a spacestation very easy.
+	Autor: Florian Süess
+	Test Level: FPS_Level_HS14 	-->	
+<Template name=spacestation_elements>
+	<SpaceStation
+	normalTubetemplate		= ss_tube
+	curvedTubetemplate		= ss_curve
+	crossingTubetemplate	= ss_tube_x
+	wall					= ss_wall
+	flagg					= ss_flag_aean
+	>
+	</SpaceStation>
+</Template>
+	
+	
+<!-- to place the different collisionshapes, I used some help boxes and an help coordinate system.
+	 The axis from the coordinatesystem are "red,green,yellow" and the orange boxe shows the negative direction.
+	 But atention, each element is different! A few of them are already rotatet with yaw, roll and pitch:
+	 -> "pitch" is a rotation around "red" in the "yellow, green" plain.
+	 -> "yaw" is a rotation around "green" in the "red, yellow" plain.
+	 -> "roll" is a rotation around "yellow" in the "green,red" plain.
+	 this chanches their negativ/positiv direction of the axis.
+	 -->
+			
+
+<!-- Spacestation Element Tube -->
+<Template name=ss_tube>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<Model position="0,0,0" yaw=0 scale3D="100,100,100" mesh="ss_tube.mesh" />
+
+	</attached>
+	 <collisionShapes>
+		<BoxCollisionShape position="0,0,100"  			halfExtents="250,100,0" />	<!--Wand links-->
+		<BoxCollisionShape position="0,0,-100"     		halfExtents="250,100,0" />	<!--Wand rechts-->
+		<BoxCollisionShape position="0,100,0"    	 	halfExtents="250,0,100" />	<!--Decke-->
+		<BoxCollisionShape position="0,-100,0"     		halfExtents="250,0,100" />	<!--Boden-->
+		
+      
+     </collisionShapes>
+   
+<Model position="-200,0,-275"  mesh="cube_green.mesh" scale3D="0,100,75" />
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Curve -->
+<Template name=ss_curve>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+
+	<!--<Model position="0,0,-200"  mesh="cube_green.mesh" scale3D="0,100,150" />
+		<Model position="-300,0,100"  mesh="cube_green.mesh" scale3D="150,100,0" />
+		<Model position="-100,0,0" yaw=45 mesh="cube_red.mesh" scale3D="150,100,0" />
+
+		<Model position="-200,0,-275"  mesh="cube_green.mesh" scale3D="0,100,75" />
+		<Model position="-375,0,-100"  mesh="cube_green.mesh" scale3D="75,100,0" />
+		<Model position="-245,0,-148" yaw=45 mesh="cube_red.mesh" scale3D="70.71,100,0" />
+
+		<Model position="-225,100,-125"  mesh="cube_red.mesh" scale3D="225,0,225" /> -->
+
+
+	<Model position="0,0,0" yaw=0 scale3D="100,100,100" mesh="ss_curve.mesh" />
+
+
+	</attached>
+	 <collisionShapes>
+		<BoxCollisionShape position="0,0,-200"  				halfExtents="0,100,150" />	<!--Wand rechts-->
+		<BoxCollisionShape position="-300,0,100"  				halfExtents="150,100,0" />	<!--Wand rechts-->
+		<BoxCollisionShape position="-100,0,0"   	yaw=45		halfExtents="150,100,0" />	<!--Wand rechts-->
+		<BoxCollisionShape position="-200,0,-275"  				halfExtents="0,100,75" />	<!--Wand links-->
+		<BoxCollisionShape position="-375,0,-100"  				halfExtents="75,100,0" />	<!--Wand links-->
+		<BoxCollisionShape position="-245,0,-148"  	yaw=45		halfExtents="70.7,100,0" />	<!--Wand links-->
+		<BoxCollisionShape position="-225,100,-125" 			halfExtents="225,0,225" />	<!--Boden-->
+		<BoxCollisionShape position="-225,-100,-125"     		halfExtents="250,0,225" />	<!--Decke-->
+      
+     </collisionShapes>
+  
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Crossing -->
+<Template name=ss_tube_x>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+
+	<!--<Model position="175,0,100" 	mesh="cube_green.mesh" scale3D="75,100,0" />
+		<Model position="-0,0,275"  	mesh="cube_green.mesh" scale3D="0,100,75" />
+		<Model position="-200,0,275" 	mesh="cube_red.mesh" scale3D="0,100,75" />
+		<Model position="-375,0,100" 	mesh="cube_red.mesh" scale3D="75,100,0" />
+
+		<Model position="175,0,-100"  	mesh="cube_green.mesh" scale3D="75,100,0" />
+		<Model position="0,0,-275" 		mesh="cube_green.mesh" scale3D="0,100,75" />
+		<Model position="-200,0,-275" 	mesh="cube_red.mesh" scale3D="0,100,75" />
+		<Model position="-375,0,-100" 	mesh="cube_red.mesh" scale3D="75,100,0" />
+
+		<Model position="-245,0,-147"  	yaw=45		mesh="cube_red.mesh" scale3D="70.7,100,0" />
+		<Model position="50,0,-147"  	yaw=-45		mesh="cube_red.mesh" scale3D="70.7,100,0" />
+		<Model position="-245,0,149" 	yaw=-45		mesh="cube_orange.mesh" scale3D="70.7,100,0" />
+		<Model position="50,0,148"  	yaw=45		mesh="cube_orange.mesh" scale3D="70.7,100,0" /> -->
+	
+	<Model position="0,0,0" scale3D="100,100,100" mesh="ss_tube_x.mesh" />
+
+	</attached>
+	 <collisionShapes>
+		<BoxCollisionShape position="175,0,100"  			halfExtents="75,100,0" />	<!--Wand links-->
+		<BoxCollisionShape position="0,0,275"  				halfExtents="0,100,75" />	<!--Wand links-->
+		<BoxCollisionShape position="-200,0,275"  			halfExtents="0,100,75" />	<!--Wand links-->
+		<BoxCollisionShape position="-375,0,100"  			halfExtents="75,100,0" />	<!--Wand links-->
+		
+		<BoxCollisionShape position="175,0,-100"     		halfExtents="75,100,0" />	<!--Wand rechts-->
+		<BoxCollisionShape position="0,0,-275"     			halfExtents="0,100,75" />	<!--Wand rechts-->
+		<BoxCollisionShape position="-200,0,-275"     		halfExtents="0,100,75" />	<!--Wand rechts-->
+		<BoxCollisionShape position="-375,0,-100"     		halfExtents="75,100,0" />	<!--Wand rechts-->
+		
+		<BoxCollisionShape position="-245,0,-147"   yaw=45  	halfExtents="70.7,100,0" />	<!--Wand schraeg rechts-->
+		<BoxCollisionShape position="50,0,-149"     yaw=-45		halfExtents="70.7,100,0" />	<!--Wand schraeg rechts-->
+		<BoxCollisionShape position="-245,0,149"  	yaw=-45  	halfExtents="70.7,100,0" />	<!--Wand schraeg links-->
+		<BoxCollisionShape position="50,0,148" 		yaw=45 		halfExtents="70.7,100,0" />	<!--Wand schraeg links-->
+		
+		
+		
+		<BoxCollisionShape position="-100,100,0"    	 	halfExtents="350,0,350" />	<!--Boden-->
+		<BoxCollisionShape position="-100,-110,0"     		halfExtents="350,0,350" />	<!--decke-->
+      
+     </collisionShapes>
+    
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Flagroom -->
+<Template name=ss_flag_room>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+	
+	<!--<Model position="-125,116,0" 				mesh="cube_green.mesh" 	scale3D="130,0,125" />
+		<Model position="-275,116,235" 	yaw=55		mesh="cube_green.mesh" 	scale3D="140,0,50" />
+		<Model position="-275,116,-235"	yaw=-55		mesh="cube_red.mesh"	scale3D="140,0,50" />
+		<Model position="-365,116,320" 	yaw=35		mesh="cube_green.mesh"	scale3D="100,0,50" />
+		<Model position="-365,116,-320"	yaw=-35		mesh="cube_red.mesh" 	scale3D="100,0,50" />
+		<Model position="-520,156,380" 	roll=-25	mesh="cube_green.mesh" 	scale3D="100,0,50" />
+		<Model position="-520,156,-380"	roll=-25	mesh="cube_red.mesh" 	scale3D="100,0,50" />	
+
+
+		<Model position="-80,0,100" 				mesh="cube_green.mesh" 	scale3D="80,100,0" />
+		<Model position="-160,0,150" 	yaw=90		mesh="cube_green.mesh" 	scale3D="50,200,0" />
+		<Model position="-220,0,260" 	yaw=55		mesh="cube_green.mesh" 	scale3D="140,200,0" />
+		<Model position="-360,0,390" 	yaw=33		mesh="cube_green.mesh" 	scale3D="110,200,0" />
+		<Model position="-600,16,430" 				mesh="cube_green.mesh" 	scale3D="200,200,0" />
+		<Model position="-810,16,405"	yaw=-32		mesh="cube_green.mesh" 	scale3D="150,200,0" />
+		<Model position="-965,166,270"	yaw=-55		mesh="cube_green.mesh" 	scale3D="150,50,0" />
+
+		<Model position="-80,0,-100" 				mesh="cube_red.mesh" 	scale3D="80,100,0" />
+		<Model position="-160,0,-150" 	yaw=-90		mesh="cube_red.mesh" 	scale3D="50,200,0" />
+		<Model position="-220,0,-260" 	yaw=-55		mesh="cube_red.mesh" 	scale3D="140,200,0" />
+		<Model position="-360,0,-390" 	yaw=-33		mesh="cube_red.mesh" 	scale3D="110,200,0" />
+		<Model position="-600,16,-430" 				mesh="cube_red.mesh" 	scale3D="200,200,0" />
+		<Model position="-810,16,-405"  yaw=32		mesh="cube_red.mesh" 	scale3D="150,200,0" />
+		<Model position="-965,166,-270" yaw=55		mesh="cube_red.mesh" 	scale3D="150,50,0" />	
+
+		<Model position="-1045,166,0" 				mesh="cube_orange.mesh" 	scale3D="0,50,160" />
+
+
+		<Model position="-650,200,0"  	mesh="cube_green.mesh" scale3D="400,0,450" />
+
+		<Model position="-500,-200,0" 	mesh="cube_green.mesh" scale3D="400,0,400" />	
+		<Model position="-60,-84,0" 	mesh="cube_green.mesh" scale3D="60,0,100" />	
+	
+		<Model position="-1015,156,0" 	mesh="cube_orange.mesh" scale3D="27,25,120" />	
+		<Model position="-580,185,0" 	mesh="cube_orange.mesh" scale3D="30,12,30" />
+		<Model position="-580,195,0" 	mesh="cube_orange.mesh" scale3D="50,10,50" />
+
+
+
+		<Model position="-255,121,0" 				mesh="cube_green.mesh" 	scale3D="0,85,125" />
+		<Model position="-300,116,190" 	yaw=-35		mesh="cube_green.mesh" 	scale3D="0,80,75" />	
+		<Model position="-300,116,-190"	yaw=35		mesh="cube_green.mesh" 	scale3D="0,80,75" />
+		<Model position="-410,116,290" 	yaw=-55		mesh="cube_green.mesh" 	scale3D="0,80,75" />	
+		<Model position="-410,116,-290"	yaw=55		mesh="cube_green.mesh" 	scale3D="0,80,75" />	
+		<Model position="-500,185,328"  yaw=2		roll=-25	mesh="cube_green.mesh" 	scale3D="100,35,0" />
+		<Model position="-500,185,-328"	yaw=-2		roll=-25	mesh="cube_red.mesh"	scale3D="100,35,0" />	-->
+
+
+
+	<!-- points for the orientation -->
+	<!--<Model position="0,0,0" 			mesh="cube_orange.mesh" scale3D="10,10,10" />
+		<Model position="-260,0,0" 			mesh="cube_orange.mesh" scale3D="10,10,10" />
+		<Model position="-580,0,400" 		mesh="cube_orange.mesh" scale3D="10,10,10" />
+		<Model position="-580,0,-400" 		mesh="cube_orange.mesh" scale3D="10,10,10" />
+	
+		<Model position="-580,0,0" 			mesh="cube_orange.mesh" scale3D="10,10,10" />	-->
+	
+
+	<Model position="0,0,0" yaw=0 pitch=-90 scale3D="100,100,100"  mesh="ss_flag_room.mesh" />
+
+	</attached>
+	 <collisionShapes>
+		<BoxCollisionShape position="-125,116,0"    	 		halfExtents="130,0,125" />	<!--Boden oben mitte-->
+		<BoxCollisionShape position="-275,116,235"   yaw=55 	halfExtents="140,0,50" />	<!--Boden oben rechts-->
+		<BoxCollisionShape position="-275,116,-235"  yaw=-55  	halfExtents="140,0,50" />	<!--Boden oben links-->
+		<BoxCollisionShape position="-365,116,320"   yaw=35	 	halfExtents="100,0,50" />	<!--Boden oben rechts-->
+		<BoxCollisionShape position="-365,116,-320"  yaw=-35 	halfExtents="100,0,50" />	<!--Boden oben links-->
+		<BoxCollisionShape position="-520,156,380"   roll=-25	halfExtents="100,0,50" />	<!--Boden oben rechts-->
+		<BoxCollisionShape position="-520,156,-380"  roll=-25 	halfExtents="100,0,50" />	<!--Boden oben links-->
+		
+		
+		<BoxCollisionShape position="-80,0,100"    	 			halfExtents="80,100,0" />	<!--Wand oben rechts-->
+		<BoxCollisionShape position="-160,0,150"  	yaw=90 		halfExtents="50,200,0" />	<!--Wand oben rechts-->	
+		<BoxCollisionShape position="-220,0,260"  	yaw=55 		halfExtents="100,200,0" />	<!--Wand oben rechts-->
+		<BoxCollisionShape position="-360,0,390"  	yaw=33 		halfExtents="110,200,0" />	<!--Wand oben rechts-->
+		<BoxCollisionShape position="-600,16,430"  		 		halfExtents="200,200,0" />	<!--Wand unten rechts-->
+		<BoxCollisionShape position="-810,16,405"   yaw=-32 	halfExtents="150,200,0" />	<!--Wand unten rechts-->
+		<BoxCollisionShape position="-965,166,270"  yaw=-55 	halfExtents="150,50,0" />	<!--Wand unten rechts-->		
+		
+		<BoxCollisionShape position="-80,0,-100"    	 		halfExtents="80,100,0" />	<!--Wand oben links-->
+		<BoxCollisionShape position="-160,0,-150" 	yaw=-90		halfExtents="50,200,0" />	<!--Wand oben links-->	
+		<BoxCollisionShape position="-220,0,-260" 	yaw=-55		halfExtents="100,200,0" />	<!--Wand oben links-->
+		<BoxCollisionShape position="-360,0,-390" 	yaw=-33		halfExtents="110,200,0" />	<!--Wand oben links-->
+		<BoxCollisionShape position="-600,16,-430" 				halfExtents="200,200,0" />	<!--Wand unten links-->
+		<BoxCollisionShape position="-810,16,-405"  yaw=32		halfExtents="150,200,0" />	<!--Wand unten links-->
+		<BoxCollisionShape position="-965,166,-270" yaw=55		halfExtents="150,50,0" />	<!--Wand unten links-->
+		
+		<BoxCollisionShape position="-1045,166,0" 				halfExtents="0,50,160" />	<!--Wand unten mitte-->
+		
+			
+	
+		<BoxCollisionShape position="-650,200,0"    	 		halfExtents="400,0,450" />	<!--Boden unten-->
+	
+		<BoxCollisionShape position="-500,-200,0"     			halfExtents="400,0,400" />	<!--decke-->
+		<BoxCollisionShape position="-60,-84,0"     			halfExtents="60,0,100" />	<!--decke oben-->
+		
+		<BoxCollisionShape position="-1015,156,0"     			halfExtents="27,25,120" />	<!--Tisch-->		
+		<BoxCollisionShape position="-580,185,0"     				halfExtents="30,12,30" />	<!--Stufe "Mittelpkt"-->
+		<BoxCollisionShape position="-580,195,0"     				halfExtents="50,10,50" />	<!--Stufe "Mittelpkt"-->
+		
+		
+		<BoxCollisionShape position="-255,121,0"    	 		halfExtents="0,85,125" />	<!--Wand innen-->
+		<BoxCollisionShape position="-300,116,190"    yaw=-35	halfExtents="0,80,75" />	<!--Wand innen-->
+		<BoxCollisionShape position="-300,116,-190"   yaw=35	halfExtents="0,80,75" />	<!--Wand innen-->		
+		<BoxCollisionShape position="-410,116,290"    yaw=-55	halfExtents="0,80,75" />	<!--Wand innen-->
+		<BoxCollisionShape position="-410,116,-290"   yaw=55	halfExtents="0,80,75" />	<!--Wand innen-->
+		<BoxCollisionShape position="-500,185,328"    yaw=2		roll=-25	halfExtents="100,35,0" />	<!--Wand innen-->
+		<BoxCollisionShape position="-500,185,-328"   yaw=-2  	roll=-25	halfExtents="100,35,0" />	<!--Wand innen-->
+		
+		      
+     </collisionShapes>
+ 	   
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Machine -->
+<Template name=ss_machine>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+
+	<!-- Boxes helps to place collisionShapes -->
+	
+	<!--<Model position="0,80,0" 			mesh="cube_orange.mesh" scale3D="40,80,25" />	-->
+
+	<Model position="0,0,0" roll=0 scale3D="0.15,0.15,0.15" mesh="ss_machine.mesh" />
+
+	</attached>
+	 <collisionShapes>
+
+		<BoxCollisionShape position="0,80,0"		halfExtents="40,80,25" />	<!--whole machine-->
+      
+     </collisionShapes>
+ 	 -->   
+    
+ 	 </MovableEntity>   
+roll=180 mesh="ss_table.mesh" scale3D="25,25,25"
+</Template>
+
+
+<!-- Spacestation Element Table-->		
+<Template name=ss_table>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+			
+	<!--<Model position="0,-32,0"		mesh="cube_orange.mesh" scale3D="60,32,40" />	-->
+	
+	<Model position="0,0,0"	roll=180 scale3D="25,25,25" mesh="ss_table.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+	
+		<BoxCollisionShape position="0,-32,0"	yaw=15	halfExtents="60,32,40" />	<!--ganzer Tisch-->
+      
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Table (cracked) -->
+<Template name=ss_table_cracked>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+	
+	<!-- Boxes helps to place collisionShapes -->
+		
+	<!--<Model position="0,-32,0" 			mesh="cube_orange.mesh" scale3D="60,32,40" />	-->
+
+
+	<Model position="0,0,0" roll=180 scale3D="25,25,25" mesh="ss_table_cracked.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+	
+		<BoxCollisionShape position="0,-32,0"		halfExtents="60,32,40" />	<!--ganzer Tisch-->
+      
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Cylinder -->
+<Template name=ss_cylinder>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+	
+	<!-- Boxes helps to place collisionShapes -->
+			
+	<!--<Model position="0,-40,0" 	yaw=15		mesh="cube_red.mesh" scale3D="7,65,25" />
+		<Model position="0,-40,0" 	yaw=45		mesh="cube_red.mesh" scale3D="7,65,25" />
+		<Model position="0,-40,0" 	yaw=75		mesh="cube_red.mesh" scale3D="7,65,25" />
+		<Model position="0,-40,0" 	yaw=105		mesh="cube_red.mesh" scale3D="7,65,25" />
+		<Model position="0,-40,0" 	yaw=135		mesh="cube_red.mesh" scale3D="7,65,25" />
+		<Model position="0,-40,0" 	yaw=165		mesh="cube_red.mesh" scale3D="7,65,25" />	-->
+	
+	
+	<Model position="0,0,0" roll=180 scale3D="25,25,25" mesh="ss_cylinder.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+		
+		<BoxCollisionShape position="0,-40,0"	yaw=15	halfExtents="10,65,25" />	<!--Fuellung-->
+		<BoxCollisionShape position="0,-40,0"	yaw=45	halfExtents="10,65,25" />	<!--Fuellung-->
+		<BoxCollisionShape position="0,-40,0"	yaw=75	halfExtents="10,65,25" />	<!--Fuellung-->
+		<BoxCollisionShape position="0,-40,0"	yaw=105	halfExtents="10,65,25" />	<!--Fuellung-->
+		<BoxCollisionShape position="0,-40,0"	yaw=135	halfExtents="10,65,25" />	<!--Fuellung-->
+		<BoxCollisionShape position="0,-40,0"	yaw=165	halfExtents="10,65,25" />	<!--Fuellung-->
+		      
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Chair -->
+<Template name=ss_chair>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+	
+	<!--<Model position="-5,18,0" 			mesh="cube_orange.mesh" scale3D="20,20,20" />
+		<Model position="-23,-30,0" 			mesh="cube_orange.mesh" scale3D="2,33,18" />	-->
+	
+
+	<Model position="0,0,0" roll=0 pitch=180 scale3D="20,20,20" mesh="ss_chair.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+				
+		<BoxCollisionShape position="-5,18,0"    	 		halfExtents="20,20,20" />	<!--Unterer Teil-->
+		<BoxCollisionShape position="-23,-30,0"    	 		halfExtents="2,33,20" />	<!--Rueckenlaehne-->
+		
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+
+
+<!-- Spacestation Element Wall -->
+<Template name=ss_wall>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+	
+	<!-- Boxes helps to place collisionShapes -->
+	
+	<!--<Model position="-78,0,0"		mesh="cube_orange.mesh" scale3D="2,100,100" />	-->
+	
+
+	<Model position="0,0,0" roll=0	pitch=180	scale3D="80,80,80" mesh="ss_wall.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+	
+		<BoxCollisionShape position="-78,0,0"		halfExtents="2,100,100" />	<!--Flache Seite-->
+	
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+	
+
+<!-- Spacestation Element Flag -->
+<Template name=ss_flag_aean>
+
+	<MovableEntity position="0,0,0">
+	<attached>
+
+	<!-- Boxes helps to place collisionShapes -->
+	
+	<!--<Model position="0,0,0" 			mesh="cube_orange.mesh" scale3D="2,160,2" />
+		<Model position="0,108,80" 		mesh="cube_orange.mesh" scale3D="1,50,80" />	-->
+	
+
+	<Model position="0,0,0" roll=0 scale3D="40,40,40" mesh="ss_flag_aean.mesh"  />
+
+	</attached>
+	 <collisionShapes>
+
+		<BoxCollisionShape position="0,0,0"    	 		halfExtents="2,160,2" />	<!--Mast-->
+		<BoxCollisionShape position="0,108,80"    	 	halfExtents="1,50,80" />	<!--Flagge-->
+      
+	 </collisionShapes>
+
+    
+ 	 </MovableEntity>   
+
+</Template>
+		
Index: code/trunk/data/levels/templates/ss_tube01.oxt
===================================================================
--- code/trunk/data/levels/templates/ss_tube01.oxt	(revision 10258)
+++ code/trunk/data/levels/templates/ss_tube01.oxt	(revision 10258)
@@ -0,0 +1,20 @@
+<Template name=ss_tube01>
+
+<MovableEntity position="0,0,0">
+<attached>
+
+<Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=1 mesh="ss_tube.mesh" />
+
+</attached>
+<!--    <collisionShapes>
+	<BoxCollisionShape position="0,8,17"      halfExtents="8,10,10" />
+	<BoxCollisionShape position="0,0,22"      halfExtents="18, 2, 10" />
+	<BoxCollisionShape position="0,0,9"      halfExtents="12, 2, 20" />
+	<BoxCollisionShape position="0,0,-18"      halfExtents="6, 2, 18" />
+      
+    </collisionShapes>
+ -->   
+    
+</MovableEntity>   
+ 
+</Template>
Index: code/trunk/data/levels/templates/tower.oxt
===================================================================
--- code/trunk/data/levels/templates/tower.oxt	(revision 10257)
+++ code/trunk/data/levels/templates/tower.oxt	(revision 10258)
@@ -1,4 +1,4 @@
 <Template name=tower>
-  <Tower
+  <TowerDefenseTower
 
 
@@ -20,8 +20,11 @@
         </WaypointPatrolController>
     </controller>
+    
 
 
     <attached>
         <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
+        
+        
     </attached>
 
@@ -33,5 +36,93 @@
   include("../includes/towerWeaponSettings.oxi")
 ?>
-  </Tower>
+  </TowerDefenseTower>
 </Template>
 
+
+
+<Template name=towerturret>
+  <TowerDefenseTower
+
+
+   explosionchunks        = 6
+
+   reloadrate          = 10
+   reloadwaittime      = 5
+
+   collisionType     = "dynamic"
+   team = 1
+
+
+  >
+  <attached>
+
+    <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
+
+    <Turret reloadrate=10 reloadwaittime=5 collisionType="dynamic" position="0,0,10" direction="0,0,1" pitch="0" yaw="0" roll="0" angularDamping=0.999999 mass=100 maxPitch=90 maxYaw=90 maxAttackRadius=1000 minAttackRadius=30>
+
+      <controller>
+        <TurretController/>
+      </controller>
+      <?lua
+        include("../includes/weaponSettingsTurret.oxi")
+      ?>
+    </Turret>
+    
+  </attached>
+    
+
+
+
+    <!--collisionShapes>
+
+    </collisionShapes-->
+
+<?lua
+  include("../includes/towerWeaponSettings.oxi")
+?>
+  </TowerDefenseTower>
+</Template>
+
+
+
+<Template name=towerturret1>
+  <TowerDefenseTower
+
+
+   explosionchunks        = 6
+
+   reloadrate          = 10
+   reloadwaittime      = 5
+
+   collisionType     = "dynamic"
+   team = 1
+
+
+  >
+  <attached>
+
+
+    <Turret reloadrate=10 reloadwaittime=5 collisionType="dynamic" position="0,0,10" direction="0,0,1" pitch="0" yaw="0" roll="0" angularDamping=0.999999 mass=100 maxPitch=90 maxYaw=90 maxAttackRadius=1000 minAttackRadius=30>
+
+      <controller>
+        <TurretController/>
+      </controller>
+      <?lua
+        include("../includes/weaponSettingsTurret1.oxi")
+      ?>
+    </Turret>
+    
+  </attached>
+    
+
+
+
+    <!--collisionShapes>
+
+    </collisionShapes-->
+
+<?lua
+  include("../includes/towerWeaponSettings.oxi")
+?>
+  </TowerDefenseTower>
+</Template>
Index: code/trunk/data/levels/towerDefense.oxw
===================================================================
--- code/trunk/data/levels/towerDefense.oxw	(revision 10257)
+++ code/trunk/data/levels/towerDefense.oxw	(revision 10258)
@@ -21,9 +21,11 @@
   include("templates/spaceshipPirate.oxt")
   include("templates/tower.oxt")
+  include("templates/enemytowerdefense.oxt")
+  include("templates/standardTurret.oxt")
 ?>
 
 <!-- Specify the position of the camera -->
 <Template name=centerpointmarkcamera defaults=0>
-  <Pawn>
+  <Pawn team=1>
     <camerapositions>
       <CameraPosition position="0,0,1500"/>
@@ -34,5 +36,5 @@
 <!-- Loads a mesh to mark the center-->
 <Template name=centerpointmark>
-  <Pawn camerapositiontemplate=centerpointmarkcamera>
+  <Pawn team=1 camerapositiontemplate=centerpointmarkcamera>
     <attached>
       <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->
@@ -70,5 +72,5 @@
 
     <!-- Spawns the camera, attached to a crate -->
-    <SpawnPoint team=0 position="0,0,0" spawnclass=Pawn pawndesign=centerpointmark />
+    <SpawnPoint team=1 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 /-->
 
@@ -76,25 +78,9 @@
     <!--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>
+    <StaticEntity team =1 position=0,0,0>
 
         <attached>
@@ -132,7 +118,7 @@
     direction="0,0,0"
     collisionType=dynamic
-    mass=100000>
-
-    </TowerDefenseCenterpoint>
+    mass=100000
+    team=1
+    />
 
   </Scene>
Index: code/trunk/data/overlays/DodgeRaceHUD.oxo
===================================================================
--- code/trunk/data/overlays/DodgeRaceHUD.oxo	(revision 10258)
+++ code/trunk/data/overlays/DodgeRaceHUD.oxo	(revision 10258)
@@ -0,0 +1,38 @@
+<Template name="spectatorhud">
+  <OverlayGroup name = "spectatorhud" scale = "1, 1">
+  </OverlayGroup>
+</Template>
+
+<Template name="DodgeRaceHUD">
+  <OverlayGroup name="DodgeRaceHUD" 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   = "Points: "
+    />
+
+    <DodgeRaceHUDinfo
+     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"
+
+     showpoints     = true
+    />
+
+    
+  </OverlayGroup>
+</Template>
+
+<Template name="spaceshiphud">
+  <OverlayGroup name = "spaceshiphud" scale = "1, 1">
+    
+ </OverlayGroup>
+</Template>
Index: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo	(revision 10257)
+++ code/trunk/data/overlays/HUDTemplates3.oxo	(revision 10258)
@@ -82,5 +82,5 @@
      background        = "Orxonox/HealthBarBackground"
      size              = "0.35, 0.0875"
-     position          = "1.0 , 0.1 "
+     position          = "1 ,0.1"
      pickpoint         = "1, 1"
      bartexture        = "healthbar_bar.png"
Index: code/trunk/data/overlays/towerdefenseHUD.oxo
===================================================================
--- code/trunk/data/overlays/towerdefenseHUD.oxo	(revision 10257)
+++ code/trunk/data/overlays/towerdefenseHUD.oxo	(revision 10258)
@@ -1,6 +1,10 @@
 <Template name="TowerDefenseHUD">
+
+
   <OverlayGroup name="TowerDefenseHUD" scale = "1, 1">
+  
+  
     <OverlayText
-     position  = "0.05, 0.05"
+     position  = "0.83, 0.05"
      pickpoint = "0.0, 0.0"
      font      = "ShareTechMono"
@@ -9,6 +13,70 @@
      align     = "left"
 
-     caption = "Hello World"
+     caption = "Cash:"
     />
+    
+    
+     <TowerDefenseHUDController
+     position  = "0.88, 0.10"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+		showlives = false
+		showcredits = true
+		showwaves = false
+    />
+    
+        <OverlayText
+     position  = "0.83, 0.22"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     caption = "Lifes:"
+    />
+    
+         <TowerDefenseHUDController
+     position  = "0.88, 0.27"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+		showlives = true
+		showcredits = false
+		showwaves = false
+    />
+    
+            <OverlayText
+     position  = "0.83, 0.39"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     caption = "Waves:"
+    />
+    
+         <TowerDefenseHUDController
+     position  = "0.88, 0.44"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+     	showlives = false
+		showcredits = false
+		showwaves = true
+
+    />
+    
+    
   </OverlayGroup>
 </Template>
+
+
Index: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt	(revision 10257)
+++ code/trunk/src/modules/CMakeLists.txt	(revision 10258)
@@ -41,2 +41,4 @@
 ADD_SUBDIRECTORY(invader)
 ADD_SUBDIRECTORY(jump)
+ADD_SUBDIRECTORY(mini4dgame)
+ADD_SUBDIRECTORY(dodgerace)
Index: code/trunk/src/modules/dodgerace/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/dodgerace/CMakeLists.txt	(revision 10258)
+++ code/trunk/src/modules/dodgerace/CMakeLists.txt	(revision 10258)
@@ -0,0 +1,17 @@
+SET_SOURCE_FILES(Dodgerace_SRC_FILES
+DodgeRace.cc
+DodgeRaceCenterPoint.cc
+DodgeRaceShip.cc
+DodgeRaceCube.cc
+DodgeRaceHUDinfo.cc
+)
+
+ORXONOX_ADD_LIBRARY(dodgerace
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+    overlays
+    weapons
+  SOURCE_FILES ${Dodgerace_SRC_FILES}
+)
Index: code/trunk/src/modules/dodgerace/DodgeRace.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.cc	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRace.cc	(revision 10258)
@@ -0,0 +1,231 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRace.cc
+    @brief Implementation of the DodgeRace class.
+*/
+
+#include "DodgeRace.h"
+#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
+#include "DodgeRaceCube.h"
+
+namespace orxonox
+{
+    RegisterUnloadableClass(DodgeRace);
+
+    DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
+    {
+        RegisterObject(DodgeRace);
+        init();
+        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+        this->center_ = 0;
+
+        this->setHUDTemplate("DodgeRaceHUD");
+    }
+
+    void DodgeRace::init()
+    {
+        bEndGame = false;
+        lives = 1;
+        level = 1;
+        point = 0;
+        bShowLevel = false;
+        multiplier = 1;
+        b_combo = false;
+        counter = 5000;
+        pattern = 1;
+        lastPosition = 0;
+        // spawn enemy every 3.5 seconds
+        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
+        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
+    }
+
+    void DodgeRace::levelUp()
+    {
+        level++;
+        if (getPlayer() != NULL)
+        {
+            for (int i = 0; i < 7; i++)
+            {
+                WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
+                chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
+                chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
+                chunk->setScale(20);
+            }
+        }
+        addPoints(multiplier * 42);
+        multiplier *= 2;
+        toggleShowLevel();
+        showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
+    }
+
+    void DodgeRace::tick(float dt)
+    {
+        if (getPlayer() != NULL)
+        {
+            //WeakPtr<DodgeRaceShip> ship = getPlayer();
+
+            currentPosition = getPlayer()->getWorldPosition().x;
+            counter = counter + (currentPosition - lastPosition);
+            lastPosition = currentPosition;
+            point = (int) currentPosition;
+            getPlayer()->speed = 830.0f - (point / 1000);
+
+            for(unsigned int i=0; i < cubeList.size();i++)
+            {
+                if(cubeList.at(i)->getPosition().x < currentPosition-3000)
+                {
+                    cubeList.at(i)->destroy();
+                    cubeList.erase(cubeList.begin()+i);
+                }
+            }
+
+            if(counter >= 3000)
+            {
+                counter = 0;
+                for(int i = 0; i<6; i++)
+                {
+                    WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
+                    cubeList.push_back(cube);
+                    switch(pattern)
+                    {
+                    case 1: cube->addTemplate("DodgeRaceCube01");
+                    break;
+                    case 2: cube->addTemplate("DodgeRaceCube02");
+                    break;
+
+                    }
+
+                    cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000.0f, 0.0f, -3600.0f + (i*1200)));
+                    //stEntity->setScale3D(50,50,50);
+                }
+
+
+                pattern %= 2;
+                pattern ++;
+
+            }
+
+        }
+        SUPER(DodgeRace, tick, dt);
+    }
+
+    WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
+    {
+        if (player == NULL)
+        {
+            for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
+            {
+                player = *it;
+            }
+        }
+        return player;
+    }
+
+    void DodgeRace::costLife()
+    {
+        //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
+        lives = 0;
+    };
+
+    void DodgeRace::comboControll()
+    {
+        if (b_combo)
+            multiplier++;
+        // if no combo was performed before, reset multiplier
+        else
+            multiplier = 1;
+        b_combo = false;
+    }
+
+    void DodgeRace::start()
+    {
+        orxout() << "start" << endl;
+        init();
+        for(unsigned int i=0; i< cubeList.size();i++)
+        {
+            cubeList.at(i)->destroy();
+            cubeList.erase(cubeList.begin()+i);
+
+        }
+        cubeList.clear();
+        // Set variable to temporarily force the player to spawn.
+        this->bForceSpawn_ = false;
+
+        if (this->center_ == NULL)  // abandon mission!
+        {
+            orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
+            GSLevel::startMainMenu();
+            return;
+        }
+        // Call start for the parent class.
+        Deathmatch::start();
+    }
+
+    void DodgeRace::playerPreSpawn(PlayerInfo* player)
+    {
+        if(lives <= 0)
+        {
+            this->end();
+        }
+
+        // Reset all the cubes
+        /*
+        orxout() << "prespawn" << endl;
+        init();
+        for(int i=0; i< cubeList.size();i++)
+        {
+            cubeList.at(i)->destroy();
+            cubeList.erase(cubeList.begin()+i);
+        }
+        cubeList.clear();
+        lives = 1;
+        point = 0;
+        lastPosition = 0;
+        */
+    }
+
+    void DodgeRace::addPoints(int numPoints)
+    {
+        if (!bEndGame)
+        {
+            point += numPoints * multiplier;
+            b_combo = true;
+        }
+    }
+
+    void DodgeRace::end()
+    {
+        // DON'T CALL THIS!
+        //      Deathmatch::end();
+        // It will misteriously crash the game!
+        // Instead startMainMenu, this won't crash.
+        GSLevel::startMainMenu();
+    }
+}
Index: code/trunk/src/modules/dodgerace/DodgeRace.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRace.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRace.h	(revision 10258)
@@ -0,0 +1,149 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRace.h
+    @brief Gametype.
+    @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRace_H__
+#define _DodgeRace_H__
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+#include "DodgeRaceCenterPoint.h" // Necessary for WeakPointer??
+//#include "DodgeRaceShip.h"        DO NOT include in Header. Will cause forward declaration issues
+
+//#include "DodgeRaceHUDinfo.h"
+
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+#include <vector>
+
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "core/command/ConsoleCommand.h"
+#include "worldentities/BigExplosion.h"
+
+#include "gametypes/Deathmatch.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+    class _DodgeRaceExport DodgeRace : public Deathmatch
+    {
+       public:
+            DodgeRace(Context* context);
+
+            void init();
+
+            virtual void start();
+            virtual void end();
+
+            virtual void tick(float dt);
+
+            virtual void playerPreSpawn(PlayerInfo* player);
+
+            void levelUp();
+
+            int getLives(){return this->lives;}
+            int getLevel(){return this->level;}
+            int getPoints(){return this->point;}
+            int getMultiplier(){return this->multiplier;}
+
+            void setCenterpoint(DodgeRaceCenterPoint* center)
+                       { this->center_ = center; }
+            virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+
+            // checks if multiplier should be reset.
+            void comboControll();
+            void costLife();
+
+            bool bEndGame;
+            bool bShowLevel;
+            int lives;
+            int multiplier;
+            float counter;
+            int pattern;
+            float currentPosition;
+            float lastPosition;
+
+       private:
+            Timer endGameTimer;
+
+            WeakPtr<DodgeRaceShip> getPlayer();
+            WeakPtr<DodgeRaceShip> player;
+            std::vector<DodgeRaceCube*> cubeList;
+            void toggleShowLevel(){bShowLevel = !bShowLevel;}
+            void addPoints(int numPoints);
+
+            WeakPtr<DodgeRaceCenterPoint> center_;
+            int level;
+            int point;
+            bool b_combo;
+
+            Timer enemySpawnTimer;
+            Timer comboTimer;
+            Timer showLevelTimer;
+
+
+         /*
+
+            //void spawnEnemy();
+
+
+
+
+
+
+
+
+
+
+
+
+        private:
+
+
+
+
+            //Context* context;
+            */
+    };
+}
+
+#endif /* _DodgeRace_H__ */
Index: code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc	(revision 10258)
@@ -0,0 +1,72 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRaceCenterPoint.cc
+    @brief Implementation of the DodgeRaceCenterPoint class.
+*/
+
+#include "DodgeRaceCenterPoint.h"
+
+#include "core/CoreIncludes.h"
+
+#include "DodgeRace.h"
+
+namespace orxonox
+{
+    RegisterClass(DodgeRaceCenterPoint);
+
+    DodgeRaceCenterPoint::DodgeRaceCenterPoint(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(DodgeRaceCenterPoint);
+
+        this->checkGametype();
+    }
+
+    void DodgeRaceCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DodgeRaceCenterPoint, XMLPort, xmlelement, mode);
+    }
+
+    void DodgeRaceCenterPoint::changedGametype()
+    {
+        SUPER(DodgeRaceCenterPoint, changedGametype);
+
+        // Check, whether it's still DodgeRace.
+        this->checkGametype();
+    }
+
+    void DodgeRaceCenterPoint::checkGametype()
+    {
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
+        {
+            DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
+            DodgeRaceGametype->setCenterpoint(this);
+        }
+    }
+}
Index: code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h	(revision 10258)
@@ -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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRaceCenterPoint.h
+    @brief Declaration of the DodgeRaceCenterPoint class.
+    @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRaceCenterPoint_H__
+#define _DodgeRaceCenterPoint_H__
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+//#include "DodgeRace.h"
+//#include "DodgeRaceHUDinfo.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _DodgeRaceExport DodgeRaceCenterPoint : public StaticEntity
+    {
+        public:
+            DodgeRaceCenterPoint(Context* context); //checks whether the gametype is actually DodgeRace.
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void changedGametype(); //!< Is called when the gametype has changed.
+        private:
+            void checkGametype();
+
+    };
+}
+
+#endif /* _DodgeRaceCenterPoint_H__ */
Index: code/trunk/src/modules/dodgerace/DodgeRaceCube.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCube.cc	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCube.cc	(revision 10258)
@@ -0,0 +1,46 @@
+/*   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:
+ *      Samuel Riedel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRace.cc
+    @brief Implementation of the DodgeRace class.
+*/
+
+#include "DodgeRaceCube.h"
+#include "DodgeRace.h"
+
+namespace orxonox
+{
+    RegisterClass(DodgeRaceCube);
+
+    DodgeRaceCube::DodgeRaceCube(Context* context) : MovableEntity(context)
+    {
+        RegisterObject(DodgeRaceCube);
+    }
+
+
+}
Index: code/trunk/src/modules/dodgerace/DodgeRaceCube.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceCube.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceCube.h	(revision 10258)
@@ -0,0 +1,54 @@
+/*
+ *   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:
+ *      Samuel Riedel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRace.h
+    @brief Gametype.
+    @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRaceCube_H__
+#define _DodgeRaceCube_H__
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+    class _DodgeRaceExport DodgeRaceCube : public MovableEntity
+    {
+       public:
+            DodgeRaceCube(Context* context);
+
+       private:
+    };
+}
+
+#endif /* _DodgeRaceCube_H__ */
Index: code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc	(revision 10258)
@@ -0,0 +1,91 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *
+ */
+
+#include "DodgeRaceHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+//#include "DodgeRace.h"
+
+namespace orxonox
+{
+    RegisterClass(DodgeRaceHUDinfo);
+
+    DodgeRaceHUDinfo::DodgeRaceHUDinfo(Context* context) : OverlayText(context)
+    {
+        RegisterObject(DodgeRaceHUDinfo);
+
+        this->DodgeRaceGame = 0;
+        this->bShowPoints_ = true;
+    }
+
+    void DodgeRaceHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DodgeRaceHUDinfo, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DodgeRaceHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
+    }
+
+    void DodgeRaceHUDinfo::tick(float dt)
+    {
+        SUPER(DodgeRaceHUDinfo, tick, dt);
+
+
+        if(this->bShowPoints_)
+        {
+            const std::string& points = multi_cast<std::string>(this->DodgeRaceGame->getPoints());
+            if (this->DodgeRaceGame->lives <= 0)
+            {
+                setTextSize(0.2);
+                setPosition(Vector2(0.1, 0.02));
+                this->setCaption("Final score:\n" + points);
+                this->setColour(ColourValue(1, 0, 0, 1));
+            }
+            else
+            {
+                setTextSize(0.04);
+                setPosition(Vector2(0.14, 0.02));
+                this->setColour(ColourValue(1, 1, 1, 1));
+                this->setCaption(points);
+            }
+        }
+    }
+
+    void DodgeRaceHUDinfo::changedOwner()
+    {
+        SUPER(DodgeRaceHUDinfo, changedOwner);
+
+        if (this->getOwner() && this->getOwner()->getGametype())
+        {
+            this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
+        }
+        else
+        {
+            this->DodgeRaceGame = 0;
+        }
+    }
+}
Index: code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.h	(revision 10258)
@@ -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:
+ *      Florian Zinggeler
+ *
+ */
+
+#ifndef _DodgeRaceHUDinfo_H__
+#define _DodgeRaceHUDinfo_H__
+
+//#include "DodgeRaceShip.h"
+#include "DodgeRace.h"
+//#include "DodgeRaceCenterPoint.h"
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+    class _DodgeRaceExport DodgeRaceHUDinfo : public OverlayText, public Tickable
+    {
+     public:
+            DodgeRaceHUDinfo(Context* context);
+
+            virtual void tick(float dt);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void changedOwner();
+
+            inline void setShowPoints(bool value)
+                { this->bShowPoints_ = value; }
+            inline bool getShowPoints() const
+                { return this->bShowPoints_; }
+
+
+        private:
+            DodgeRace* DodgeRaceGame;
+            bool bShowPoints_;
+    };
+}
+#endif /* _DodgeRaceHUDinfo_H__ */
Index: code/trunk/src/modules/dodgerace/DodgeRacePrereqs.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRacePrereqs.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRacePrereqs.h	(revision 10258)
@@ -0,0 +1,81 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the DodgeRace module
+*/
+
+#ifndef _DodgeRacePrereqs_H__
+#define _DodgeRacePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(DODGERACE_STATIC_BUILD)
+#  ifdef DODGERACE_SHARED_BUILD
+#    define _DodgeRaceExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _DodgeRaceExport
+#    else
+#      define _DodgeRaceExport __declspec(dllimport)
+#    endif
+#  endif
+#  define _DodgeRacePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+#  define _DodgeRaceExport  __attribute__ ((visibility("default")))
+#  define _DodgeRacePrivate __attribute__ ((visibility("hidden")))
+#else
+#  define _DodgeRaceExport
+#  define _DodgeRacePrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class DodgeRace;
+    class DodgeRaceCenterPoint;
+    class DodgeRaceShip;
+    class DodgeRaceCube;
+    //class DodgeRaceEnemy;
+    //class DodgeRaceEnemyShooter;
+    //class DodgeRaceWeapon;
+    //class DodgeRaceWeaponEnemy;
+    //class DodgeRaceHUDinfo;
+}
+
+#endif /* _DodgeRacePrereqs_H__*/
Index: code/trunk/src/modules/dodgerace/DodgeRaceShip.cc
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceShip.cc	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceShip.cc	(revision 10258)
@@ -0,0 +1,168 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRaceShip.cc
+    @brief Implementation of the DodgeRaceShip class.
+*/
+
+#include "DodgeRaceShip.h"
+
+namespace orxonox
+{
+    RegisterClass(DodgeRaceShip);
+
+    DodgeRaceShip::DodgeRaceShip(Context* context) : SpaceShip(context)
+    {
+        RegisterObject(DodgeRaceShip);
+
+        speed = 830;
+        isFireing = false;
+        damping = 10;
+
+        // not sure if has to be zero?
+        lastTimeFront = 0;
+        lastTimeLeft = 0;
+        lastTime = 0;
+    }
+
+    void DodgeRaceShip::tick(float dt)
+    {
+        Vector3 pos = getPosition();
+
+        //Movement calculation
+        lastTimeFront += dt * damping;
+        lastTimeLeft += dt * damping;
+        lastTime += dt;
+
+        velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
+        velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
+
+        //Execute movement
+        if (this->hasLocalController())
+        {
+            float dist_y = velocity.y * dt;
+            //float dist_x = velocity.x * dt;
+            if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
+                posforeward += dist_y;
+            else
+            {
+                velocity.y = 0;
+                // restart if game ended
+/*
+                if (getGame())
+                    if (getGame()->bEndGame)
+                    {
+                        getGame()->start();
+                        return;
+                    }*/
+            }
+
+            pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+        }
+
+
+        // Camera
+        WeakPtr<Camera> camera = this->getCamera();
+        if (camera != NULL)
+        {
+            // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
+            camera->setOrientation(Vector3::UNIT_Z, Degree(0));
+        }
+
+
+
+        // bring back on track!
+        if(pos.y != 0)
+        {
+            pos.y = 0;
+        }
+
+        setPosition(pos);
+        setOrientation(Vector3::UNIT_Y, Degree(270));
+
+        // Level up!
+        if (pos.x > 42000)
+        {
+            updateLevel();
+            setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
+        }
+
+        SUPER(DodgeRaceShip, tick, dt);
+    }
+
+    void DodgeRaceShip::updateLevel()
+    {
+        lastTime = 0;
+        if (getGame())
+            getGame()->levelUp();
+    }
+
+    void DodgeRaceShip::moveFrontBack(const Vector2& value)
+    {
+        //lastTimeFront = 0;
+        //desiredVelocity.y = value.y * speed * 42;
+
+    }
+
+    void DodgeRaceShip::moveRightLeft(const Vector2& value)
+    {
+        lastTimeLeft = 0;
+        desiredVelocity.x = value.x * speed;
+    }
+    void DodgeRaceShip::boost(bool bBoost)
+    {
+        //getGame()->bEndGame = bBoost;
+    }
+
+    inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    {
+
+        removeHealth(100);
+        this->death();
+        return false;
+    }
+
+    WeakPtr<DodgeRace> DodgeRaceShip::getGame()
+    {
+        if (game == NULL)
+        {
+            for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
+            {
+                game = *it;
+            }
+        }
+        return game;
+    }
+
+    void DodgeRaceShip::death()
+    {
+        getGame()->costLife();
+        SpaceShip::death();
+    }
+}
Index: code/trunk/src/modules/dodgerace/DodgeRaceShip.h
===================================================================
--- code/trunk/src/modules/dodgerace/DodgeRaceShip.h	(revision 10258)
+++ code/trunk/src/modules/dodgerace/DodgeRaceShip.h	(revision 10258)
@@ -0,0 +1,97 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRaceShip.h
+    @brief Declaration of the DodgeRaceShip class.
+*/
+
+#ifndef _DodgeRaceShip_H__
+#define _DodgeRaceShip_H__
+
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
+#include "weapons/projectiles/Projectile.h"
+
+#include "DodgeRace.h" // Is necessary for getGame function
+//#include "DodgeRaceCenterPoint.h"
+
+namespace orxonox
+{
+    class _DodgeRaceExport DodgeRaceShip : public SpaceShip
+    {
+        public:
+            DodgeRaceShip(Context* context);
+
+            virtual void tick(float dt);
+
+            // overwrite for 2d movement
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+
+            // Starts or stops fireing
+            virtual void boost(bool bBoost);
+
+            //no rotation!
+            virtual void rotateYaw(const Vector2& value){};
+            virtual void rotatePitch(const Vector2& value){};
+
+            //return to main menu if game has ended.
+            virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
+
+            virtual void updateLevel();
+
+            float speed, damping, posforeward;
+            bool isFireing;
+
+        protected:
+            virtual void death();
+
+        private:
+            virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            WeakPtr<DodgeRace> getGame();
+            WeakPtr<DodgeRace> game;
+            WeakPtr<Projectile> lastShot;
+            WeakPtr<WorldEntity> lastEntity;
+            Camera* camera;
+            float lastTimeFront, lastTimeLeft, lastTime;
+            struct Velocity
+            {
+                float x;
+                float y;
+            } velocity, desiredVelocity;
+
+    };
+}
+
+#endif /* _DodgeRaceShip_H__ */
Index: code/trunk/src/modules/mini4dgame/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/mini4dgame/CMakeLists.txt	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/CMakeLists.txt	(revision 10258)
@@ -0,0 +1,14 @@
+SET_SOURCE_FILES(Mini4Dgame_SRC_FILES
+  Mini4Dgame.cc
+  #Mini4DgameAI.cc
+  Mini4DgameBoard.cc
+)
+
+ORXONOX_ADD_LIBRARY(mini4dgame
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+    overlays
+  SOURCE_FILES ${Mini4Dgame_SRC_FILES}
+)
Index: code/trunk/src/modules/mini4dgame/Mini4Dgame.cc
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10258)
@@ -0,0 +1,201 @@
+/*
+ *   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:
+ *      Johannes Ritz
+ *
+ *
+ *
+ *
+ *TASK c) end the game in a nicer way
+ *TASK d) save the highscore
+ *TASK e) eye candy
+ */
+
+/**
+    @file Tetris.cc
+    @brief Implementation of the Mini4Dgame class.
+*/
+
+#include "Mini4Dgame.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "infos/PlayerInfo.h"
+#include "core/command/ConsoleCommand.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+
+namespace orxonox
+{
+
+    SetConsoleCommand("Mini4Dgame", "setStone", &Mini4Dgame::setStone).addShortcut();
+    SetConsoleCommand("Mini4Dgame", "undoStone", &Mini4Dgame::undoStone).addShortcut();
+
+    RegisterUnloadableClass(Mini4Dgame);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4Dgame::Mini4Dgame(Context* context) : Deathmatch(context)
+    {
+        RegisterObject(Mini4Dgame);
+
+        this->board_ = 0;
+
+        // Set the type of Bots for this particular Gametype.
+        //this->botclass_ = Class(Mini4DgameBot);
+    }
+
+    /**
+    @brief
+        Destructor. Cleans up, if initialized.
+    */
+    Mini4Dgame::~Mini4Dgame()
+    {
+        if (this->isInitialized())
+            this->cleanup();
+    }
+
+    /**
+    @brief
+        Cleans up the Gametype.
+    */
+    void Mini4Dgame::cleanup()
+    {
+        if(this->board_ != NULL)// Destroy the board, if present.
+        {
+            //this->board_->destroy();
+            this->board_ = 0;
+        }
+    }
+
+    /**
+    @brief
+        Starts the mini4Dgame.
+    */
+    void Mini4Dgame::start()
+    {
+        if (this->board_ != NULL) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.
+        {
+            /*
+            if (this->board_ == NULL)
+            {
+                this->board_ = new Mini4DgameBoard(this->board_->getContext());
+                // Apply the template for the ball specified by the centerpoint.
+                this->board_->addTemplate(this->center_->getBoardtemplate());
+            }
+            */
+
+            // Attach the board to the centerpoint and set the parameters as specified in the centerpoint, the ball is attached to.
+
+            this->board_->setPosition(0, 0, 0);
+
+        }
+        else // If no centerpoint was specified, an error is thrown and the level is exited.
+        {
+            orxout(internal_error) << "Mini4Dgame: No Centerpoint specified." << endl;
+            GSLevel::startMainMenu();
+            return;
+        }
+
+        // Set variable to temporarily force the player to spawn.
+        bool temp = this->bForceSpawn_;
+        this->bForceSpawn_ = true;
+
+        // Call start for the parent class.
+        Deathmatch::start();
+
+        // Reset the variable.
+        this->bForceSpawn_ = temp;
+    }
+
+    /**
+    @brief
+        Ends the Mini4Dgame minigame.
+    */
+    void Mini4Dgame::end()
+    {
+        this->cleanup();
+
+        // Call end for the parent class.
+        Deathmatch::end();
+    }
+
+
+    /**
+    @brief
+        Spawns player.
+    */
+    void Mini4Dgame::spawnPlayersIfRequested()
+    {
+        // first spawn human players to assign always the left bat to the player in singleplayer
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
+                this->spawnPlayer(it->first);
+        // now spawn bots
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (!it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
+                this->spawnPlayer(it->first);
+    }
+
+    /**
+    @brief
+        Spawns the input player.
+    @param player
+        The player to be spawned.
+    */
+    void Mini4Dgame::spawnPlayer(PlayerInfo* player)
+    {
+        assert(player);
+
+        if(false)//this->player_ == NULL)
+        {
+            //this->player_ = player;
+            this->players_[player].state_ = PlayerState::Alive;
+        }
+    }
+
+    void Mini4Dgame::undoStone()//Vector4 move, const int playerColor)
+    {
+        ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
+        it->undoMove();
+    }
+
+    //void Mini4Dgame::setStone(Vector4 move, const int playerColor, Mini4DgameBoard* board)
+    void Mini4Dgame::setStone(int x,int y,int z,int w)//Vector4 move, const int playerColor)
+    {
+        Mini4DgamePosition move = Mini4DgamePosition(x,y,z,w);
+        ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
+        it->makeMove(move);
+    }
+
+    void Mini4Dgame::win(Mini4DgameWinner winner)
+    {
+
+    }
+}
Index: code/trunk/src/modules/mini4dgame/Mini4Dgame.h
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4Dgame.h	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4Dgame.h	(revision 10258)
@@ -0,0 +1,97 @@
+/*
+ *   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 Mini4Dgame.h
+    @brief Declaration of the Mini4Dgame class.
+*/
+
+#ifndef _Mini4Dgame_H__
+#define _Mini4Dgame_H__
+
+#include "gametypes/Deathmatch.h"
+#include "mini4dgame/Mini4DgamePrereqs.h"
+#include "Mini4DgameBoard.h"
+
+namespace orxonox
+{
+
+    namespace mini4DgamePlayerColor
+    {
+        enum color
+        {
+            none,
+            red,
+            blue,
+            green
+        };
+    }
+
+    /**
+    @brief
+
+    @author
+
+    */
+    class _Mini4DgameExport Mini4Dgame : public Deathmatch
+    {
+        public:
+            Mini4Dgame(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~Mini4Dgame(); //!< Destructor. Cleans up, if initialized.
+
+            virtual void start(void); //!< Starts the Mini4Dgame minigame.
+            virtual void end(void); ///!< Ends the Mini4Dgame minigame.
+
+            virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
+
+            void setGameboard(Mini4DgameBoard* board)
+                { this->board_ = board; }
+
+            Mini4DgameBoard* getBoard(void)
+                { return this->board_; }
+
+            static void undoStone();
+
+            //static void setStone(Vector4 move, const int playerColor, Mini4DgameBoard* board);
+            static void setStone(int x,int y, int z, int w);//Vector4 move, const int playerColor);
+
+            void win(Mini4DgameWinner winner);
+
+        protected:
+            virtual void spawnPlayersIfRequested(); //!< Spawns player.
+
+
+        private:
+            void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
+
+            //Player players[2];
+            Mini4DgameBoard* board_;
+    };
+}
+
+#endif /* _Mini4Dgame_H__ */
Index: code/trunk/src/modules/mini4dgame/Mini4DgameAI.cc
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameAI.cc	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameAI.cc	(revision 10258)
@@ -0,0 +1,126 @@
+/*
+ *   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 Mini4DgameAI.cc
+    @brief Implementation of the Mini4DgameAI class.
+*/
+
+#include "Mini4DgameAI.h"
+
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/command/Executor.h"
+#include "tools/Timer.h"
+
+#include <list>
+
+#include "worldentities/ControllableEntity.h"
+
+#include "Mini4DgameCenterpoint.h"
+
+namespace orxonox
+{
+    RegisterUnloadableClass(Mini4DgameAI);
+
+    //const static float MAX_REACTION_TIME = 0.4f;
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4DgameAI::Mini4DgameAI(Context* context) : Controller(context)
+    {
+        RegisterObject(Mini4DgameAI);
+
+        this->setConfigValues();
+        this->center_ = 0;
+    }
+
+    /**
+    @brief
+        Destructor. Cleans up the list fo reaction timers.
+    */
+    Mini4DgameAI::~Mini4DgameAI()
+    {
+
+    }
+
+    Vector4 Mini4DgameAI::makeMove(float timeout)
+    {
+        this->copyBoard();
+        std::list<Vector4> possibleMoves = this->getPossibleMoves();
+
+        //TODO: alphabeta ueber possibleMoves
+
+        //when timeout
+        Vector4 move = possibleMoves.front();
+        return move;
+    }
+
+    void Mini4DgameAI::copyBoard()
+    {
+        for(int i=0;i<4;i++){
+            for(int j=0;j<4;j++){
+                for(int k=0;k<4;k++){
+                    for(int l=0;l<4;l++){
+                        this->board_[i][j][k][l]=this->center_->board[i][j][k][l];
+                    }
+                }
+            }
+        }
+    }
+
+    std::list<Vector4> Mini4DgameAI::getPossibleMoves()
+    {
+        std::list<Vector4> possibleMoves = new std::list<Vector4>;
+        for(int i=0;i<4;i++){
+            for(int j=0;j<4;j++){
+                for(int k=0;k<4;k++){
+                    for(int l=0;l<4;l++){
+                        if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
+                            possibleMoves.push_back(Vector4(i,j,k,l));
+                    }
+                }
+            }
+        }
+        return possibleMoves;
+    }
+
+    /**
+    @brief
+        Is called each tick.
+        Implements the behavior of the PongAI (i.e. its intelligence).
+    @param dt
+        The time that has elapsed since the last tick.
+    */
+    void Mini4DgameAI::tick(float dt)
+    {
+
+    }
+}
Index: code/trunk/src/modules/mini4dgame/Mini4DgameAI.h
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameAI.h	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameAI.h	(revision 10258)
@@ -0,0 +1,94 @@
+/*
+ *   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 Mini4DgameAI.h
+    @brief Declaration of the Mini4DgameAI class.
+*/
+
+#ifndef _Mini4DgameAI_H__
+#define _Mini4DgameAI_H__
+
+#include "mini4dgame/Mini4DgamePrereqs.h"
+
+#include <list>
+
+#include "tools/interfaces/Tickable.h"
+
+#include "controllers/Controller.h"
+#include "Mini4DgameCenterpoint.h"
+#include "Mini4Dgame.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The Mini4DgameAI is an artificial intelligence for the @ref orxonox::Mini4Dgame "Mini4Dgame" gametype.
+
+    @author
+        Oliver Richter
+    */
+    class _Mini4DgameExport Mini4DgameAI : public Controller, public Tickable
+    {
+        public:
+            Mini4DgameAI(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~Mini4DgameAI();
+
+            //void setConfigValues();
+
+            /**
+                @brief
+                    starts the AI to make a move. implements the intelligence of the AI
+                @param timeout
+                    The time the AI has to decide on a move. (Sets the strength of the AI)
+                @return move
+                    The move that the AI decided to make.
+            */
+            Vector4 makeMove(float timeout);
+
+
+            virtual void tick(float dt);
+
+            void setCenterpoint(Mini4DgameCenterpoint* center)
+                            { this->center_ = center; }
+
+        protected:
+
+            std::list<std::pair<Timer*, char> > reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
+            Mini4DgameCenterpoint* center_;
+
+        private:
+
+            std::list<Vector4> getPossibleMoves();
+            void copyBoard();
+            mini4DgamePlayerColor::color board_[4][4][4][4];
+    };
+}
+
+#endif /* _Mini4DgameAI_H__ */
Index: code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10258)
@@ -0,0 +1,925 @@
+/*
+ *   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 PongBall.cc
+    @brief Implementation of the PongBall class.
+*/
+
+#include "Mini4DgameBoard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+
+#include "gametypes/Gametype.h"
+#include "graphics/BlinkingBillboard.h"
+
+#include "core/XMLPort.h"
+
+#include "Mini4Dgame.h"
+
+namespace orxonox
+{
+    RegisterClass(Mini4DgameBoard);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4DgameBoard::Mini4DgameBoard(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(Mini4DgameBoard);
+
+        //this->registerVariables();
+
+        //initialize board
+        for(int i=0;i<4;i++){
+            for(int j=0;j<4;j++){
+                for(int k=0;k<4;k++){
+                    for(int l=0;l<4;l++){
+                        this->board[i][j][k][l]=mini4DgamePlayerColor::none;
+                        this->blinkingBillboards[i][j][k][l] = 0;
+                    }
+                }
+            }
+        }
+        this->player_toggle_ = false;
+        this->checkGametype();
+    }
+
+
+    //xml port for loading sounds
+    void Mini4DgameBoard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Mini4DgameBoard, XMLPort, xmlelement, mode);
+    }
+
+    /**
+        @brief checks if the move is valid
+        @param the position where to put the stone plus the player who makes the move
+    */
+    bool Mini4DgameBoard::isValidMove(const Mini4DgamePosition& move)
+    {
+        return (move.x<4 && move.y<4 && move.z<4 && move.w<4
+                && move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0
+                && this->board[move.x][move.y][move.z][move.w] == mini4DgamePlayerColor::none);
+    }
+
+    void Mini4DgameBoard::undoMove()
+    {
+        const Mini4DgamePosition& move = moves.back();
+        moves.pop_back();
+        this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;
+        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
+        this->blinkingBillboards[move.x][move.y][move.z][move.w] = 0;
+        if(player_toggle_){
+            this->player_toggle_ = false;
+        }else{
+            this->player_toggle_ = true;
+        }
+    }
+
+    /**
+    @brief makes a move on the logic playboard
+    @param the position where to put the stone plus the player who makes the move
+    */
+    void Mini4DgameBoard::makeMove(const Mini4DgamePosition& move)
+    {
+        if(this->isValidMove(move))
+        {
+            if(!moves.empty())
+            {
+                //stop blinking of last move
+                const Mini4DgamePosition& lastMove = moves.back();
+                this->blinkingBillboards[lastMove.x][lastMove.y][lastMove.z][lastMove.w]
+                        ->setActive(false);
+                this->blinkingBillboards[lastMove.x][lastMove.y][lastMove.z][lastMove.w]
+                        ->setScale(0.1);
+            }
+
+            moves.push_back(move);
+            mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;
+            if(player_toggle_){
+                playerColor = mini4DgamePlayerColor::blue;
+                this->player_toggle_ = false;
+            }else{
+                playerColor = mini4DgamePlayerColor::green;
+                this->player_toggle_ = true;
+            }
+
+            this->board[move.x][move.y][move.z][move.w] = (mini4DgamePlayerColor::color) playerColor;
+
+            BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
+            bb->setFrequency(0.3);
+            bb->setAmplitude(0.1);
+
+            switch(move.w){
+            case 0: bb->setMaterial("Numbers/One");
+                    bb->setPosition(60.0f*move.x-95,60.0f*move.y-95,60.0f*move.z-95);
+                    break;
+            case 1: bb->setMaterial("Numbers/Two");
+                    bb->setPosition(60.0f*move.x-85,60.0f*move.y-85,60.0f*move.z-95);
+                    break;
+            case 2: bb->setMaterial("Numbers/Three");
+                    bb->setPosition(60.0f*move.x-85,60.0f*move.y-95,60.0f*move.z-85);
+                    break;
+            case 3: bb->setMaterial("Numbers/Four");
+                    bb->setPosition(60.0f*move.x-85,60.0f*move.y-85,60.0f*move.z-85);
+                    break;
+            }
+
+            switch(playerColor){
+            case mini4DgamePlayerColor::red:
+                bb->setColour(ColourValue(1,0,0)); break;
+            case mini4DgamePlayerColor::green:
+                bb->setColour(ColourValue(0,1,0)); break;
+            case mini4DgamePlayerColor::blue:
+                bb->setColour(ColourValue(0,0,1)); break;
+            default: break;
+            }
+
+            this->attach(bb);
+            this->blinkingBillboards[move.x][move.y][move.z][move.w] = bb;
+
+
+            Mini4DgameWinner winner = this->getWinner();
+            if(winner.color_ != mini4DgamePlayerColor::none)
+            {
+                orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
+                for(int i=0;i<4;i++){
+                    BlinkingBillboard* redFlare = new BlinkingBillboard(this->getContext());
+                    redFlare->setFrequency(0.5);
+                    redFlare->setAmplitude(3);
+                    redFlare->setPosition(60.0f*(int)winner.winningRow[i]-90,
+                                    60.0f*(int)winner.winningColumn[i]-90,
+                                    60.0f*(int)winner.winningHeight[i]-90);
+                    redFlare->setMaterial("Flares/lensflare");
+                    redFlare->setColour(ColourValue(1,0,0));
+                    this->attach(redFlare);
+                    BlinkingBillboard* bb = this->blinkingBillboards[winner.winningRow[i]]
+                                                                    [winner.winningColumn[i]]
+                                                                    [winner.winningHeight[i]]
+                                                                    [winner.winningNumber[i]];
+                    bb->setActive(true);//start blinking
+                }
+            }
+        }else{
+            orxout(internal_error) << "Mini4Dgame: not a valid move"<< endl;
+        }
+    }
+
+    Mini4DgameWinner Mini4DgameBoard::getWinner()
+    {
+        Mini4DgameWinner winner;
+        winner.color_ = mini4DgamePlayerColor::none;
+
+        //check diagonals rows-columns-height-numbers
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[i][i][i][i]==mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[0][0][0][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[3-i][i][i][i]==mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[3][0][0][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = 3-x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[0][3][0][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = x;
+                    winner.winningColumn[x] = 3-x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[0][0][3][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = 3-x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[0][0][0][3];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = 3-x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[3-i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[3][3][0][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = 3-x;
+                    winner.winningColumn[x] = 3-x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[3-i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[3][0][3][0];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = 3-x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = 3-x;
+                    winner.winningNumber[x] = x;
+                }
+                return winner;
+            }
+        }
+        for(int i=1; i<4; i++)
+        {
+            if(this->board[3-i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
+                break;
+            if(i==3)
+            {
+                winner.color_ = this->board[3][0][0][3];
+                for(int x=0; x<4; x++){
+                    winner.winningRow[x] = 3-x;
+                    winner.winningColumn[x] = x;
+                    winner.winningHeight[x] = x;
+                    winner.winningNumber[x] = 3-x;
+                }
+                return winner;
+            }
+        }
+
+        //check diagonals rows-columns-height
+        for(int l=0; l<4; l++)
+        {
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][i][i][l]==mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][0][0][l];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = l;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[3-i][i][i][l]==mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[3][0][0][l];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = 3-x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = l;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][3-i][i][l]==mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][3][0][l];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = 3-x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = l;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][i][3-i][l]==mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][0][3][l];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = 3-x;
+                        winner.winningNumber[x] = l;
+                    }
+                    return winner;
+                }
+            }
+        }
+
+        //check diagonals rows-columns-numbers
+        for(int l=0; l<4; l++)
+        {
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][i][l][i]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][0][l][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = l;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[3-i][i][l][i]==mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[3][0][l][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = 3-x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = l;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][3-i][l][i]==mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][3][l][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = 3-x;
+                        winner.winningHeight[x] = l;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][i][l][3-i]==mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][0][l][3];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = l;
+                        winner.winningNumber[x] = 3-x;
+                    }
+                    return winner;
+                }
+            }
+        }
+
+        //check diagonals rows-height-numbers
+        for(int l=0; l<4; l++)
+        {
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][l][i][i]==mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][l][0][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = l;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[3-i][l][i][i]==mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[3][l][0][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = 3-x;
+                        winner.winningColumn[x] = l;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][l][3-i][i]==mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][l][3][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = l;
+                        winner.winningHeight[x] = 3-x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[i][l][i][3-i]==mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[0][l][0][3];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = x;
+                        winner.winningColumn[x] = l;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = 3-x;
+                    }
+                    return winner;
+                }
+            }
+        }
+
+        //check diagonals columns-height-numbers
+        for(int l=0; l<4; l++)
+        {
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[l][i][i][i]==mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[l][0][0][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = l;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[l][3-i][i][i]==mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[l][3][0][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = l;
+                        winner.winningColumn[x] = 3-x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[l][i][3-i][i]==mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[l][0][3][0];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = l;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = 3-x;
+                        winner.winningNumber[x] = x;
+                    }
+                    return winner;
+                }
+            }
+            for(int i=1; i<4; i++)
+            {
+                if(this->board[l][i][i][3-i]==mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
+                    break;
+                if(i==3)
+                {
+                    winner.color_ = this->board[l][0][0][3];
+                    for(int x=0; x<4; x++){
+                        winner.winningRow[x] = l;
+                        winner.winningColumn[x] = x;
+                        winner.winningHeight[x] = x;
+                        winner.winningNumber[x] = 3-x;
+                    }
+                    return winner;
+                }
+            }
+        }
+
+        //check 2d diagonals
+        for(int k=0;k<4;k++){
+            for(int l=0;l<4;l++){
+                //rows-columns
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[0][0][k][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = x;
+                            winner.winningColumn[x] = x;
+                            winner.winningHeight[x] = k;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[3-i][i][k][l]==mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[3][0][k][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = 3-x;
+                            winner.winningColumn[x] = x;
+                            winner.winningHeight[x] = k;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                //rows-height
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[i][k][i][l]==mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[0][k][0][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = x;
+                            winner.winningColumn[x] = k;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[3-i][k][i][l]==mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[3][k][0][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = 3-x;
+                            winner.winningColumn[x] = k;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                //rows-numbers
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[i][k][l][i]==mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[0][k][l][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = x;
+                            winner.winningColumn[x] = k;
+                            winner.winningHeight[x] = l;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[3-i][k][l][i]==mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[3][k][l][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = 3-x;
+                            winner.winningColumn[x] = k;
+                            winner.winningHeight[x] = l;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+                //column-height
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][i][i][l]==mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][0][0][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = x;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][3-i][i][l]==mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][3][0][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = 3-x;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+                //column-numbers
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][i][l][i]==mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][0][l][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = x;
+                            winner.winningHeight[x] = l;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][3-i][l][i]==mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][3][l][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = 3-x;
+                            winner.winningHeight[x] = l;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+                //height-numbers
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][l][i][i]==mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][l][0][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = l;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+                for(int i=1; i<4; i++)
+                {
+                    if(this->board[k][l][3-i][i]==mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
+                        break;
+                    if(i==3)
+                    {
+                        winner.color_ = this->board[k][l][3][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = k;
+                            winner.winningColumn[x] = l;
+                            winner.winningHeight[x] = 3-x;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+            }
+        }
+
+        //check rows
+        for(int j=0;j<4;j++){
+            for(int k=0;k<4;k++){
+                for(int l=0;l<4;l++){
+                    if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none
+                       && this->board[0][j][k][l]==this->board[1][j][k][l]
+                       && this->board[1][j][k][l]==this->board[2][j][k][l]
+                       && this->board[2][j][k][l]==this->board[3][j][k][l])
+                    {
+                        winner.color_ = this->board[0][j][k][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = x;
+                            winner.winningColumn[x] = j;
+                            winner.winningHeight[x] = k;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+            }
+        }
+
+        //check columns
+        for(int i=0;i<4;i++){
+            for(int k=0;k<4;k++){
+                for(int l=0;l<4;l++){
+                    if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none
+                               && this->board[i][0][k][l]==this->board[i][1][k][l]
+                               && this->board[i][1][k][l]==this->board[i][2][k][l]
+                               && this->board[i][2][k][l]==this->board[i][3][k][l])
+                    {
+                        winner.color_ = this->board[i][0][k][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = i;
+                            winner.winningColumn[x] = x;
+                            winner.winningHeight[x] = k;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+            }
+        }
+
+        //check height
+        for(int i=0;i<4;i++){
+            for(int j=0;j<4;j++){
+                for(int l=0;l<4;l++){
+                    if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none
+                                       && this->board[i][j][0][l]==this->board[i][j][1][l]
+                                       && this->board[i][j][1][l]==this->board[i][j][2][l]
+                                       && this->board[i][j][2][l]==this->board[i][j][3][l])
+                    {
+                        winner.color_ = this->board[i][j][0][l];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = i;
+                            winner.winningColumn[x] = j;
+                            winner.winningHeight[x] = x;
+                            winner.winningNumber[x] = l;
+                        }
+                        return winner;
+                    }
+                }
+            }
+        }
+
+        //check numbers
+        for(int i=0;i<4;i++){
+            for(int j=0;j<4;j++){
+                for(int k=0;k<4;k++){
+                    if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none
+                                       && this->board[i][j][k][0]==this->board[i][j][k][1]
+                                       && this->board[i][j][k][1]==this->board[i][j][k][2]
+                                       && this->board[i][j][k][2]==this->board[i][j][k][3])
+                    {
+                        winner.color_ = this->board[i][j][k][0];
+                        for(int x=0; x<4; x++){
+                            winner.winningRow[x] = i;
+                            winner.winningColumn[x] = j;
+                            winner.winningHeight[x] = k;
+                            winner.winningNumber[x] = x;
+                        }
+                        return winner;
+                    }
+                }
+            }
+        }
+        return winner;
+    }
+
+    /**
+    @brief
+        Is called when the gametype has changed.
+    */
+    void Mini4DgameBoard::changedGametype()
+    {
+        SUPER(Mini4DgameBoard, changedGametype);
+
+        // Check, whether it's still Mini4Dgame.
+        this->checkGametype();
+    }
+
+    /**
+    @brief
+        Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint.
+    */
+    void Mini4DgameBoard::checkGametype()
+    {
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
+        {
+            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype().get());
+            Mini4DgameGametype->setGameboard(this);
+        }
+    }
+}
Index: code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10258)
@@ -0,0 +1,95 @@
+/*
+ *   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 Mini4DgameBoard.h
+    @brief Declaration of the Mini4DgameBoard class.
+    @ingroup Pong
+*/
+
+#ifndef _Mini4DgameBoard_H__
+#define _Mini4DgameBoard_H__
+
+#include "mini4dgame/Mini4DgamePrereqs.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+
+    struct Mini4DgamePosition
+    {
+        Mini4DgamePosition(int x, int y, int z, int w) : x(x), y(y), z(z), w(w) {}
+        int x;
+        int y;
+        int z;
+        int w;
+    };
+
+    struct Mini4DgameWinner
+    {
+        int winningRow[4];
+        int winningColumn[4];
+        int winningHeight[4];
+        int winningNumber[4];
+        int color_;
+    };
+
+    /**
+    @brief
+        This class manages the board for @ref orxonox::Mini4Dgame "Mini4Dgame".
+
+    @author
+        Oliver Richter
+    */
+    class _Mini4DgameExport Mini4DgameBoard : public StaticEntity
+    {
+        public:
+            Mini4DgameBoard(Context* context);
+            //virtual ~Mini4DgameBoard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            bool isValidMove(const Mini4DgamePosition& move);
+            void undoMove();
+            void makeMove(const Mini4DgamePosition& move);
+            Mini4DgameWinner getWinner();
+
+            void changedGametype();
+            void checkGametype();
+
+        private:
+            //void registerVariables();
+            std::vector<Mini4DgamePosition> moves;
+            bool player_toggle_;
+            BlinkingBillboard* blinkingBillboards[4][4][4][4];
+            int board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
+    };
+}
+
+#endif /* _Mini4DgameBoard_H__ */
Index: code/trunk/src/modules/mini4dgame/Mini4DgamePrereqs.h
===================================================================
--- code/trunk/src/modules/mini4dgame/Mini4DgamePrereqs.h	(revision 10258)
+++ code/trunk/src/modules/mini4dgame/Mini4DgamePrereqs.h	(revision 10258)
@@ -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 mini4dgame module
+*/
+
+#ifndef _Mini4DgamePrereqs_H__
+#define _Mini4DgamePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(MINI4DGAME_STATIC_BUILD)
+#  ifdef MINI4DGAME_SHARED_BUILD
+#    define _Mini4DgameExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _Mini4DgameExport
+#    else
+#      define _Mini4DgameExport __declspec(dllimport)
+#    endif
+#  endif
+#  define _Mini4DgamePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+#  define _Mini4DgameExport  __attribute__ ((visibility("default")))
+#  define _Mini4DgamePrivate __attribute__ ((visibility("hidden")))
+#else
+#  define _Mini4DgameExport
+#  define _Mini4DgamePrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class Mini4Dgame;
+    class Mini4DgameBoard;
+}
+
+#endif /* _Mini4DgamePrereqs_H__ */
Index: code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 10257)
+++ code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 10258)
@@ -73,5 +73,5 @@
         this->position_ = Vector4(0.0, 0.0, 0.0, 0.0);
         this->alignment_ = "LeftAligned";
-        this->fontSize_ = 12;
+        this->fontSize_ = 10;
         this->fontColor_ = Vector4(1.0, 1.0, 1.0, 1.0);
         this->fontColorStr_ = "FFFFFFFF";
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 10257)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc	(revision 10258)
@@ -82,4 +82,6 @@
         this->setNavMarkerSize(0.03f);
         this->setAimMarkerSize(0.02f);
+        this->setHealthMarkerSize(0.06f);
+        this->setHealthLevelMarkerSize(0.06f);
 
         this->setDetectionLimit(10000.0f);
@@ -116,4 +118,7 @@
         XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
         XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "healthLevelMarkerSize", setHealthLevelMarkerSize, getHealthLevelMarkerSize, xmlelement, mode);
+
     }
 
@@ -206,4 +211,5 @@
         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_;
@@ -275,4 +281,6 @@
 
 
+
+
                 // Transform to screen coordinates
                 Vector3 pos = camTransform * it->first->getRVWorldPosition();
@@ -298,4 +306,6 @@
                     if (!it->second.wasOutOfView_)
                     {
+                        it->second.health_->hide();
+                        it->second.healthLevel_->hide();
                         it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
                         it->second.wasOutOfView_ = true;
@@ -357,4 +367,33 @@
                     // Object is in view
 
+
+
+
+                    //calculate the health of the actual selected radarViewable (relativHealthScale: while (0) is no health left, (1) is the initial health)
+                    Pawn* pawnPtr = (Pawn*) (it->first->getWorldEntity());
+                    float health = pawnPtr->getHealth();
+                    float initHealth = pawnPtr->getMaxHealth();
+                    float relativHealthScale = health/initHealth;
+
+                    //integer values from 0 to 10 (0 is no health and 10 is full health)
+                    int discreteHealthScale = (int)(10*relativHealthScale);
+
+                    //calculate the HealthLevel (= OponentLevel or Strength) there are 5 Levels
+                    //Level 1, Level 2,... , Level 5
+                    int HealthLevel = 1;
+
+                    if(initHealth < 200)
+                        HealthLevel = 1;
+                    if(200 <= initHealth && initHealth < 500)
+                        HealthLevel = 2;
+                    if(500 <= initHealth && initHealth < 1000)
+                        HealthLevel = 3;
+                    if(1000 <= initHealth && initHealth < 2500)
+                        HealthLevel = 4;
+                    if(2500 <= initHealth)
+                        HealthLevel = 5;
+
+
+
                     // Change material only if outOfView changed
                     if (it->second.wasOutOfView_)
@@ -364,6 +403,53 @@
                         it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
                         it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y);
+
+
+                        //it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2_1.png", it->first->getRadarObjectColour()));
+                        it->second.health_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                        it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x , 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
                         it->second.wasOutOfView_ = false;
-                    }
+
+                        // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                        // spaceship is still intact there should be at least one part of the bar left.
+                        if(1<=discreteHealthScale){
+                            it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
+                            it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
+                        }
+
+
+
+                        //healthLevel
+                        it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x , 0.75f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                        it->second.wasOutOfView_ = false;
+                        it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1f*HealthLevel, 0.25f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                    }
+
+
+
+                    // sets Position and Dimensions (amount) health
+                    it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.health_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.health_->setTop((-pos.y + 1.04f - it->second.panel_->getHeight()) * 0.5f);
+
+
+                    // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                    // spaceship is still intact there should be at least one part of the bar left.
+                    if(1<=discreteHealthScale){
+                    it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
+                    it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
+                    }
+
+
+                    //sets Position and Dimensions (level) of healthLevel
+                    it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                    it->second.healthLevel_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.healthLevel_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.healthLevel_->setTop((-pos.y + 1.125f - it->second.panel_->getHeight()) * 0.5f);
+
+                    it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                    it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1f*HealthLevel, 0.25f*this->healthLevelMarkerSize_ * this->getActualSize().y);
+
 
                     // Position marker
@@ -376,5 +462,10 @@
                     it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
 
+
+
+
                     // Make sure the overlays are shown
+                    it->second.health_->show();
+                    it->second.healthLevel_->show();
                     it->second.panel_->show();
                     it->second.text_->show();
@@ -419,4 +510,6 @@
 
             {
+                it->second.health_->hide();
+                it->second.healthLevel_->hide();
                 it->second.panel_->hide();
                 it->second.text_->hide();
@@ -442,4 +535,8 @@
         for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
         {
+            if (it->second.health_ != NULL)
+                it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+            if (it->second.healthLevel_ != NULL)
+                it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
             if (it->second.panel_ != NULL)
                 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
@@ -468,4 +565,18 @@
 
         // Create everything needed to display the object on the radar and add it to the map
+
+        // Create health
+        Ogre::PanelOverlayElement* health = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+        //panel->setColour(object->getRadarObjectColour());
+
+        // Create healthLevel
+        Ogre::PanelOverlayElement* healthLevel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthLevelMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
+
 
         // Create arrow/marker
@@ -490,4 +601,6 @@
         text->setColour(object->getRadarObjectColour());
 
+        health->hide();
+        healthLevel->hide();
         panel->hide();
         target->hide();
@@ -495,7 +608,9 @@
 
         ObjectInfo tempStruct =
-        {   panel, target, text, false, false, false};
+        {   health, healthLevel, panel, target, text, false, false, false};
         this->activeObjectList_[object] = tempStruct;
 
+        this->background_->addChild(health);
+        this->background_->addChild(healthLevel);
         this->background_->addChild(panel);
         this->background_->addChild(target);
@@ -512,8 +627,12 @@
         {
             // Detach overlays
+            this->background_->removeChild(it->second.health_->getName());
+            this->background_->removeChild(it->second.healthLevel_->getName());
             this->background_->removeChild(it->second.panel_->getName());
             this->background_->removeChild(it->second.target_->getName());
             this->background_->removeChild(it->second.text_->getName());
             // Properly destroy the overlay elements (do not use delete!)
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.health_);
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.healthLevel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.target_);
Index: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 10257)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h	(revision 10258)
@@ -77,4 +77,9 @@
             struct ObjectInfo
             {
+
+
+
+                Ogre::PanelOverlayElement* health_;
+                Ogre::PanelOverlayElement* healthLevel_;
                 Ogre::PanelOverlayElement* panel_;
                 Ogre::PanelOverlayElement* target_;
@@ -88,4 +93,20 @@
 
             // XMLPort accessors
+            inline void setHealthMarkerSize(float size)
+                        {
+                            this->healthMarkerSize_ = size;
+                            this->sizeChanged();
+                        }
+            inline float getHealthMarkerSize() const
+                            { return healthMarkerSize_; }
+
+            inline void setHealthLevelMarkerSize(float size)
+                                    {
+                                        this->healthLevelMarkerSize_ = size;
+                                        this->sizeChanged();
+                                    }
+                        inline float getHealthLevelMarkerSize() const
+                                        { return healthLevelMarkerSize_; }
+
             inline void setNavMarkerSize(float size)
             {
@@ -100,4 +121,5 @@
                 this->sizeChanged();
             }
+
             inline float getAimMarkerSize() const
                 { return aimMarkerSize_; }
@@ -121,4 +143,6 @@
             std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
 
+            float healthMarkerSize_;
+            float healthLevelMarkerSize_;
             float navMarkerSize_;
             float aimMarkerSize_;
Index: code/trunk/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 10257)
+++ code/trunk/src/modules/towerdefense/CMakeLists.txt	(revision 10258)
@@ -1,8 +1,11 @@
 SET_SOURCE_FILES(TOWERDEFENSE_SRC_FILES
   TowerDefense.cc
-  Tower.cc
+  TowerDefenseTower.cc
+  TowerTurret.cc
   TowerDefenseCenterpoint.cc
   TowerDefenseHUDController.cc
   TowerDefensePlayerStats.cc
+  TDCoordinate.cc
+  TowerDefenseEnemy.cc
 
 )
Index: code/trunk/src/modules/towerdefense/TDCoordinate.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TDCoordinate.cc	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TDCoordinate.cc	(revision 10258)
@@ -0,0 +1,42 @@
+#include "TDCoordinate.h"
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+
+
+
+namespace orxonox
+{
+    //RegisterClass(TDCoordinate);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    TDCoordinate::TDCoordinate()
+    {
+        //RegisterObject(TDCoordinate);
+        x=0;
+        y=0;
+
+    }
+
+    TDCoordinate::TDCoordinate(int x, int y)
+    {
+        this->x=x;
+        this->y=y;
+    }
+
+
+    Vector3 TDCoordinate::get3dcoordinate()
+    {
+        float tileScale = 100;
+
+        Vector3 *coord = new Vector3();
+        coord->x= (x-8) * tileScale;
+        coord->y= (y-8) * tileScale;
+        coord->z=100;
+
+        return *coord;
+    }
+}
Index: code/trunk/src/modules/towerdefense/TDCoordinate.h
===================================================================
--- code/trunk/src/modules/towerdefense/TDCoordinate.h	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TDCoordinate.h	(revision 10258)
@@ -0,0 +1,32 @@
+#ifndef _TDCoordinate_H__
+#define _TDCoordinate_H__
+
+#include "core/CoreIncludes.h"
+#include "TDCoordinate.h"
+//#include "towerdefense/TowerDefense.h"
+#include "gametypes/Deathmatch.h"
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/pawns/SpaceShip.h"
+namespace orxonox
+{
+
+//Class to save the Coordinates in a class instead of struct
+//Convert 2d coordinates to 3d in order to set waypoints
+    class _TowerDefenseExport TDCoordinate : public OrxonoxClass
+    {
+        public:
+            int x;
+            int y;
+
+            TDCoordinate();
+
+            Vector3 get3dcoordinate();
+
+            virtual ~TDCoordinate() {};
+
+            TDCoordinate(int x, int y);
+    };
+
+}
+
+#endif /* _TDCoordinate_H__ */
Index: code/trunk/src/modules/towerdefense/TDEnemy.h
===================================================================
--- code/trunk/src/modules/towerdefense/TDEnemy.h	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TDEnemy.h	(revision 10258)
@@ -5,5 +5,5 @@
  *      Author: weigeltm
  */
-
+/*
 #ifndef TDENEMY_H_
 #define TDENEMY_H_
@@ -24,3 +24,3 @@
 
 
-#endif /* TDENEMY_H_ */
+#endif  TDENEMY_H_ */
Index: code/trunk/src/modules/towerdefense/Tower.cc
===================================================================
--- code/trunk/src/modules/towerdefense/Tower.cc	(revision 10257)
+++ code/trunk/src/modules/towerdefense/Tower.cc	(revision 10258)
@@ -40,5 +40,5 @@
     {
         static int ori;
-        orxout() << "orientation " << ++ori << endl;
+        //orxout() << "orientation " << ++ori << endl;
     }
 
@@ -46,5 +46,5 @@
     {
         static int yaw;
-        orxout() << "rotateYaw " << ++yaw << endl;
+        //orxout() << "rotateYaw " << ++yaw << endl;
     }
 
@@ -52,5 +52,5 @@
     {
         static int pitch;
-        orxout() << "rotatePitch " << ++pitch << endl;
+        //orxout() << "rotatePitch " << ++pitch << endl;
     }
 
@@ -58,5 +58,5 @@
     {
         static int roll;
-        orxout() << "rotateRoll" << ++roll << endl;
+        //orxout() << "rotateRoll" << ++roll << endl;
     }
 
Index: code/trunk/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefense.cc	(revision 10258)
@@ -20,5 +20,5 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- *   Author:
+ *  Author:
  *
  *   Co-authors:
@@ -73,20 +73,17 @@
  *
  */
-
 #include "TowerDefense.h"
-#include "Tower.h"
+#include "TowerDefenseTower.h"
 #include "TowerDefenseCenterpoint.h"
-
+//#include "TDCoordinate.h"
+#include "TowerTurret.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"
 #include "core/CoreIncludes.h"
-
 /* Part of a temporary hack to allow the player to add towers */
 #include "core/command/ConsoleCommand.h"
@@ -99,11 +96,18 @@
     {
         RegisterObject(TowerDefense);
+/*
+        for (int i=0; i < 16 ; i++){
+            for (int j = 0; j< 16 ; j++){
+                towermatrix[i][j] = NULL;
+            }
+        }*/
 
         this->setHUDTemplate("TowerDefenseHUD");
 
-        this->stats_ = new TowerDefensePlayerStats();
-
-        /* Temporary hack to allow the player to add towers */
+        //this->stats_ = new TowerDefensePlayerStats();
+
+        /* Temporary hack to allow the player to add towers and upgrade them */
         this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
+        this->dedicatedUpgradeTower_ = createConsoleCommand( "upgradeTower", createExecutor( createFunctor(&TowerDefense::upgradeTower, this) ) );
     }
 
@@ -127,47 +131,134 @@
     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
-    }
+// Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path
+        for (int i=0; i < 16 ; i++){
+            for (int j = 0; j< 16 ; j++){
+                towermatrix[i][j] = false;
+            }
+        }
+
+        for (int k=0; k<3; k++)
+            towermatrix[1][k]=true;
+        for (int l=1; l<11; l++)
+            towermatrix[l][3]=true;
+        for (int m=3; m<12; m++)
+            towermatrix[10][m]=true;
+        for (int n=10; n<14; n++)
+            towermatrix[n][11]=true;
+        for (int o=13; o<16; o++)
+            towermatrix[13][o]=true;
+
+        //set initial credits, lifes and WaveNumber
+        this->setCredit(200);
+        this->setLifes(50);
+        this->setWaveNumber(0);
+        time=0.0;
+
+        //adds initial towers
+        for (int i=0; i <7; i++){
+            addTower(i+3,4);
+        }/*
+        for (int j=0; j < 7; j++){
+            addTower(9,j+5);
+        }*/
+    }
+
+    // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
+    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr){
+
+
+        TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
+        
+        switch(templatenr)
+        {
+        case 1 :
+            en1->addTemplate("enemytowerdefense1");
+            en1->setScale(3);
+            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            break;
+
+        case 2 :
+            en1->addTemplate("enemytowerdefense2");
+            en1->setScale(2);
+            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            //  en1->setShieldHealth(en1->getShield() = this->getWaveNumber()*2))
+            break;
+
+        case 3 :
+            en1->addTemplate("enemytowerdefense3");
+            en1->setScale(1);
+            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            break;
+        }
+
+        en1->getController();
+        en1->setPosition(path.at(0)->get3dcoordinate());
+        TowerDefenseEnemyvector.push_back(en1);
+
+        for(unsigned int i = 0; i < path.size(); ++i)
+        {
+            en1->addWaypoint((path.at(i)));
+        }
+    }
+
 
     void TowerDefense::end()
     {
+
         Deathmatch::end();
-
-        ChatManager::message("Match is over");
-    }
-
+        ChatManager::message("Match is over! Gameover!");
+
+    }
+
+    //not working yet
+    void TowerDefense::upgradeTower(int x,int y)
+    {/*
+        const int upgradeCost = 20;
+
+        if (!this->hasEnoughCreditForTower(upgradeCost))
+        {
+            orxout() << "not enough credit: " << (this->getCredit()) << " available, " << upgradeCost << " needed.";
+            return;
+        }
+
+        if (towermatrix [x][y] == NULL)
+        {
+            orxout() << "no tower on this position" << endl;
+            return;
+        }
+
+        else
+        {
+            (towermatrix [x][y])->upgradeTower();
+        }*/
+    }
+
+    /*adds Tower at Position (x,y) and reduces credit and adds the point to the towermatrix. template ("towerturret")
+    so towers have ability if the turrets
+
+    */
     void TowerDefense::addTower(int x, int y)
     {
-        const TowerCost towerCost = TDDefaultTowerCost;
+        const int towerCost = 20;
 
         if (!this->hasEnoughCreditForTower(towerCost))
         {
-            orxout() << "not enough credit: " << (this->stats_->getCredit()) << " available, " << TDDefaultTowerCost << " needed.";
+            orxout() << "not enough credit: " << (this->getCredit()) << " available, " << towerCost << " needed.";
             return;
         }
 
-        if (this->towerExists(x,y))
-        {
-            orxout() << "tower exists!!" << endl;
+        if (towermatrix [x][y]==true)
+        {
+            orxout() << "not possible to put tower here!!" << endl;
             return;
         }
 
-        /*
+/*
         unsigned int width = this->center_->getWidth();
         unsigned int height = this->center_->getHeight();
-        */
+*/
 
         int tileScale = (int) this->center_->getTileScale();
@@ -182,40 +273,87 @@
         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_->getContext());
-        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;
-    }
-
-
+       //Reduce credit
+        this->buyTower(towerCost);
+        towermatrix [x][y]=true;
+
+        //Creates tower
+        TowerDefenseTower* towernew = new TowerDefenseTower(this->center_->getContext());
+        towernew->addTemplate("towerturret");
+        towernew->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 75);
+        towernew->setGame(this);
+    }
+
+    bool TowerDefense::hasEnoughCreditForTower(int towerCost)
+    {
+        return ((this->getCredit()) >= towerCost);
+    }
+
+
+    bool TowerDefense::hasEnoughCreditForUpgrade()
+    {
+        return true;
+    }
+
+ 
     void TowerDefense::tick(float dt)
     {
         SUPER(TowerDefense, tick, dt);
+        time +=dt;
+
+        TDCoordinate* coord1 = new TDCoordinate(1,1);
+        std::vector<TDCoordinate*> path;
+        path.push_back(coord1);
+        if(time>1 && TowerDefenseEnemyvector.size() < 30)
+        {
+            //adds different types of enemys depending on the WaveNumber
+            addTowerDefenseEnemy(path, this->getWaveNumber() % 3 +1 );
+            time = time-1;
+        }
+
+        Vector3* endpoint = new Vector3(500, 700, 150);
+        //if ships are at the end they get destroyed
+        for(unsigned int i =0; i < TowerDefenseEnemyvector.size(); ++i)
+        {
+            if(TowerDefenseEnemyvector.at(i) != NULL && TowerDefenseEnemyvector.at(i)->isAlive())
+            {
+                //destroys enemys at the end of teh path and reduces the life by 1. no credits gifted
+
+                Vector3 ship = TowerDefenseEnemyvector.at(i)->getRVWorldPosition();
+                float distance = ship.distance(*endpoint);
+
+                if(distance <50){
+                    TowerDefenseEnemyvector.at(i)->destroy();
+                    this->reduceLifes(1);
+                    this->buyTower(1);
+                    if (this->getLifes()==0)
+                    {
+                        this->end();
+                    }
+                }
+            }
+        }
+        //goes thorugh vector to see if an enemy is still alive. if not next wave is launched
+        int count= 0;
+        for(unsigned int i =0; i < TowerDefenseEnemyvector.size(); ++i)
+        {
+            if(TowerDefenseEnemyvector.at(i)!= NULL)
+            {
+                ++count;
+            }
+        }
+
+        if(count== 0)
+        {
+            time2 +=dt;
+            if(time2 > 10)
+            {
+                TowerDefenseEnemyvector.clear();
+                this->nextwave();
+                time=0;
+                time2=0;
+            }
+        }
+
+
     }
 
Index: code/trunk/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefense.h	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefense.h	(revision 10258)
@@ -37,9 +37,10 @@
 #ifndef _TowerDefense_H__
 #define _TowerDefense_H__
-
+#include "TDCoordinate.h"
 #include "towerdefense/TowerDefensePrereqs.h"
 #include "gametypes/Deathmatch.h"
-
- #include "TowerDefensePlayerStats.h"
+#include "TowerDefenseEnemy.h"
+#include "util/Output.h"
+#include "core/object/WeakPtr.h"
 
 namespace orxonox
@@ -51,4 +52,7 @@
         virtual ~TowerDefense();
 
+        std::vector<orxonox::WeakPtr<TowerDefenseEnemy> > TowerDefenseEnemyvector;
+        bool towermatrix[16][16];
+        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
         virtual void start(); //<! The function is called when the gametype starts
         virtual void end();
@@ -56,4 +60,15 @@
         //virtual void playerEntered(PlayerInfo* player);
         //virtual bool playerLeft(PlayerInfo* player);
+        //Player Stats (set,get, reduce)
+        int getCredit(){ return this->credit_; }
+        int getLifes(){ return this->lifes_; }
+        int getWaveNumber(){ return this->waves_; }
+        void setCredit(int credit){ credit_ = credit; }
+        void setLifes(int lifes){ lifes_ = lifes; }
+        void setWaveNumber(int wavenumber){ waves_=wavenumber; }
+        void buyTower(int cost){ credit_ -= cost;}
+        void addCredit(int credit) { credit_+=credit; }
+        void nextwave(){ waves_++;}
+        int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
 
         //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
@@ -69,6 +84,8 @@
         void addTower(int x, int y);
 
+        void upgradeTower(int x, int y);
         /* Part of a temporary hack to allow the player to add towers */
         ConsoleCommand* dedicatedAddTower_;
+        ConsoleCommand* dedicatedUpgradeTower_;
 
         //TODO: void spawnNewWave()
@@ -79,18 +96,17 @@
     private:
         TowerDefenseCenterpoint *center_;
+        float time;
+        float time2;
+        int credit_;
+        int waves_;
+        int lifes_;
 
         /* handles stats */
-        TowerDefensePlayerStats *stats_;
-        bool hasEnoughCreditForTower(TowerCost towerCost);
+        bool hasEnoughCreditForTower(int towerCost);
+        bool hasEnoughCreditForUpgrade();
 
-        bool towerExists(int x, int y);
 
-        typedef struct {
-            int x;
-            int y;
-        } Coordinate;
 
-        std::vector<Coordinate> addedTowersCoordinates_;
-        std::vector<Tower*> towers_;
+        std::vector<TowerTurret*> towers_;
     };
 }
Index: code/trunk/src/modules/towerdefense/TowerDefenseController.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseController.cc	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefenseController.cc	(revision 10258)
@@ -33,4 +33,5 @@
 #include "core/XMLPort.h"
 #include "worldentities/pawns/Pawn.h"
+#include "controllers/WaypointController.h"
 
 namespace orxonox
@@ -53,4 +54,5 @@
         XMLPortParam(TowerDefenseController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
     }
+
 
     void TowerDefenseController::tick(float dt)
Index: code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10258)
@@ -0,0 +1,91 @@
+//
+//  TowerDefenseEnemy.cc
+//  Orxonox
+//
+//  Created by Jonas Erb on 22.10.14.
+
+/**
+@brief
+See TowerDefenseReadme.txt for Information.
+
+@ingroup TowerDefense
+*/
+#include "TowerDefenseEnemy.h"
+#include "core/CoreIncludes.h"
+//#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    RegisterClass(TowerDefenseEnemy);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    TowerDefenseEnemy::TowerDefenseEnemy(Context* context) : SpaceShip(context)
+    {
+        RegisterObject(TowerDefenseEnemy);
+
+        this->setCollisionType(WorldEntity::Dynamic);
+        //needed to keep track of the PlayerStats coded in TowerDefense.h
+        this->td = orxonox_cast<TowerDefense*>(this->getGametype().get());
+        once_=false;
+
+    }
+    //add credit if enemy is destroyed
+    TowerDefenseEnemy::~TowerDefenseEnemy(){
+        //this->td->addCredit(1);
+    }
+
+    void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord)
+    {
+        this->Waypointsvector_.push_back(coord);
+    }
+
+
+    void TowerDefenseEnemy::tick(float dt)
+    {
+        SUPER(TowerDefenseEnemy, tick, dt);
+    }
+
+    WeakPtr<TowerDefense> TowerDefenseEnemy::getGame()
+    {
+        if (game == NULL)
+        {
+            for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it)
+                game = *it;
+        }
+        return game;
+    }
+
+    void TowerDefenseEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
+    {
+        Pawn::damage(damage, healthdamage, shielddamage, originator);
+        if (getGame() && once_ == false && getHealth() <= 0)
+        {
+            getGame()->addCredit(1);
+            once_ = true;
+        }
+    }
+/*
+    void TowerDefenseEnemy::popWaypoint()
+    {
+        if(Waypointsvector_.size()>0)
+            Waypointsvector_.pop_back();
+    }
+
+    TDCoordinate TowerDefenseEnemy::peekWaypoint()
+    {
+        if(Waypointsvector_.size()<=0){
+            TDCoordinate* coord = TDCoordinate(-1,-1);
+            return coord;
+        }else{
+            return Waypointsvector_.at(Waypointsvector_.size()-1);
+
+        }
+
+
+    }
+*/
+
+}
Index: code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10258)
@@ -0,0 +1,61 @@
+//
+//  TowerDefenseEnemy.h
+//  Orxonox
+//
+//  Created by Jonas Erb on 22.10.14.
+
+/**
+@brief
+See TowerDefenseReadme.txt for Information.
+
+@ingroup TowerDefense
+*/
+
+
+
+#ifndef Orxonox_Tower_h
+#define Orxonox_Tower_h
+
+#include "TDCoordinate.h"
+#include "gametypes/Deathmatch.h"
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "util/Output.h"
+#include "controllers/ArtificialController.h"
+#include "TowerDefense.h"
+
+namespace orxonox
+{
+/* Class to give the TowerDefenseEnemy spaceships waypoints and
+ *
+ */
+    class _TowerDefenseExport TowerDefenseEnemy : public SpaceShip
+    {
+    public:
+        TowerDefenseEnemy(Context* context);
+        virtual ~TowerDefenseEnemy();
+
+        //health gibt es unter: health_
+
+        virtual void tick(float dt);
+        void addWaypoint(TDCoordinate* coord);
+        void popWaypoint();
+        TDCoordinate peekWaypoint();
+
+        virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
+
+
+    private:
+        WeakPtr<TowerDefense> getGame();
+        WeakPtr<TowerDefense> game;
+        TowerDefense* td;
+        bool once_;
+        std::vector<TDCoordinate*> Waypointsvector_;
+
+    };
+
+
+
+}
+
+#endif /* _TowerDefense_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc	(revision 10258)
@@ -32,5 +32,4 @@
 #include "util/Convert.h"
 
-
 namespace orxonox
 {
@@ -40,4 +39,5 @@
     {
         RegisterObject(TowerDefenseHUDController);
+        this->td = 0;
     }
 
@@ -50,4 +50,16 @@
     {
         SUPER(TowerDefenseHUDController, tick, dt);
+        const std::string& lifes = multi_cast<std::string>(this->td->getLifes());
+        const std::string& credits = multi_cast<std::string>(this->td->getCredit());
+        const std::string& wave = multi_cast<std::string>(this->td->getWaveNumber());
+
+        if(showlives == true)
+          this->setCaption(multi_cast<std::string>(lifes));
+        else if(showcredits == true)
+          this->setCaption(multi_cast<std::string>(credits));
+        else if(showwaves == true)
+          this->setCaption(multi_cast<std::string>(wave));
+
+
     }
 
@@ -55,16 +67,24 @@
     {
         SUPER(TowerDefenseHUDController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TowerDefenseHUDController, "showlives", setShowlives, getShowlives, xmlelement, mode);
+        XMLPortParam(TowerDefenseHUDController, "showcredits", setShowcredits, getShowcredits, xmlelement, mode);
+        XMLPortParam(TowerDefenseHUDController, "showwaves", setShowwaves, getShowwaves, 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;
-        */
-    }
+        {
+            SUPER(TowerDefenseHUDController, changedOwner);
 
-}
+            if (this->getOwner() && this->getOwner()->getGametype())
+                    {
+                        this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype().get());
+                    }
+                    else
+                    {
+                        this->td = 0;
+                    }
+                }
+        }
+
Index: code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h	(revision 10258)
@@ -39,8 +39,8 @@
 
 #include "towerdefense/TowerDefensePrereqs.h"
-
+#include "TowerDefensePlayerStats.h"
 #include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
-
+#include "TowerDefense.h"
 
 namespace orxonox
@@ -52,7 +52,28 @@
         virtual ~TowerDefenseHUDController();
 
+
         virtual void tick(float dt);
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
         virtual void changedOwner();
+        void setShowlives(bool temp)
+            { this->showlives = temp; }
+        unsigned int getShowlives(void) const
+            { return this->showlives; }
+
+        void setShowcredits(bool temp)
+            { this->showcredits = temp; }
+        unsigned int getShowcredits(void) const
+            { return this->showcredits; }
+
+        void setShowwaves(bool temp)
+            { this->showwaves = temp; }
+        unsigned int getShowwaves(void) const
+            { return this->showwaves; }
+
+    private:
+        TowerDefense* td;
+        bool showcredits;
+        bool showlives;
+        bool showwaves;
     };
 }
Index: code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.cc	(revision 10258)
@@ -25,5 +25,5 @@
  *      ...
  */
-
+/*
 #include "TowerDefensePlayerStats.h"
 
@@ -31,14 +31,16 @@
 {
     const int kDefaultCredit = 200;
-
+    const int kDefaultLifes=20;
     TowerDefensePlayerStats::TowerDefensePlayerStats()
     {
         this->credit_ = kDefaultCredit;
         this->waveNumber_ = 0;
+        this->lifes_=kDefaultLifes;
     }
-    /*
+
     TowerDefensePlayerStats::~TowerDefensePlayerStats()
     {
     }
-    */
+
 }
+*/
Index: code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefensePlayerStats.h	(revision 10258)
@@ -27,10 +27,10 @@
  */
 
- /**
+ /*
     @brief
         This manages the stats of the player. It is used by 'TowerDefense', the gametype
 
     @ingroup TowerDefense
- */
+
 
 
@@ -44,5 +44,6 @@
     typedef enum _TowerCosts {
         // Set to 0 for debug...
-        TDDefaultTowerCost = 0
+        TDDefaultTowerCost = 20 ,
+        TDDefaultUpgradeCost = 15
     } TowerCost;
 
@@ -67,10 +68,23 @@
             { waveNumber_++; }
 
+        inline int getLifes()
+            {return lifes_; }
+
+        inline void reduceLifes(int NumberofLifes)
+        {lifes_-=NumberofLifes; }
+
+        inline void upgradeTower(int upgradecost)
+            { credit_ -= upgradecost;}
+
+
+
     private:
         int credit_;
         int waveNumber_;
+        int upgradecost;
+        int lifes_;
         //int baseHealth_;
     };
 }
 
-#endif /* _TowerDefensePlayerStats_H__ */
+#endif  _TowerDefensePlayerStats_H__ */
Index: code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h	(revision 10257)
+++ code/trunk/src/modules/towerdefense/TowerDefensePrereqs.h	(revision 10258)
@@ -66,8 +66,14 @@
 {
     class TowerDefense;
-    class Tower;
+
+    class TowerDefenseTower;
+
     class TowerDefenseCenterpoint;
     class TowerDefenseHUDController;
     class TowerDefensePlayerStats;
+    class TowerDefenseEnemy;
+    class TDCoordinate;
+    class TowerTurret;
+    class TowerDefenseTower;
 }
 
Index: code/trunk/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10258)
@@ -0,0 +1,129 @@
+//
+//  TowerDefenseTower.cc
+//  Orxonox
+//
+//  Created by Fabian Mentzer on 29.04.12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/* Not implemented fully */
+
+#include "TowerDefenseTower.h"
+
+#include "core/CoreIncludes.h"
+//#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    RegisterClass(TowerDefenseTower);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    TowerDefenseTower::TowerDefenseTower(Context* context) : Pawn(context)
+    {
+        RegisterObject(TowerDefenseTower);
+
+        this->setCollisionType(WorldEntity::Dynamic);
+        upgrade = 0;
+
+        //this->removeAllEngines();
+
+        /*
+        this->size_ = 10.0f;
+        this->delay_ = false;
+        this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
+        */
+    }
+
+    void TowerDefenseTower::setOrientation(const Quaternion& orientation)
+    {
+    }
+
+    void TowerDefenseTower::rotateYaw(const Vector2& value)
+    {
+    }
+
+    void TowerDefenseTower::rotatePitch(const Vector2& value)
+    {
+    }
+
+    void TowerDefenseTower::rotateRoll(const Vector2& value)
+    {
+    }
+
+    bool TowerDefenseTower::upgradeTower()
+    {
+        if(upgrade < 3)
+        {
+            upgrade++;
+            float reloadrate = getReloadRate();
+            float reloadwaittime = getReloadWaitTime();
+            this->setDamageMultiplier(5000);
+
+            reloadrate = 0.5f*reloadrate;
+            reloadwaittime = 0.5f*reloadwaittime;
+            setReloadRate(reloadrate);
+            setReloadWaitTime(reloadwaittime);
+            this->addTemplate("towerturret1");
+        }
+        else
+        {
+            orxout() << "Tower fully upgraded" << endl;
+            return false;
+        }
+        return true;
+    }
+
+    // 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 "TowerDefenseTowerMover". This is the controllable entity that the
+    // player controls in order to move the TowerDefenseTower along the centerpoint and in order to place the TowerDefenseTower at the appropriate position.
+    //
+
+    // The TowerDefenseTower 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 TowerDefenseTower are in the same team)
+
+    //How to move a TowerDefenseTower: simply attach the TowerDefenseTower to the TowerDefenseTowerMover
+    //How to place a TowerDefenseTower: detach the TowerDefenseTower from the TowerDefenseTowerMover
+
+    /**
+    @brief
+        Overloaded the function to rotate the stone.
+    @param value
+        A vector whose first component is the angle by which to rotate.
+    */
+    /*
+    void TowerDefenseTower::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 TowerDefenseTower::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/TowerDefenseTower.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerDefenseTower.h	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerDefenseTower.h	(revision 10258)
@@ -0,0 +1,55 @@
+//
+//  TowerDefenseTower.h
+//  Orxonox
+//
+//  Created by Fabian Mentzer on 29.04.12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/**
+@brief
+See TowerDefenseTowerDefenseReadme.txt for Information.
+
+@ingroup TowerDefenseTowerDefense
+*/
+
+
+#ifndef Orxonox_TowerDefenseTower_h
+#define Orxonox_TowerDefenseTower_h
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/pawns/SpaceShip.h"
+
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerDefenseTower : public Pawn
+    {
+    public:
+        TowerDefenseTower(Context* context);
+        virtual ~TowerDefenseTower() {};
+
+        // Maybe later override these to move TowerDefenseTowers with cursor keys
+        /*
+        virtual void moveFrontBack(const Vector2& value);
+        virtual void moveRightLeft(const Vector2& value);
+        */
+
+        // Overriding these to stop TowerDefenseTowers 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);
+        virtual bool upgradeTower();
+
+
+        void setGame(TowerDefense* Towerdefense)
+        { assert(Towerdefense); game_ = Towerdefense; }
+    private:
+        TowerDefense* game_;
+        int upgrade;
+    };
+}
+
+
+#endif
Index: code/trunk/src/modules/towerdefense/TowerTurret.cc
===================================================================
--- code/trunk/src/modules/towerdefense/TowerTurret.cc	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerTurret.cc	(revision 10258)
@@ -0,0 +1,41 @@
+//
+//  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 "TowerTurret.h"
+
+#include "core/CoreIncludes.h"
+//#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    RegisterClass(TowerTurret);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    TowerTurret::TowerTurret(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(TowerTurret);
+
+        this->setCollisionType(WorldEntity::Static);
+
+
+    }
+
+    void TowerTurret::setOrientation(const Quaternion& orientation)
+    {
+        static int ori;
+        orxout() << "orientation " << ++ori << endl;
+    }
+
+
+}
Index: code/trunk/src/modules/towerdefense/TowerTurret.h
===================================================================
--- code/trunk/src/modules/towerdefense/TowerTurret.h	(revision 10258)
+++ code/trunk/src/modules/towerdefense/TowerTurret.h	(revision 10258)
@@ -0,0 +1,53 @@
+//
+//  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"
+#include "worldentities/StaticEntity.h"
+
+
+namespace orxonox
+{
+    class _TowerDefenseExport TowerTurret : public StaticEntity
+    {
+    public:
+        TowerTurret(Context* context);
+        virtual ~TowerTurret() {};
+
+        // 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/weapons/RocketController.cc
===================================================================
--- code/trunk/src/modules/weapons/RocketController.cc	(revision 10257)
+++ code/trunk/src/modules/weapons/RocketController.cc	(revision 10258)
@@ -41,4 +41,6 @@
 namespace orxonox
 {
+    RegisterClass(RocketController);
+
     /**
     @brief
@@ -97,5 +99,5 @@
         if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000)
             this->rocket_->setAcceleration(this->rocket_->getOrientation()*Vector3(-20,-20,-20));
-        if (distance <1000) this->rocket_->setAcceleration(0,0,0);
+        if (distance < 1000) this->rocket_->setAcceleration(0,0,0);
 
         this->rocket_->rotateYaw(-sgn(coord.x)*coord.x*coord.x);
Index: code/trunk/src/orxonox/LevelManager.cc
===================================================================
--- code/trunk/src/orxonox/LevelManager.cc	(revision 10257)
+++ code/trunk/src/orxonox/LevelManager.cc	(revision 10258)
@@ -89,4 +89,16 @@
         SetConfigValue(defaultLevelName_, "missionOne.oxw")
             .description("Sets the pre selection of the level in the main menu.");
+        SetConfigValue(lastFinishedCampaignMission_,  "")
+            .description("The last finished mission of a campaign");
+        SetConfigValue(campaignMissions_,  std::vector<std::string>())
+            .description("The list of missions in the campaign");
+    }
+
+    /**
+     * @brief Stores the argument in the corresponding config value.
+     */
+    void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)
+    {
+        ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);
     }
 
Index: code/trunk/src/orxonox/LevelManager.h
===================================================================
--- code/trunk/src/orxonox/LevelManager.h	(revision 10257)
+++ code/trunk/src/orxonox/LevelManager.h	(revision 10258)
@@ -91,4 +91,13 @@
             LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels.
 
+            void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission);
+            inline const std::string& getLastFinishedCampaignMission() const
+                { return this->lastFinishedCampaignMission_; }
+
+            inline unsigned int getNumberOfCampaignMissions()
+                { return this->campaignMissions_.size(); }
+            inline const std::string& getCampaignMission(unsigned int index)
+                { return this->campaignMissions_[index]; }
+
             /**
             @brief Get the instance of the LevelManager.
@@ -116,4 +125,6 @@
             // config values
             std::string defaultLevelName_;
+            std::string lastFinishedCampaignMission_;
+            std::vector<std::string> campaignMissions_;
 
             static LevelManager* singletonPtr_s;
Index: code/trunk/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc	(revision 10257)
+++ code/trunk/src/orxonox/gametypes/Mission.cc	(revision 10258)
@@ -28,4 +28,5 @@
 
 #include "Mission.h"
+
 #include "items/Engine.h"
 #include "controllers/ArtificialController.h"
@@ -36,5 +37,5 @@
 #include "network/Host.h"
 #include "worldentities/pawns/Pawn.h"
-
+#include "LevelManager.h"
 
 namespace orxonox
@@ -70,5 +71,5 @@
     void Mission::pawnKilled(Pawn* victim, Pawn* killer)
     {
-        if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() )
+        if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer())
         {
             this->lives_--;
@@ -87,17 +88,23 @@
     {
         if (this->missionAccomplished_ && !this->gtinfo_->hasEnded())
+        {
             this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+
+            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
+        }
         else if (!this->gtinfo_->hasEnded())
             this->gtinfo_->sendAnnounceMessage("Mission failed!");
+
         Gametype::end();
     }
 
     void Mission::setTeams()
-    {//Set pawn-colours
+    { //Set pawn-colours
         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
         {
             Pawn* pawn = static_cast<Pawn*>(*it);
-            if(!pawn) continue;
-                this->setDefaultObjectColour(pawn);
+            if (!pawn)
+                continue;
+            this->setDefaultObjectColour(pawn);
         }
     }
@@ -105,18 +112,16 @@
     {
         for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
-        {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
+        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
             it->setMissionAccomplished(accomplished);
             it->end();
         }
     }
-    
+
     void Mission::setLivesWrapper(unsigned int amount)
     {
         for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
-        {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
+        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
             it->setLives(amount);
         }
     }
-
-
 }
