[Orxonox-commit 7149] r11766 - in code/branches/Presentation_HS17_merge: . data/levels src/libraries/tools src/modules/superorxobros src/orxonox/graphics
landauf at orxonox.net
landauf at orxonox.net
Sun Feb 18 16:02:50 CET 2018
Author: landauf
Date: 2018-02-18 16:02:50 +0100 (Sun, 18 Feb 2018)
New Revision: 11766
Added:
code/branches/Presentation_HS17_merge/BlenderFilesSOB/
code/branches/Presentation_HS17_merge/SOB.oxw
code/branches/Presentation_HS17_merge/TRANSFER/
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.cc
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.cc
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.h
Modified:
code/branches/Presentation_HS17_merge/
code/branches/Presentation_HS17_merge/data/levels/SOB.oxw
code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.cc
code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/CMakeLists.txt
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.cc
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFlagstone.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.cc
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBPrereqs.h
code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBQBlock.cc
code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.cc
code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.h
Log:
merged SOBv2_HS17
Index: code/branches/Presentation_HS17_merge
===================================================================
--- code/branches/Presentation_HS17_merge 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge 2018-02-18 15:02:50 UTC (rev 11766)
Property changes on: code/branches/Presentation_HS17_merge
___________________________________________________________________
Modified: svn:mergeinfo
## -12,6 +12,7 ##
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/ProtectBoss_HS17:11457-11763
/code/branches/Racingbot:9388-9513
+/code/branches/SOBv2_HS17:11459-11765
/code/branches/SciptableControllerFS15:10308-10613
/code/branches/ScriptableController:9999-10075
/code/branches/SpaceRace_HS16:11214-11357
Copied: code/branches/Presentation_HS17_merge/SOB.oxw (from rev 11765, code/branches/SOBv2_HS17/SOB.oxw)
===================================================================
--- code/branches/Presentation_HS17_merge/SOB.oxw (rev 0)
+++ code/branches/Presentation_HS17_merge/SOB.oxw 2018-02-18 15:02:50 UTC (rev 11766)
@@ -0,0 +1,792 @@
+<LevelInfo
+ name = "Super Orxo Bros."
+ description = "The retro-game Super Mario Bros. in Orxonox."
+ tags = "minigame"
+ screenshot = "SOB.png"
+ />
+
+ <?lua
+ include("HUDTemplates3.oxo")
+ include("jumpHUD.oxo")
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+ include("overlays/SOBHUD.oxo")
+ ?>
+
+ <Template name=mushroom defaults=0>
+ <SOBMushroom collisionType="dynamic" speed=30>
+ <attached>
+ <Model mesh="Pilz.mesh" position="0,0,21" scale=3 pitch=90/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBMushroom>
+ </Template>
+
+ <Template name=coin defaults=0 >
+ <SOBCoin speed = 15 lifetime = 0.7>
+ <attached>
+ <Model mesh="Coin.mesh" position="0,0,11" scale=3 pitch=-90 roll=90/>
+ </attached>
+
+ </SOBCoin>
+ </Template>
+
+
+
+ <Template name=sobfigurecameras defaults=0>
+ <SOBFigure>
+ <camerapositions>
+ <CameraPosition position="0,-150,30" absolute=true mouselook=false drag=false direction="0,1,0"/>
+ </camerapositions>
+ </SOBFigure>
+ </Template>
+
+
+
+
+ <Template name=sobFigureTemplate>
+ <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic" position="0,0,30">
+ <attached>
+ <Model mesh="orxo.mesh" position = "0,0,12" scale=2.5 pitch=0 roll=90 yaw=90/>
+ <ParticleSpawner source="Orxonox/fire4" startdelay=0 position="-4,0,0" visible="false"/>
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="-2,0,2" halfExtents="3,1,10" />
+ </collisionShapes>
+
+
+ </SOBFigure>
+ </Template>
+
+
+
+
+
+
+ <Level
+ plugins = "superorxobros"
+ gametype = "SOB"
+ >-
+
+
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
+
+
+ <Scene ambientlight="1.0, 1.0, 1.0" skybox="Orxonox/skyBoxBasic">
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+ <SpawnPoint position="1984,-5,88 " orientation="0.534038, 0.563456, 0.212168, 0.593553" />
+
+
+
+ <MovableEntity >
+ <attached>
+ <SOBCenterpoint name=jumpcenter cameraOffset="10" figureTemplate=sobFigureTemplate>
+ <attached>
+ </attached>
+ </SOBCenterpoint>
+
+ </attached>
+ </MovableEntity>
+
+
+ <!--Gumba-->
+
+ <SOBGumba collisionType="dynamic" speed=40 position = "240,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+ <SOBGumba collisionType="dynamic" speed=30 position = "420,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+ <SOBGumba collisionType="dynamic" speed=30 position = "500,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=30 position = "510,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+ <SOBGumba collisionType="dynamic" speed=30 position = "930,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=20 position = "940,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=30 position = "1180,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=20 position = "1190,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=30 position = "1320,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=20 position = "1330,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=30 position = "1750,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+ <SOBGumba collisionType="dynamic" speed=20 position = "1770,0,0">
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumba>
+
+
+ <!--CollisionShape for Gumba-->
+ <StaticEntity collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,-20" halfExtents="5,5,5" />
+ <BoxCollisionShape position="890,0,-20" halfExtents="5,5,5" />
+
+
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+
+
+ <!-- Boden 1 -->
+ <Model mesh="Cube2.12.mesh" position="0,0,-30" scale=10 Pitch=90/> <!-- B1.1 -->
+ <Model mesh="Cube2.12.mesh" position="120,0,-30" scale=10 Pitch=90/> <!-- B1.2-->
+ <Model mesh="Cube2.12.mesh" position="240,0,-30" scale=10 Pitch=90/> <!-- B1.3 -->
+ <Model mesh="Cube2.12.mesh" position="360,0,-30" scale=10 Pitch=90/> <!-- B1.4 -->
+ <Model mesh="Cube2.12.mesh" position="480,0,-30" scale=10 Pitch=90/> <!-- B1.5 -->
+ <Model mesh="Cube2.6.mesh" position="600,0,-30" scale=10 Pitch=90/> <!-- B1.6 -->
+ <Model mesh="Cube2.3.mesh" position="660,0,-30" scale=10 Pitch=90/> <!-- B1.7 -->
+
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="340,0,-20" halfExtents="345,5,5" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+ <!-- Luft 1 -->
+
+
+ <SOBQBlock collisionType="static" type="Coin" position="170,0,20" mass='-1'> <!-- L1.1 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90 />
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <SOBQBlock collisionType="static" type="Coin" position="230,0,60" mass='-1' >
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/> <!-- L1.2 -->
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="210,0,20" scale=10 /> <!-- L1.3 -->
+
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="220,0,20" mass='-1'><!--ITEM-->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/> <!-- L1.4 -->
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" /><!-- 3 -->
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="230,0,20" scale=10/> <!-- L1.5 -->
+
+ <SOBQBlock collisionType="static" type="Coin" position="240,0,20" mass='-1'><!-- ? Block -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/> <!-- L1.6 -->
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="250,0,20" scale=10/> <!-- L1.7 -->
+ <!-- Rohre-->
+ <Model mesh="Rohr.mesh" position="295,5,-35" scale=10 roll=90 yaw=90 pitch=-90/> <!-- L1.8 -->
+ <Model mesh="Rohr.mesh" position="395,5,-25" scale=10 roll=90 yaw=90 pitch=-90/> <!-- L1.9 -->
+ <Model mesh="Rohr.mesh" position="475,5,-15" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L1.10 -->
+ <Model mesh="Rohr.mesh" position="585,5,-15" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L1.11 -->
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="650,0,30" mass='-1'>
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/> <!-- L1.12 -->
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+
+
+
+
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+
+ <BoxCollisionShape position="210,0,20" halfExtents="5,5,5" /> <!-- 1.3 -->
+ <BoxCollisionShape position="230,0,20" halfExtents="5,5,5" /> <!-- 1.5 -->
+ <BoxCollisionShape position="250,0,20" halfExtents="5,5,5" /> <!-- 1.7 -->
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+ <StaticEntity collisionType="static" >
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="295,0,-4" halfExtents="12,5,12" /> <!-- 1.8 -->
+ <BoxCollisionShape position="395,0,1" halfExtents="12,5,17" /> <!-- 1.9 -->
+ <BoxCollisionShape position="475,0,6" halfExtents="12,5,22" /> <!-- 1.10 -->
+ <BoxCollisionShape position="585,0,6" halfExtents="12,5,22" /> <!-- 1.11 -->
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+
+
+ <!-- Boden 2 -->
+ <Model mesh="Cube2.12.mesh" position="710,0,-30" scale=10 Pitch=90/> <!-- B2.1 -->
+ <Model mesh="Cube2.3.mesh" position="830,0,-30" scale=10 Pitch=90/> <!-- B2.2 -->
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="780,0,-20" halfExtents="75,5,5" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+ <!-- Luft 2 -->
+ <Model mesh="Cube1.1.mesh" position="770,0,20" scale=10/> <!-- L2.1 -->
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="780,0,20" mass='-1'> <!-- L2.2 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="790,0,20" scale=10/> <!-- L2.3 -->
+ <Model mesh="Cube1.6.mesh" position="800,0,60" scale=10/> <!-- L2.4 -->
+ <Model mesh="Cube1.1.mesh" position="860,0,60" scale=10/> <!-- L2.5 -->
+ <Model mesh="Cube1.1.mesh" position="870,0,60" scale=10/> <!-- L2.6 -->
+
+ <StaticEntity collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="770,0,20" halfExtents="5,5,5" /> <!-- 2.1 -->
+
+ <BoxCollisionShape position="790,0,20" halfExtents="5,5,5" /> <!-- 2.3 -->
+ <BoxCollisionShape position="835,0,60" halfExtents="40,5,5" /> <!-- 2.4 to 2.6 -->
+
+
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+ <!-- Luft 3 -->
+ <Model mesh="Cube1.3.mesh" position="910,0,60" scale=10/> <!-- L3.1 -->
+
+ <SOBQBlock collisionType="static" type="Coin" position="940,0,60" mass='-1'> <!-- L3.2 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="940,0,20" mass='-1'> <!-- L3.3 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="1000,0,20" scale=10/> <!-- L3.4 -->
+
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="1010,0,20" mass='-1'> <!-- L3.5 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <SOBQBlock collisionType="static" type="Coin" position="1060,0,20" mass='-1'> <!-- L3.6 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+
+ <SOBQBlock collisionType="static" type="Mushroom" position="1090,0,60" mass='-1'> <!-- L3.7 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <SOBQBlock collisionType="static" type="Coin" position="1090,0,20" mass='-1'> <!-- L3.8 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <SOBQBlock collisionType="static" type="Coin" position="1120,0,20" mass='-1'> <!-- L3.9 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="1180,0,20" scale=10/> <!-- L3.10 -->
+
+ <Model mesh="Cube1.3.mesh" position="1210,0,60" scale=10/> <!-- L3.11 -->
+
+ <Model mesh="Cube1.1.mesh" position="1280,0,60" scale=10/> <!-- L3.12 -->
+
+ <SOBQBlock collisionType="static" type="Coin" position="1290,0,60" mass='-1'> <!-- L3.13 -->
+ <attached>
+ <Model mesh="QCube.mesh" type="Mushroom" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+
+ <SOBQBlock collisionType="static" type="Coin" position="1300,0,60" mass='-1'> <!-- L3.14 -->
+ <attached>
+ <Model mesh="QCube.mesh" type="Mushroom" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="1310,0,60" scale=10/> <!-- L3.15 -->
+ <Model mesh="Cube1.1.mesh" position="1290,0,20" scale=10/> <!-- L3.16 -->
+ <Model mesh="Cube1.1.mesh" position="1300,0,20" scale=10/> <!-- L3.17 -->
+
+
+
+ <Model mesh="Dreieck.mesh" position="1370,0,-10" scale=10 Roll=90 Pitch=90 yaw=90/> <!-- L3.18 -->
+ <Model mesh="Dreieck.mesh" position="1400,0,-10" scale=10 Roll=90 Pitch=-90 yaw=90/> <!-- L3.19 -->
+ <Model mesh="Dreieck_links+1.mesh" position="1510,0,-10" scale=10 Roll=90 Pitch=90 yaw=90/> <!-- L3.20 -->
+
+
+
+ <StaticEntity collisionType="static">
+ <collisionShapes>
+
+ <BoxCollisionShape position="1355,0,-10" halfExtents="20,5,5" /> <!-- 3.18 -->
+ <BoxCollisionShape position="1360,0,0" halfExtents="15,5,5" />
+ <BoxCollisionShape position="1365,0,10" halfExtents="10,5,5" />
+ <BoxCollisionShape position="1370,0,20" halfExtents="5,5,5" />
+
+ <BoxCollisionShape position="1415,0,-10" halfExtents="20,5,5" /> <!-- 3.19-->
+ <BoxCollisionShape position="1410,0,0" halfExtents="15,5,5" />
+ <BoxCollisionShape position="1405,0,10" halfExtents="10,5,5" />
+ <BoxCollisionShape position="1400,0,20" halfExtents="5,5,5" />
+
+ <BoxCollisionShape position="1500,0,-10" halfExtents="25,5,5" /> <!-- 3.20 -->
+ <BoxCollisionShape position="1505,0,0" halfExtents="20,5,5" />
+ <BoxCollisionShape position="1510,0,10" halfExtents="15,5,5" />
+ <BoxCollisionShape position="1515,0,20" halfExtents="10,5,5" />
+
+
+
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="920,0,60" halfExtents="15,5,5" /> <!-- 3.1 -->
+
+ <BoxCollisionShape position="1000,0,20" halfExtents="5,5,5" /> <!-- 3.4 -->
+
+
+ <BoxCollisionShape position="1180,0,20" halfExtents="5,5,5" /> <!-- 3.10 -->
+ <BoxCollisionShape position="1220,0,60" halfExtents="15,5,5" /> <!-- 3.11 -->
+ <BoxCollisionShape position="1280,0,60" halfExtents="5,5,5" /> <!-- 3.12 -->
+ <BoxCollisionShape position="1310,0,60" halfExtents="5,5,5" /> <!-- 3.15 -->
+ <BoxCollisionShape position="1300,0,20" halfExtents="10,5,5" /> <!-- 3.16 and 3.17-->
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+ <!-- Boden3 -->
+ <Model mesh="Cube2.12.mesh" position="890,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1010,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1130,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1250,0,-30" scale=10 Pitch=90/>
+
+ <Model mesh="Cube2.12.mesh" position="1370,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.2.mesh" position="1490,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.2.mesh" position="1510,0,-30" scale=10 Pitch=90/>
+
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="1205,0,-20" halfExtents="320,5,5" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+ <!-- Luft4 -->
+ <Model mesh="Dreieck.mesh" position="1560,0,-10" scale=10 Roll=90 Pitch=-90 yaw=90/> <!-- L4.1 -->
+
+ <Model mesh="Rohr.mesh" position="1645,5,-35" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L4.2 -->
+
+ <Model mesh="Cube1.1.mesh" position="1690,0,20" scale=10/> <!-- L4.3 -->
+ <Model mesh="Cube1.1.mesh" position="1700,0,20" scale=10/> <!-- L4.4 -->
+
+ <SOBQBlock collisionType="static" type="Coin" position="1710,0,20" mass='-1'> <!-- L4.5 -->
+ <attached>
+ <Model mesh="QCube.mesh" scale=10 pitch=90/>
+ <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBQBlock>
+
+ <Model mesh="Cube1.1.mesh" position="1720,0,20" scale=10/> <!-- L4.6 -->
+ <Model mesh="Rohr.mesh" position="1805,5,-35" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L4.7 -->
+ <Model mesh="Dreieckgross.mesh" position="1850,0,-10" scale=10 pitch=90 /> <!-- L4.8 -->
+
+
+
+
+ <Model mesh="Schloss.mesh" position="2050,40,60" scale=12 pitch=90/> <!-- L4.12 -->
+ <Model mesh="Fahne.mesh" position="1984,-5,88" scale=10 pitch=90/> <!-- L4.11 -->
+ <Model mesh="Fahnenstange.mesh" position="1990,0,95" pitch=90 scale=3/> <!-- L4.10 -->
+ <Model mesh="Fundament.mesh" position="1990,0,-10" scale=10 yaw=180/> <!-- L4.9 -->
+
+
+
+
+ <!-- FLAG -->
+ <SOBFlagstone points = 100 position="1990,0,10" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 200 position="1990,0,20" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 400 position="1990,0,30" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 800 position="1990,0,40" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 1600 position="1990,0,50" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 2200 position="1990,0,60" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 2700 position="1990,0,70" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 3400 position="1990,0,80" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+ <SOBFlagstone points = 4000 position="1990,0,90" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBFlagstone>
+
+
+ <!-- Castlestone -->
+ <SOBCastlestone position="2060,0,-10" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBCastlestone>
+
+ <SOBCastlestone position="2050,40,-10" collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
+ </collisionShapes>
+ </SOBCastlestone>
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="2050,20,-20" halfExtents="5,20,5" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+
+ <BoxCollisionShape position="1690,0,20" halfExtents="5,5,5" /> <!-- 4.3 -->
+ <BoxCollisionShape position="1700,0,20" halfExtents="5,5,5" /> <!-- 4.4 -->
+ <BoxCollisionShape position="1720,0,20" halfExtents="5,5,5" /> <!-- 4.6 -->
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+ <StaticEntity collisionType="static">
+ <collisionShapes>
+
+ <BoxCollisionShape position="1575,0,-10" halfExtents="20,5,5" /> <!-- 4.1-->
+ <BoxCollisionShape position="1570,0,0" halfExtents="15,5,5" />
+ <BoxCollisionShape position="1565,0,10" halfExtents="10,5,5" />
+ <BoxCollisionShape position="1560,0,20" halfExtents="5,5,5" />
+
+ <BoxCollisionShape position="1645,0,-4" halfExtents="12,5,12" /> <!-- 4.2 -->
+
+
+ <BoxCollisionShape position="1805,0,-4" halfExtents="12,5,12" /> <!-- 4.7 -->
+
+ <BoxCollisionShape position="1860,0,-10" halfExtents="45,5,5" /> <!-- 4.8 -->
+ <BoxCollisionShape position="1865,0,0" halfExtents="40,5,5" />
+ <BoxCollisionShape position="1870,0,10" halfExtents="35,5,5" />
+ <BoxCollisionShape position="1875,0,20" halfExtents="30,5,5" />
+ <BoxCollisionShape position="1880,0,30" halfExtents="25,5,5" />
+ <BoxCollisionShape position="1885,0,40" halfExtents="20,5,5" />
+ <BoxCollisionShape position="1890,0,50" halfExtents="15,5,5" />
+ <BoxCollisionShape position="1895,0,60" halfExtents="10,5,5" />
+ <BoxCollisionShape position="1990,0,125" halfExtents="5,5,30" />
+ <BoxCollisionShape position="1940,0,150" halfExtents="45,5,5" />
+
+
+
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+
+
+ //Boden4
+ <Model mesh="Cube2.12.mesh" position="1560,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1680,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1800,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="1920,0,-30" scale=10 Pitch=90/>
+ <Model mesh="Cube2.12.mesh" position="2040,0,-30" scale=10 Pitch=90/>
+
+
+
+ <Model mesh="Cube1.3.mesh" position="1990,10,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="1990,20,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="1990,30,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="1990,40,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="1960,10,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="1980,20,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="1970,20,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="1980,30,-20" scale=10 Pitch=90/>
+
+ <Model mesh="Cube1.1.mesh" position="2000,50,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="2010,50,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="2010,60,-20" scale=10 Pitch=90/>
+
+
+ <Model mesh="Cube1.6.mesh" position="2020,10,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,20,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,30,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,40,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,50,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,60,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2020,70,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2080,10,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2080,20,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2080,30,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2080,40,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.6.mesh" position="2080,50,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="2080,60,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.1.mesh" position="2110,60,-20" scale=10 Pitch=90/>
+ <Model mesh="Cube1.3.mesh" position="2080,70,-20" scale=10 Pitch=90/>
+
+
+
+ <StaticEntity collisionType="static" mass='-1'>
+ <collisionShapes>
+ <BoxCollisionShape position="1855,0,-20" halfExtents="300,5,5" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+
+
+
+
+
+ </Scene>
+ </Level>
+
Modified: code/branches/Presentation_HS17_merge/data/levels/SOB.oxw
===================================================================
--- code/branches/Presentation_HS17_merge/data/levels/SOB.oxw 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/data/levels/SOB.oxw 2018-02-18 15:02:50 UTC (rev 11766)
@@ -14,6 +14,7 @@
?>
+
<Template name=mushroom defaults=0>
<SOBMushroom collisionType="dynamic" speed=30>
<attached>
@@ -47,7 +48,6 @@
-
<Template name=sobFigureTemplate>
<SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic" position="0,0,30">
<attached>
@@ -56,13 +56,40 @@
</attached>
<collisionShapes>
- <BoxCollisionShape position="-2,0,2" halfExtents="3,1,10" />
+ <BoxCollisionShape position="0,0,2" halfExtents="3,1,10" />
</collisionShapes>
</SOBFigure>
+ </Template>
+
+
+ <Template name=fireball>
+ <SOBFireball collisionType="dynamic" speed=90>
+ <attached>
+ <Model mesh="planets/sol.mesh" position="0,0,0" scale=3 pitch=90/>
+
+ <ParticleSpawner source="Orxonox/fire4" startdelay=0 position="-4,0,0" visible="false"/>
+
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape position="0,0,0" radius="3" />
+ </collisionShapes>
+ </SOBFireball>
</Template>
+ <Template name=gumbaShootable>
+ <SOBGumbaBoss collisionType="dynamic" speed=60>
+ <attached>
+ <Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="5,5,3" />
+ </collisionShapes>
+ </SOBGumbaBoss>
+ </Template>
+
+
<Level
plugins = "superorxobros"
gametype = "SOB"
@@ -94,8 +121,11 @@
</MovableEntity>
- <!--Gumba-->
+
+
+
+
<SOBGumba collisionType="dynamic" speed=40 position = "240,0,0">
<attached>
<Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/>
@@ -105,6 +135,7 @@
<BoxCollisionShape position="0,0,0" halfExtents="5,5,3" />
</collisionShapes>
</SOBGumba>
+
<SOBGumba collisionType="dynamic" speed=30 position = "420,0,0">
<attached>
<Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
@@ -192,27 +223,18 @@
</collisionShapes>
</SOBGumba>
- <SOBGumba collisionType="dynamic" speed=30 position = "1750,0,0">
+ <!--GumbaBoss-->
+ <SOBGumbaBoss collisionType="dynamic" speed=20 position = "1750,0,0">
<attached>
- <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
+ <Model mesh="Goomba.mesh" position="0,0,21" scale=6 pitch=90/>
</attached>
<collisionShapes>
- <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
+ <BoxCollisionShape position="0,0,20" halfExtents="10,10,6" />
</collisionShapes>
- </SOBGumba>
+ </SOBGumbaBoss>
+x
- <SOBGumba collisionType="dynamic" speed=20 position = "1770,0,0">
- <attached>
- <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/>
-
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" />
- </collisionShapes>
- </SOBGumba>
-
-
<!--CollisionShape for Gumba-->
<StaticEntity collisionType="static">
<collisionShapes>
@@ -226,11 +248,6 @@
</StaticEntity>
-
-
-
-
-
<!-- Boden 1 -->
<Model mesh="Cube2.12.mesh" position="0,0,-30" scale=10 Pitch=90/> <!-- B1.1 -->
<Model mesh="Cube2.12.mesh" position="120,0,-30" scale=10 Pitch=90/> <!-- B1.2-->
@@ -580,25 +597,10 @@
- <!-- Luft4 -->
+ <!-- Luft4 (BossAbschnitt)-->
<Model mesh="Dreieck.mesh" position="1560,0,-10" scale=10 Roll=90 Pitch=-90 yaw=90/> <!-- L4.1 -->
<Model mesh="Rohr.mesh" position="1645,5,-35" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L4.2 -->
-
- <Model mesh="Cube1.1.mesh" position="1690,0,20" scale=10/> <!-- L4.3 -->
- <Model mesh="Cube1.1.mesh" position="1700,0,20" scale=10/> <!-- L4.4 -->
-
- <SOBQBlock collisionType="static" type="Coin" position="1710,0,20" mass='-1'> <!-- L4.5 -->
- <attached>
- <Model mesh="QCube.mesh" scale=10 pitch=90/>
- <Model mesh="QCube-grey.mesh" scale=10 pitch=90 visible=false/>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="5,5,5" />
- </collisionShapes>
- </SOBQBlock>
-
- <Model mesh="Cube1.1.mesh" position="1720,0,20" scale=10/> <!-- L4.6 -->
<Model mesh="Rohr.mesh" position="1805,5,-35" scale=10 roll=90 yaw=90 pitch=-90 /> <!-- L4.7 -->
<Model mesh="Dreieckgross.mesh" position="1850,0,-10" scale=10 pitch=90 /> <!-- L4.8 -->
@@ -605,7 +607,7 @@
- <Model mesh="Schloss.mesh" position="2050,40,60" scale=12 pitch=90/> <!-- L4.12 -->
+ <Model mesh="Schloss.mesh" position="2050,40,80" scale=15 pitch=90/> <!-- L4.12 -->
<Model mesh="Fahne.mesh" position="1984,-5,88" scale=10 pitch=90/> <!-- L4.11 -->
<Model mesh="Fahnenstange.mesh" position="1990,0,95" pitch=90 scale=3/> <!-- L4.10 -->
<Model mesh="Fundament.mesh" position="1990,0,-10" scale=10 yaw=180/> <!-- L4.9 -->
@@ -681,19 +683,6 @@
-
- <StaticEntity collisionType="static" mass='-1'>
- <collisionShapes>
-
- <BoxCollisionShape position="1690,0,20" halfExtents="5,5,5" /> <!-- 4.3 -->
- <BoxCollisionShape position="1700,0,20" halfExtents="5,5,5" /> <!-- 4.4 -->
- <BoxCollisionShape position="1720,0,20" halfExtents="5,5,5" /> <!-- 4.6 -->
-
-
- </collisionShapes>
- </StaticEntity>
-
-
<StaticEntity collisionType="static">
<collisionShapes>
Modified: code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -78,6 +78,8 @@
}
}
+
+
void Mesh::setCastShadows(bool bCastShadows)
{
this->bCastShadows_ = bCastShadows;
@@ -99,6 +101,17 @@
this->entity_->setMaterialName(name);
}
+ // PRE: a valid Ogre::Entity* entity with a valid subentity at index
+ // POST: changed material of subentity at index to name
+ void Mesh::setSubMaterial(const std::string& name, const int index){
+ if (this->entity_ && this->entity_->getSubEntity(index))
+ {
+ this->entity_->getSubEntity(index)->setMaterialName(name);
+ }
+ else
+ orxout() << "ERROR at Index " << index << endl;
+ }
+
const std::string& Mesh::getMaterial() const
{
if (this->entity_)
Modified: code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/libraries/tools/Mesh.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -49,7 +49,7 @@
void setMaterial(const std::string& name);
const std::string& getMaterial() const;
-
+ void setSubMaterial(const std::string& name, const int index);
void setVisible(bool bVisible);
bool isVisible() const;
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/CMakeLists.txt 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/CMakeLists.txt 2018-02-18 15:02:50 UTC (rev 11766)
@@ -8,9 +8,11 @@
SOBMushroom.cc
SOBHUDInfo.cc
SOBGumba.cc
+ SOBFireball.cc
SOBFlagstone.cc
SOBCastlestone.cc
SOBCoin.cc
+ SOBGumbaBoss.cc
)
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -43,12 +43,13 @@
#include "SOBCenterpoint.h"
#include "SOBFigure.h"
#include "graphics/Camera.h"
+#include "Highscore.h"
namespace orxonox
{
-
+ bool newHighscore=0;
RegisterUnloadableClass(SOB);
/**
@@ -123,7 +124,7 @@
cleanup();
GSLevel::startMainMenu();
Deathmatch::end();
- }
+}
void SOB::restart() {
cleanup();
@@ -166,7 +167,12 @@
//If player has reached end of level
if (this->figure_ != nullptr && figure_->lvlEnded_) {
std::stringstream a;
- a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart";
+ if(!newHighscore){
+ a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart";
+ }
+ else{
+ a << "Congrats, new Highscore! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart";
+ }
info_ =a.str();
//If player has died
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -75,6 +75,9 @@
void addGumba() {
points_+=100;
}
+ void addGumbaBoss() {
+ points_+=5000;
+ }
void addPoints(int poi) {
points_+=poi;
}
@@ -102,6 +105,7 @@
}
WeakPtr<SOBCenterpoint> center_;
+ bool newHighscore;
protected:
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -22,6 +22,8 @@
* Author:
* Julien Kindle
* Co-authors:
+ * Noah Zarro
+ * Theo von Arx
*
*
*/
@@ -38,12 +40,17 @@
#include "graphics/Model.h"
#include "graphics/Camera.h"
#include "graphics/ParticleSpawner.h"
+#include <OgreMath.h>
#include "SOBMushroom.h"
#include "SOBGumba.h"
+#include "SOBGumbaBoss.h"
+#include "SOBFireball.h"
#include "SOB.h"
#include "SOBFlagstone.h"
#include "SOBCastlestone.h"
+#include "SOBFireball.h"
+#include "Highscore.h"
#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
namespace orxonox
@@ -58,29 +65,38 @@
gravityAcceleration_ = 350.0;
//Vars for movement of player
- moveUpPressed_ = false;
- moveDownPressed_ = false;
- moveLeftPressed_ = false;
- moveDownPressed_ = false;
- firePressed_ = false;
- collDisZ_ = 0;
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveDownPressed_ = false;
+ firePressed_ = false;
+ collDisZ_ = 0;
+
//Times and turning
- timeSinceLastFire_ = 0.0;
- lastSpeed_z = 0.0;
- pitch_ = 0.0;
- timeCounter_ = 0;
+ timeSinceLastFire_ = 0.0;
+ lastSpeed_z = 0.0;
+ pitch_ = 0.0;
+ timeCounter_ = 0;
//Properties of player
- gotPowerUp_ = false;
- isColliding_ = true;
- particlespawner_ = NULL;
+ isColliding_ = true;
+ particlespawner_ = NULL;
+
//Properties of players life
- predead_ = false;
- dead_ = false;
- lvlEnded_ = false;
+ predead_ = false;
+ dead_ = false;
+ lvlEnded_ = false;
reachedLvlEndState_ = 0;
+ // Properties concerning PowerUps and items
+ PowerUpCounter_ = 0;
+ maxPowerUp_ = 2;
+ FireballPower = 2;
+ //Properties of fireing Fireballs, NOTE! fireballs are fired with the moveUP Key, not with the fire key
+ fireallowed_ = true;
+ firecooldown_ = 0;
+
setAngularFactor(0.0); //Means player doesn't turn on collision, so he doesn't fall over while walking over the ground
this->enableCollisionCallback(); // Turns on that on every collision function collidesAgainst is executed
@@ -96,47 +112,83 @@
//Orxocast returns object with casted type if otherObject has that class, and if not a nullptr
- SOBMushroom* mush = orxonox_cast<SOBMushroom*>(otherObject);
- SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject);
- SOBFlagstone* flagstone = orxonox_cast<SOBFlagstone*>(otherObject);
- SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*>(otherObject);
+ SOBMushroom* mush = orxonox_cast<SOBMushroom*> (otherObject);
+ SOBGumba* gumba = orxonox_cast<SOBGumba*> (otherObject);
+ SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*> (otherObject);
+ SOBFlagstone* flagstone = orxonox_cast<SOBFlagstone*> (otherObject);
+ SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*> (otherObject);
+ SOBFireball* fireball = orxonox_cast<SOBFireball*> (otherObject);
+ SOB* SOBGame = orxonox_cast<SOB*> (getGametype());
- //Check if otherObject is a powerup
+
+ //Check if otherObject is a powerup-mushroom
if (mush != nullptr && !(mush->hasCollided_)) {
otherObject->destroyLater();
- gotPowerUp_ = true;
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); //Get the Gametype
+
+ PowerUpCounter_++;
+ if(PowerUpCounter_ > maxPowerUp_) PowerUpCounter_ = maxPowerUp_; // you had already the max
+ else this->changeClothes();
+
SOBGame->addMushroom(); // Tell the gametype to increase points
mush->hasCollided_ = true; // needed because of destroyLater takes some time and player should receive points only once
+
+
+ }
+
+
//Check if otherObject is a Gumba (that walking enemies)
- } else if (gumba != nullptr && !(gumba->hasCollided_)) {
- //If player jumps on its head, kill it, else, kill the player
+ else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {
+
+ //If player jumps on its head, kill the Gumba, else, kill the player
if (getVelocity().z >= -20) {
- Vector3 vel = getVelocity();
- vel.y = -80;
- vel.z = 200;
- setVelocity(vel);
- predead_=true;
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
- SOBGame->setDone(true);
+ // If player hasn't a power up, he dies. Else he shrinks and the gumba dies.
+ if(PowerUpCounter_ == 0){
+ this->die();
+ }
+ else{
+ PowerUpCounter_--;
+ this->changeClothes();
+ gumba->destroyLater();
+ gumba->hasCollided_ = true;
+ }
+
} else {
gumba->destroyLater();
gumba->hasCollided_ = true;
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
SOBGame->addGumba();
+ }
}
- }
+ else if (gumbaBoss != nullptr && !(gumbaBoss->hasCollided_)) {
+ if (getVelocity().z >= -20) {
+ // If player hasn't a power up, he dies. Else he dies directly.
+ this->die();
+ }
+ else {
+ gumbaBoss->destroyLater();
+ gumbaBoss->hasCollided_ = true;
+ SOBGame->addGumbaBoss();
+ }
+ }
+ else if (fireball != nullptr && !(fireball->hasCollided_)){
+ if(PowerUpCounter_ == 0){
+ this->die();
+ }
+ PowerUpCounter_--;
+ this->changeClothes();
+ fireball->destroyLater();
+ }
+
//Purpose is that if player hits the flag, he should walk into the castle at the end of the level. For that we use SOBCastlestone
if (reachedLvlEndState_ == 0 && flagstone != nullptr && !(flagstone->hasCollided_)) {
flagstone->hasCollided_ = true;
reachedLvlEndState_ = 1;
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+
SOBGame->setDone(true);
SOBGame->addPoints(flagstone->getPoints());
@@ -158,6 +210,32 @@
return 1;
}
+//Function to spawn the Fireball
+void SOBFigure::spawnFireball() {
+ SOBCenterpoint* center_ = ((SOB*)getGametype())->center_;
+
+ SOBFireball* ball = new SOBFireball(center_->getContext());
+ Vector3 spawnpos = this->getWorldPosition();
+ spawnpos.z += 0;
+
+ if (ball != nullptr && center_ != nullptr)
+ {
+ ball->addTemplate("fireball");
+ bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6));
+ ball->setDirection(direction);
+ if(direction)
+ {
+ spawnpos.x+=10;
+ }
+ else
+ {
+ spawnpos.x-=10;
+ }
+ ball->setPosition(spawnpos);
+
+ }
+ }
+
//For those of you who don't have an idea: the tick function is called about 50 times/sec
void SOBFigure::tick(float dt)
{
@@ -165,6 +243,7 @@
bool inputAllowed = true;
+ //SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
//the particle spawner that generates the fire from the backpack when pressed
if (particlespawner_ == NULL) {
@@ -173,7 +252,9 @@
if (object->isA(Class(ParticleSpawner)))
particlespawner_ = object;
}
+
}
+
//Behavior on level end - this is like described above for the movement from the player when hit the flag. He moves then into the castle
@@ -189,10 +270,10 @@
//if input blocked, then cancel every movement operation
if (!inputAllowed) {
- moveUpPressed_ = false;
- moveDownPressed_ = false;
- moveLeftPressed_ = false;
- moveRightPressed_ = false;
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveRightPressed_ = false;
}
//set the gravityto standard 350
@@ -203,6 +284,7 @@
if (hasLocalController())
{
+ SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
Vector3 velocity = getVelocity();
Vector3 position = getPosition();
@@ -211,7 +293,6 @@
//If player falls in a hole
if (position.z < -100) {
dead_ = true;
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
SOBGame->setDone(true);
}
@@ -220,7 +301,7 @@
velocity.x = 0;
velocity.z = 0;
setVelocity(velocity);
- SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+
if (firePressed_)
SOBGame->restart();
return;
@@ -241,12 +322,12 @@
particlespawner_->setVisible(true);
else
particlespawner_->setVisible(false);
+
-
//If player hits space and collides against an object under him then jump
- if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 7.75 && collDisZ_ <+ 8.25)) {
- gravityAcceleration_ = 100.0;
- velocity.z = 110;
+ if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 0 && collDisZ_ <+ 10)) {
+ gravityAcceleration_ = 350;
+ velocity.z = 175;
}
@@ -273,7 +354,24 @@
velocity.x /= 1.1;
}
+ //If moveUp pressed, fire a fireball
+ if(moveUpPressed_ && (PowerUpCounter_ >= FireballPower) && fireallowed_)
+ {
+ spawnFireball();
+ fireallowed_ = false;
+ firecooldown_ = 0;
+ }
+ //Increase the firecooldown
+ if(firecooldown_> 0.5)
+ {
+ fireallowed_ = true;
+ }
+ if(!fireallowed_)
+ {
+ firecooldown_ += dt;
+ }
+
//Again another EndOfLevel behavior
if (reachedLvlEndState_ == 1)
velocity.x = -2;
@@ -282,8 +380,17 @@
if (reachedLvlEndState_ == 3) {
velocity.x = 0;
velocity.y = 20;
+ setOrientation(Vector3::UNIT_Z, Degree(90));
}
if (reachedLvlEndState_ == 4) {
+ //Highscore
+ if (Highscore::exists()){
+ int score = SOBGame->getPoints();
+ if(score > Highscore::getInstance().getHighestScoreOfGame("Super Orxo Bros."))
+ Highscore::getInstance().storeHighscore("Super Orxo Bros.",score);
+ SOBGame->newHighscore=1;
+
+ }
lvlEnded_ = true;
dead_ = true;
}
@@ -306,18 +413,13 @@
cam->setPosition(campos);
}
-
-
-
}
-
-
// Reset key variables
- moveUpPressed_ = false;
- moveDownPressed_ = false;
- moveLeftPressed_ = false;
- moveRightPressed_ = false;
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveRightPressed_ = false;
isColliding_ = false;
collDisZ_ = 0;
@@ -363,4 +465,35 @@
}
+
+// PRE: name is an existing name of a material. Example orxo_material for orxo_material.material in data_extern/materials
+// !!! PowerUpCounter_ has to be modified before changing the clothes!!!
+// POST: clothes of body of player are changed to name
+void SOBFigure::changeClothes(){
+ // clothes: white (basic), red (one PowerUp), orange (Fireball enabled)
+ std::string clothes[] = {"orxo_material", "orxo_material_gross", "orxo_material_fire"};
+
+ std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
+ std::set<WorldEntity*>::iterator it;
+ for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it)
+ {
+ Model* FiguresModel = orxonox_cast<Model*>(*it);
+ if (FiguresModel != nullptr)
+ {
+ FiguresModel->setSubMaterial(clothes[PowerUpCounter_] , 4); // 4 is the body
+ }
+ }
}
+// PRE:
+// POST: Player jumps out of the game, game is finished and can be restarted.
+void SOBFigure::die(){
+ Vector3 vel = getVelocity();
+ vel.y = -80;
+ vel.z = 200;
+ setVelocity(vel);
+ predead_= true;
+ SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+ SOBGame->setDone(true);
+}
+
+}
\ No newline at end of file
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -45,6 +45,9 @@
virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down.
virtual void boost(bool boost) override;
virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+ void changeClothes();
+ void spawnFireball();
+ void die();
bool dead_;
bool predead_;
@@ -53,7 +56,8 @@
private:
//Soooo many declarations
- bool gotPowerUp_;
+ bool fireallowed_;
+
bool moveUpPressed_;
bool moveDownPressed_;
bool moveLeftPressed_;
@@ -62,10 +66,14 @@
float gravityAcceleration_;
float timeSinceLastFire_;
float lastSpeed_z;
+ float firecooldown_;
SOBCenterpoint* sobcenterpoint;
float pitch_;
bool isColliding_;
WorldEntity* particlespawner_;
+ int PowerUpCounter_;
+ int maxPowerUp_;
+ int FireballPower;
int sgn(float x);
int reachedLvlEndState_;
float timeCounter_;
Copied: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.cc (from rev 11765, code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc)
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.cc (rev 0)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -0,0 +1,209 @@
+ /*
+ * 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:
+ * Theo von Arx
+ * Noah Zarro
+ * Co-authors:
+ *
+ *
+ */
+
+/**
+ @file SOBFireball.cc
+ @brief Fireballs are the Projectile of the Fireflower Powerup
+*/
+
+#include "SOBFireball.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "SOBFigure.h"
+#include "SOBGumba.h"
+#include "SOBGumbaBoss.h"
+#include "SOB.h"
+#include "util/Output.h"
+#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+#include "graphics/ParticleSpawner.h"
+
+
+
+
+namespace orxonox
+{
+ RegisterClass(SOBFireball);
+
+ SOBFireball::SOBFireball(Context* context) : MovableEntity(context)
+ {
+ RegisterObject(SOBFireball);
+
+ attachedToFigure_ = false;
+ setAngularFactor(0.0);
+ figure_ = nullptr;
+ this->enableCollisionCallback();
+ gravityAcceleration_ = 350.0;
+
+ speed_ = 0;
+ hasCollided_=false;
+ lastPos_ = getPosition();
+ lastPos_.x -= 20;
+ changeAllowed_ = true;
+ changedOn_ = 0.0;
+ goesRight_ = true;
+ collDisX_ = 0;
+ collDisZ_ = 0;
+ hitCounter_ = 0;
+ particlespawner_ = NULL ;
+
+
+
+
+
+ }
+
+
+
+ void SOBFireball::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SOBFireball, XMLPort, xmlelement, mode);
+ XMLPortParam(SOBFireball, "speed", setSpeed, getSpeed, xmlelement, mode);
+
+
+ }
+
+ void SOBFireball::setDirection(const bool direction)
+ {
+ if(direction)
+ {
+ goesRight_=true;
+ }
+ else
+ {
+ goesRight_=false;
+ }
+ }
+
+
+ bool SOBFireball::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
+ collDisX_ = getPosition().x - contactPoint.getPositionWorldOnB().getX();
+ collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ();
+
+ SOBGumba* gumba = orxonox_cast<SOBGumba*> (otherObject);
+ SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*> (otherObject);
+
+ if(gumbaBoss != nullptr && !(gumba->hasCollided_)) //Fireballs can't destroy GumbaBosses, they get destroyed themselves instead
+ {
+ this->destroyLater();
+ this->hasCollided_ = true;
+ }
+
+
+ if(gumba!=nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) //if other object is a Gumba, kill the Gumba and add score and destroy the fireball
+ {
+ gumba->destroyLater();
+ gumba->hasCollided_ = true;
+ SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
+ SOBGame->addGumba();
+ this->destroyLater();
+ this->hasCollided_ = true;
+ }
+
+
+ //collision with either top or bottom of a block
+ else if(changeAllowed_ && (abs(collDisX_)<=abs(collDisZ_)))
+ {
+ changeAllowed_ = false;
+ Vector3 velocity = getVelocity();
+ velocity.z = -velocity.z;
+
+
+ setVelocity(velocity);
+ }
+
+ //collision with the vertical side of a block
+ else if(changeAllowed_ && (abs(collDisX_)>abs(collDisZ_)))
+ {
+ changeAllowed_ = false;
+ goesRight_=!goesRight_;
+ }
+
+ hitCounter_++;
+
+ collDisZ_=0;
+ collDisX_=0;
+
+ return true;
+ }
+
+
+ void SOBFireball::setFigure(SOBFigure* newFigure)
+ {
+ figure_ = newFigure;
+ }
+
+
+
+ void SOBFireball::tick(float dt)
+ {
+ SUPER(SOBFireball, tick, dt);
+
+ //the particle spawner that generates the fire from the backpack when pressed
+ if (particlespawner_ == NULL) {
+ for (WorldEntity* object : this->getAttachedObjects())
+ {
+ if (object->isA(Class(ParticleSpawner)))
+ particlespawner_ = object;
+ }
+
+ }
+
+ if(particlespawner_ != NULL)
+ particlespawner_->setVisible(true);
+ if (!changeAllowed_) {
+ changedOn_+= dt;
+ // After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions!
+ if (changedOn_> 0.2) {
+ changeAllowed_ = true;
+ changedOn_ = 0.0;
+
+ }
+
+ }
+ int dir = 1;
+ if (!goesRight_)
+ dir = -1;
+
+ Vector3 velocity = getVelocity();
+ velocity.z -= gravityAcceleration_*dt;
+ velocity.x = dir*speed_;
+ velocity.y = 0;
+ if(hitCounter_ >= 3) velocity.y = 0.1*speed_;
+ setVelocity(velocity);
+
+ lastPos_ = getPosition();
+
+ if(abs(this->getPosition().z) > 1000) delete this;
+
+ }
+
+
+
+}
Copied: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.h (from rev 11765, code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h)
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.h (rev 0)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -0,0 +1,85 @@
+/*
+ * 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:
+ * Theo von Arx
+ Noah Zarro
+ * Co-authors:
+ *
+ *
+ */
+
+/**
+ @file SOBFireball.h
+ @brief Declaration of the SOBFireball class. Fireballs are the Projectile of the Fireflower Powerup
+ @ingroup SOB
+*/
+
+#ifndef _SOBFireball_H__
+#define _SOBFireball_H__
+
+#include "superorxobros/SOBPrereqs.h"
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+ class _SOBExport SOBFireball : public MovableEntity
+ {
+ public:
+ SOBFireball(Context* context);
+ virtual ~SOBFireball() {}
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+ virtual void setFigure(SOBFigure* newFigure);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+ virtual void tick(float dt) override;
+ void setDirection(const bool direction);
+
+ bool attachedToFigure_;
+
+ void setSpeed(const float speed)
+ { this->speed_ = speed; }
+ float getSpeed() const
+ { return speed_; }
+
+ bool hasCollided_;
+ protected:
+ float gravityAcceleration_;
+ float speed_;
+ WeakPtr<SOBFigure> figure_;
+ Vector3 lastPos_;
+ bool goesRight_;
+ bool changeAllowed_;
+ float changedOn_;
+ int hitCounter_;
+ WorldEntity* particlespawner_;
+
+
+
+
+ float collDisX_;
+ float collDisZ_;
+
+ };
+}
+
+#endif /* _SOBFireball_H__ */
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFlagstone.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFlagstone.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFlagstone.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -28,7 +28,8 @@
/**
@file SOBFlagstone.h
- @brief Declaration of the SOBFlagstone class. This class is used for the flag - for everz 10x10x10 stone we added a flagstone with different points. The higher you touch the flag, the more points you get.
+ @brief Declaration of the SOBFlagstone class.
+ This class is used for the flag - for every 10x10x10 stone we added a flagstone with different points. The higher you touch the flag, the more points you get.
@ingroup SOB
*/
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -59,6 +59,9 @@
lastPos_.x -= 20;
changeAllowed_ = true;
changedOn_ = 0.0;
+ creator_ = nullptr;
+ maxLifetime_ = 10;
+ lifetime_ = 0;
}
@@ -90,7 +93,23 @@
figure_ = newFigure;
}
+ void SOBGumba::setDirection(const bool direction)
+ {
+ if(direction)
+ {
+ goesRight_=true;
+ }
+ else
+ {
+ goesRight_=false;
+ }
+ }
+ void SOBGumba::die(){
+ Vector3 velocity = this->getVelocity();
+ velocity.y = speed_;
+ this->setVelocity(velocity);
+ }
void SOBGumba::tick(float dt)
{
@@ -99,13 +118,13 @@
if (!changeAllowed_) {
changedOn_+= dt;
// After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions!
- if (changedOn_> 0.200) {
+ if (changedOn_> 0.400) {
changeAllowed_ = true;
changedOn_ = 0.0;
}
}
-
+
int dir = 1;
if (!goesRight_)
@@ -112,12 +131,26 @@
dir = -1;
Vector3 velocity = getVelocity();
+ if(velocity.z > -1 && velocity.z < 1)
+ {
+ velocity.x = dir*speed_;
+ }
+
velocity.z -= gravityAcceleration_*dt;
- velocity.x = dir*speed_;
setVelocity(velocity);
lastPos_ = getPosition();
- }
+ if (creator_ != nullptr)
+ {
+ lifetime_ += dt;
+ if(lifetime_>maxLifetime_)
+ {
+
+ }
+ }
+ if(abs(this->getPosition().z) > 1000) delete this;
+
+ }
}
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -50,6 +50,8 @@
virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
virtual void tick(float dt) override;
+ void setDirection(const bool direction);
+ void die();
bool attachedToFigure_;
@@ -59,6 +61,7 @@
{ return speed_; }
bool hasCollided_;
+ SOBGumbaBoss* creator_;
protected:
float gravityAcceleration_;
float speed_;
@@ -67,6 +70,9 @@
Vector3 lastPos_;
bool changeAllowed_;
float changedOn_;
+ float maxLifetime_;
+ float lifetime_;
+
};
}
Copied: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.cc (from rev 11765, code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc)
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.cc (rev 0)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -0,0 +1,189 @@
+/*
+ * 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:
+ * Noah Zarro
+ * Theo von Arx
+ * Co-authors:
+ *
+ *
+ */
+
+/**
+ @file SOBGumbaBoss.cc
+ @brief A Boss Gumba, which shoots small Gumbas
+**/
+
+#include "SOB.h"
+#include "SOBGumba.h"
+#include "SOBGumbaBoss.h"
+#include "SOBFireball.h"
+#include "SOBFigure.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Output.h"
+#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+
+
+
+namespace orxonox
+{
+ RegisterClass(SOBGumbaBoss);
+
+ SOBGumbaBoss::SOBGumbaBoss(Context* context) : SOBGumba(context)
+ {
+ RegisterObject(SOBGumbaBoss);
+
+ gumbaMaxTime_ = 1; // time after which a Gumba is shot
+ gumbaTime_ = 0; // time since last gumba was shot
+ maxGumbas_ = 50; // Max Gumbas spawnable by a Boss
+ jumpTimeMax_ = 5; // time after which the gumba boss jumps
+ jumpTime_ = 0; // time since last jump of gumba boss
+
+ }
+
+ // PRE: otherObject collides with this.
+ // POST: collision is handled: velocity changed, small gumbas murdered
+ bool SOBGumbaBoss::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
+
+ SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject);
+ SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*>(otherObject);
+
+ // if boss collides with small gumbas, destroy them.
+ if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {
+ gumba->die();
+ }
+
+
+ //Every object with mass -1 does not change the direction of the GumbaBoss. For example the ground floor! The other objects switch the direction of the GumbaBoss.
+ else if (changeAllowed_ && otherObject->getMass() != -1) {
+ goesRight_ = !goesRight_;
+ changeAllowed_ = false;
+ }
+
+ return true;
+ }
+
+
+
+ // POST: done what was to do in a time dt
+ void SOBGumbaBoss::tick(float dt)
+ {
+ SUPER(SOBGumbaBoss, tick, dt);
+
+ // increase timers:
+ gumbaTime_ += dt;
+ jumpTime_ += dt;
+
+ // set y-component of position of gumba boss to 0, so he doesn't fall in to the nothing
+ Vector3 position = getPosition();
+ position.y = 0;
+ setPosition(position);
+
+
+ if (!changeAllowed_) {
+ changedOn_+= dt;
+ // After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions!
+ if (changedOn_> 0.200) {
+ changeAllowed_ = true;
+ changedOn_ = 0.0;
+
+ }
+ }
+
+
+ if(gumbaTime_ > gumbaMaxTime_){ //Spawn Gumba
+ int gumbaCounter=0;
+
+ for (SOBGumba* gumbaInstance : ObjectList<SOBGumba>())
+ {
+ if (gumbaInstance != nullptr && gumbaInstance->creator_==this)
+ {
+ gumbaCounter++;
+ }
+ }
+
+
+ if(gumbaCounter<maxGumbas_){ //only maxGumbas are allowed at one time per Gumbaboss
+ spawnGumba();
+ gumbaTime_ = 0;
+ }
+ }
+
+ int dir = 1;
+ if (!goesRight_)
+ dir = -1;
+
+ //
+ if(getPosition().x < 1640)
+ dir = 1;
+ else if (getPosition().x > 1750)
+ dir = -1;
+
+ //change velocity
+ Vector3 velocity = getVelocity();
+ if(jumpTime_ > jumpTimeMax_){ // jump if the time has come.
+ velocity.z = speed_*15;
+ jumpTime_ = 0;
+ }
+ else{
+ velocity.z -= gravityAcceleration_*dt;
+ }
+ velocity.x = dir*speed_;
+ setVelocity(velocity);
+
+ lastPos_ = getPosition();
+
+ }
+
+ // spawn gumbas
+ void SOBGumbaBoss::spawnGumba() {
+ SOBCenterpoint* center_ = ((SOB*)getGametype())->center_;
+
+ SOBGumba* gumba = new SOBGumba(center_->getContext());
+ Vector3 spawnpos = this->getWorldPosition();
+ gumba->creator_=this;
+
+ // we can shoot a gumba!
+ if (gumba != nullptr && center_ != nullptr)
+ {
+ gumba->addTemplate("gumbaShootable");
+ gumba->setDirection(goesRight_);
+ if(goesRight_)
+ {
+ spawnpos.x+=20;
+ }
+ else
+ {
+ spawnpos.x-=20;
+ }
+ spawnpos.z+=15;
+ gumba->setPosition(spawnpos);
+
+ }
+
+ Vector3 velocity = gumba->getVelocity();
+ velocity.x += (2*goesRight_ -1) * 100;
+ velocity.z += 200;
+ gumba->setVelocity(velocity);
+ }
+}
Copied: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.h (from rev 11765, code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.h)
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.h (rev 0)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -0,0 +1,68 @@
+/*
+ * 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:
+ * Noah Zarro
+ * Theo von Arx
+ * Co-authors:
+ *
+ *
+ */
+
+/**
+ @file SOBGumbaBoss.h
+ @brief Declaration of the SOBGumbaBoss class. GumbaBosss are the enemie mushrooms - pretty sure it's written Goomba but, naaah
+ @ingroup SOB
+*/
+
+#ifndef _SOBGumbaBoss_H__
+#define _SOBGumbaBoss_H__
+
+#include "superorxobros/SOBPrereqs.h"
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+ class _SOBExport SOBGumbaBoss : public SOBGumba
+ {
+ public:
+ SOBGumbaBoss(Context* context);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+ virtual void tick(float dt) override;
+
+ void spawnGumba();
+
+
+ protected:
+ float gumbaTime_;
+ float gumbaMaxTime_;
+ float jumpTimeMax_;
+ float jumpTime_;
+ int maxGumbas_;
+
+
+
+
+ };
+}
+
+#endif /* _SOBGumbaBoss_H__ */
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBPrereqs.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBPrereqs.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBPrereqs.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -75,6 +75,7 @@
class SOBMushroom;
class SOBHUDInfo;
class SOBGumba;
+ class SOBGumbaBoss;
class SOBFlagstone;
class SOBCastlestone;
class SOBCoin;
Modified: code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBQBlock.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBQBlock.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBQBlock.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -38,7 +38,9 @@
#include "SOB.h"
#include "SOBMushroom.h"
#include "SOBCoin.h"
+#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+
namespace orxonox
{
RegisterClass(SOBQBlock);
@@ -61,7 +63,8 @@
//If you hit the QBlock, the visibility of all attached objects get inverted! Pretty easy way to create changing blocks :)
float v_z = otherObject->getVelocity().z;
- if (!used_ && v_z > 50.0) {
+ int collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ();
+ if (!used_ && v_z > 50.0 && collDisZ_ > 0) {
used_ = true;
for (WorldEntity* object : this->getAttachedObjects())
Modified: code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.cc
===================================================================
--- code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.cc 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.cc 2018-02-18 15:02:50 UTC (rev 11766)
@@ -1,3 +1,4 @@
+
/*
* ORXONOX - the hottest 3D action shooter ever to exist
* > www.orxonox.net <
@@ -40,6 +41,7 @@
#include "graphics/MeshLodInformation.h"
#include "Level.h"
+
namespace orxonox
{
RegisterClass(Model);
@@ -155,6 +157,13 @@
this->mesh_.setMaterial(this->materialName_);
}
+ // PRE: a valid Ogre::Entity* entity with a valid subentity at index
+ // POST: changed material of subentity at index to name
+ void Model::setSubMaterial(const std::string& name, const int index){
+ this->mesh_.setSubMaterial(name, index);
+ }
+
+
void Model::changedShadows()
{
this->mesh_.setCastShadows(this->bCastShadows_);
Modified: code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.h
===================================================================
--- code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.h 2018-02-18 00:32:05 UTC (rev 11765)
+++ code/branches/Presentation_HS17_merge/src/orxonox/graphics/Model.h 2018-02-18 15:02:50 UTC (rev 11766)
@@ -85,6 +85,9 @@
inline const std::string& getMaterial() const
{ return this->materialName_; }
+ void setSubMaterial(const std::string& name, const int index);
+
+
protected:
/**
@brief
More information about the Orxonox-commit
mailing list