[Orxonox-commit 5354] r10017 - in code/branches/pickupsFS14: data/levels data/levels/templates src src/modules/jump

fvultier at orxonox.net fvultier at orxonox.net
Thu Apr 3 14:35:55 CEST 2014


Author: fvultier
Date: 2014-04-03 14:35:54 +0200 (Thu, 03 Apr 2014)
New Revision: 10017

Added:
   code/branches/pickupsFS14/data/levels/templates/spaceshipJump.oxt
   code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc
   code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h
Modified:
   code/branches/pickupsFS14/data/levels/Jump.oxw
   code/branches/pickupsFS14/src/Orxonox.cc
   code/branches/pickupsFS14/src/modules/jump/CMakeLists.txt
   code/branches/pickupsFS14/src/modules/jump/Jump.cc
   code/branches/pickupsFS14/src/modules/jump/JumpCenterPoint.cc
   code/branches/pickupsFS14/src/modules/jump/JumpShip.cc
   code/branches/pickupsFS14/src/modules/jump/JumpShip.h
Log:
Steuerung funktioniert

Modified: code/branches/pickupsFS14/data/levels/Jump.oxw
===================================================================
--- code/branches/pickupsFS14/data/levels/Jump.oxw	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/data/levels/Jump.oxw	2014-04-03 12:35:54 UTC (rev 10017)
@@ -10,13 +10,14 @@
 ?>
 
 <?lua
-  include("templates/spaceshipAssff2.oxt")
-  include("templates/spaceshipPirate.oxt")
-  include("templates/spaceshipInvader.oxt")
-  include("templates/enemyInvader.oxt")
-  include("overlays/InvaderHUD.oxo")
+  -- include("templates/spaceshipAssff2.oxt")
+  -- include("templates/spaceshipPirate.oxt") 
+  include("templates/spaceshipJump.oxt")
+  -- include("templates/enemyInvader.oxt")
+  -- include("overlays/InvaderHUD.oxo")
 ?>
 
+
 <Level gametype = Jump>
   <templates>
     <Template link=lodtemplate_default />
@@ -34,48 +35,67 @@
       playOnLoad="true"
     />
   
+    <Planet
+      position="0, 0, -2000"
+      scale="1000"
+      collisionType="dynamic"
+      linearDamping="0.8"
+      angularDamping="0"
+      mass="10000000"
+      pitch="0"
+      mesh="planets/muunilinst.mesh"
+      atmosphere="atmosphere1"
+      rotationaxis="1,0,0"
+      rotationrate="1.0"
+      atmospheresize="80.0f"
+      imagesize="1024.0f"
+      collisiondamage = 2
+      enablecollisiondamage = true
+    >
 
+    </Planet>
+
+
+
     <!-- <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="1100, 11000, -7000" lookat="0, 0, 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=JumpShip pawndesign=spaceshipinvader />
-<!--
-    <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+    <SpawnPoint team=0 position="0,0,0" lookat="0,0,-1" spawnclass=JumpShip pawndesign=spaceshipjump />
 
+    
 
+
     <JumpCenterPoint name=jumpcenter />
 
     
     <?lua
-      for i = 1, 300, 1 do
+      for i = 1, 200, 1 do
         j = math.random()
     ?>
 
     <MovableEntity
-      position = "<?lua print(math.random()* 40000 + 1000) ?>,-1000,<?lua print(math.random() * 4000 - 2000) ?>"
+      position = "<?lua print(math.random(-300,300)) ?>,<?lua print(math.random(-250,10000)) ?>,-300>"
       collisionType = dynamic
       linearDamping = 0.8
       angularDamping = 0
-      scale = "<?lua print(j * 150)?>"
+      scale = "10"
       collisiondamage = 0
-      enablecollisiondamage = true
+      enablecollisiondamage = no
+
     >
       <attached>
         <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
       </attached>
-      <collisionShapes>
-        <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
-      </collisionShapes>
+
     </MovableEntity>
 
     <?lua
       end
     ?>
 
-  -->
+  
     
   </Scene>
-</Level>
-
+</Level>
\ No newline at end of file

Added: code/branches/pickupsFS14/data/levels/templates/spaceshipJump.oxt
===================================================================
--- code/branches/pickupsFS14/data/levels/templates/spaceshipJump.oxt	                        (rev 0)
+++ code/branches/pickupsFS14/data/levels/templates/spaceshipJump.oxt	2014-04-03 12:35:54 UTC (rev 10017)
@@ -0,0 +1,115 @@
+<Template name=spaceshipjump>
+  <JumpShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipescortcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 4
+
+   health            = 80
+   maxhealth         = 200
+   initialhealth     = 80
+
+   shieldhealth        = 35
+   initialshieldhealth = 35
+   maxshieldhealth     = 60
+   shieldabsorption    = 0.9
+   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.7
+   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")
+?>
+  </JumpShip>
+</Template>
+
+
+<Template name=spaceshipescortcameras defaults=0>
+  <JumpShip>
+    <camerapositions>
+      <CameraPosition position="0,0,200" direction="0, 0, -1" drag=false mouselook=true />
+    </camerapositions>
+  </JumpShip>
+</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>

Modified: code/branches/pickupsFS14/src/Orxonox.cc
===================================================================
--- code/branches/pickupsFS14/src/Orxonox.cc	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/Orxonox.cc	2014-04-03 12:35:54 UTC (rev 10017)
@@ -27,6 +27,8 @@
  *
  */
 
+
+
 /**
 @file
 @brief

Modified: code/branches/pickupsFS14/src/modules/jump/CMakeLists.txt
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/CMakeLists.txt	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/modules/jump/CMakeLists.txt	2014-04-03 12:35:54 UTC (rev 10017)
@@ -3,6 +3,7 @@
   Jump.cc
   JumpCenterPoint.cc
   JumpShip.cc
+  JumpPlatform.cc
 END_BUILD_UNIT
 )
 

Modified: code/branches/pickupsFS14/src/modules/jump/Jump.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/Jump.cc	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/modules/jump/Jump.cc	2014-04-03 12:35:54 UTC (rev 10017)
@@ -45,6 +45,7 @@
 
 #include "JumpCenterPoint.h"
 #include "JumpShip.h"
+#include "JumpPlatform.h"
 /*
 #include "JumpEnemy.h"
 #include "JumpEnemyShooter.h"*/

Modified: code/branches/pickupsFS14/src/modules/jump/JumpCenterPoint.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpCenterPoint.cc	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/modules/jump/JumpCenterPoint.cc	2014-04-03 12:35:54 UTC (rev 10017)
@@ -69,4 +69,6 @@
             jumpGametype->setCenterpoint(this);
         }
     }
+
+
 }

Added: code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc	                        (rev 0)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc	2014-04-03 12:35:54 UTC (rev 10017)
@@ -0,0 +1,334 @@
+/*
+ *   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:
+ *      Benjamin de Capitani
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "JumpPlatform.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/command/Executor.h"
+#include "tools/ParticleInterface.h"
+#include "Scene.h"
+#include "graphics/ParticleSpawner.h"
+#include "graphics/Model.h"
+#include "MovableEntity.h"
+
+namespace orxonox
+{
+    RegisterClass(JumpPlatform);
+
+    JumpPlatform::JumpPlatform(Context* context) : MobileEntity(context)
+    {
+        RegisterObject(JumpPlatform);
+        /*
+        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
+
+        this->bStop_ = false;
+        this->LOD_ = LODParticle::Normal;
+
+        if ( GameMode::showsGraphics() )
+        {
+            try
+            {
+                this->init();
+            }
+            catch (const std::exception& ex)
+            {
+                orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
+                this->initZero();
+            }
+        }
+        else
+        {
+            this->initZero();
+        }
+
+        if (GameMode::isMaster())
+        {
+            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
+        }
+
+        this->registerVariables();
+        */
+    }
+
+    /*void BigExplosion::init()
+    {
+        this->debrisEntity1_ = new MovableEntity(this->getContext());
+        this->debrisEntity2_ = new MovableEntity(this->getContext());
+        this->debrisEntity3_ = new MovableEntity(this->getContext());
+        this->debrisEntity4_ = new MovableEntity(this->getContext());
+
+        this->debrisEntity1_->setSyncMode(0);
+        this->debrisEntity2_->setSyncMode(0);
+        this->debrisEntity3_->setSyncMode(0);
+        this->debrisEntity4_->setSyncMode(0);
+
+        this->debris1_ = new Model(this->getContext());
+        this->debris2_ = new Model(this->getContext());
+        this->debris3_ = new Model(this->getContext());
+        this->debris4_ = new Model(this->getContext());
+
+        this->debris1_->setSyncMode(0);
+        this->debris2_->setSyncMode(0);
+        this->debris3_->setSyncMode(0);
+        this->debris4_->setSyncMode(0);
+
+        this->explosion_ = new StaticEntity(this->getContext());
+        this->explosion_->setSyncMode(0);
+
+        this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke2_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke3_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke4_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+
+        this->debrisFire1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire2_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire3_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire4_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+
+        this->debris1_->attachOgreObject(this->debrisSmoke1_->getParticleSystem());
+        this->debris1_->attachOgreObject(this->debrisFire1_->getParticleSystem());
+        this->debris2_->attachOgreObject(this->debrisSmoke2_->getParticleSystem());
+        this->debris2_->attachOgreObject(this->debrisFire2_->getParticleSystem());
+        this->debris3_->attachOgreObject(this->debrisSmoke3_->getParticleSystem());
+        this->debris3_->attachOgreObject(this->debrisFire3_->getParticleSystem());
+        this->debris4_->attachOgreObject(this->debrisSmoke4_->getParticleSystem());
+        this->debris4_->attachOgreObject(this->debrisFire4_->getParticleSystem());
+
+        this->debris1_->setMeshSource("CockpitDebris.mesh");
+        this->debris2_->setMeshSource("WingDebris1.mesh");
+        this->debris3_->setMeshSource("BodyDebris1.mesh");
+        this->debris4_->setMeshSource("WingDebris2.mesh");
+
+        this->debrisEntity1_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity1_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity1_->setScale(4);
+
+        this->debrisEntity2_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity2_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity2_->setScale(4);
+
+        this->debrisEntity3_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity3_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity3_->setScale(4);
+
+        this->debrisEntity4_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity4_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity4_->setScale(4);
+
+        this->debrisEntity1_->attach(debris1_);
+        this->debrisEntity2_->attach(debris2_);
+        this->debrisEntity3_->attach(debris3_);
+        this->debrisEntity4_->attach(debris4_);
+
+        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+        effect->setDestroyAfterLife(true);
+        effect->setSource("Orxonox/explosion2b");
+        effect->setLifetime(4.0f);
+        effect->setSyncMode(0);
+
+        ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
+        effect2->setDestroyAfterLife(true);
+        effect2->setSource("Orxonox/smoke6");
+        effect2->setLifetime(4.0f);
+        effect2->setSyncMode(0);
+
+        this->explosion_->attach(effect);
+        this->explosion_->attach(effect2);
+
+        this->attach(explosion_);
+        this->attach(debrisEntity1_);
+        this->attach(debrisEntity2_);
+        this->attach(debrisEntity3_);
+        this->attach(debrisEntity4_);
+
+
+        for(int i=0;i<10;i++)
+        {
+            Model* part1 = new Model(this->getContext());
+            Model* part2 = new Model(this->getContext());
+
+            MovableEntity* partEntity1 = new MovableEntity(this->getContext());
+            MovableEntity* partEntity2 = new MovableEntity(this->getContext());
+
+            part1->setSyncMode(0);
+            part2->setSyncMode(0);
+            partEntity1->setSyncMode(0);
+            partEntity2->setSyncMode(0);
+
+            partEntity1->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10,100));
+            partEntity1->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+            partEntity1->setScale(rnd(1, 3));
+
+            partEntity2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 100));
+            partEntity2->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+            partEntity2->setScale(rnd(1, 3));
+
+            part1->setMeshSource("SmallPart1.mesh");
+            part2->setMeshSource("SmallPart2.mesh");
+
+            partEntity1->attach(part1);
+            partEntity2->attach(part2);
+
+            this->attach(partEntity1);
+            this->attach(partEntity2);
+        }
+    }
+
+    void BigExplosion::initZero()
+    {
+        this->debrisFire1_ = 0;
+        this->debrisFire2_ = 0;
+        this->debrisFire3_ = 0;
+        this->debrisFire4_ = 0;
+
+        this->debrisSmoke1_ = 0;
+        this->debrisSmoke2_ = 0;
+        this->debrisSmoke3_ = 0;
+        this->debrisSmoke4_ = 0;
+
+        this->explosionSmoke_=0;
+        this->explosionFire_=0;
+    }
+
+    BigExplosion::~BigExplosion()
+    {
+        if (this->isInitialized())
+        {
+            if (this->debrisFire1_)
+            {
+                this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
+                delete this->debrisFire1_;
+            }
+            if (this->debrisSmoke1_)
+            {
+                this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
+                delete this->debrisSmoke1_;
+            }
+
+            if (this->debrisFire2_)
+            {
+                this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
+                delete this->debrisFire2_;
+            }
+            if (this->debrisSmoke2_)
+            {
+                this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
+                delete this->debrisSmoke2_;
+            }
+
+            if (this->debrisFire3_)
+            {
+                this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
+                delete this->debrisFire3_;
+            }
+            if (this->debrisSmoke3_)
+            {
+                this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
+                delete this->debrisSmoke3_;
+            }
+
+            if (this->debrisFire4_)
+            {
+                this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
+                delete this->debrisFire4_;
+            }
+            if (this->debrisSmoke4_)
+            {
+                this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
+                delete this->debrisSmoke4_;
+            }
+        }
+    }
+
+    void BigExplosion::registerVariables()
+    {
+        registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
+        registerVariable(this->bStop_,       VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
+    }
+
+    void BigExplosion::LODchanged()
+    {
+        if (this->debrisFire1_)
+            this->debrisFire1_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke1_)
+            this->debrisSmoke1_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire2_)
+            this->debrisFire2_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke2_)
+            this->debrisSmoke2_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire3_)
+            this->debrisFire3_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke3_)
+            this->debrisSmoke3_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire4_)
+            this->debrisFire4_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke4_)
+            this->debrisSmoke4_->setDetailLevel(this->LOD_);
+    }
+
+    void BigExplosion::checkStop()
+    {
+        if (this->bStop_)
+            this->stop();
+    }
+
+    void BigExplosion::stop()
+    {
+        if (this->debrisFire1_)
+            this->debrisFire1_->setEnabled(false);
+        if (this->debrisSmoke1_)
+            this->debrisSmoke1_->setEnabled(false);
+
+        if (this->debrisFire2_)
+            this->debrisFire2_->setEnabled(false);
+        if (this->debrisSmoke2_)
+            this->debrisSmoke2_->setEnabled(false);
+
+        if (this->debrisFire3_)
+            this->debrisFire3_->setEnabled(false);
+        if (this->debrisSmoke3_)
+            this->debrisSmoke3_->setEnabled(false);
+
+        if (this->debrisFire4_)
+            this->debrisFire4_->setEnabled(false);
+        if (this->debrisSmoke4_)
+            this->debrisSmoke4_->setEnabled(false);
+
+        if (GameMode::isMaster())
+        {
+            this->bStop_ = true;
+            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
+        }
+    }*/
+
+}

Added: code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h	                        (rev 0)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h	2014-04-03 12:35:54 UTC (rev 10017)
@@ -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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file JumpPlatform.h
+    @brief Declaration of the JumpPlatform class.
+*/
+
+#ifndef _JumpPlatform_H__
+#define _JumpPlatform_H__
+
+#include "jump/JumpPrereqs.h"
+
+#include "MobileEntity.h"
+
+namespace orxonox
+{
+    class _JumpExport JumpPlatform : public MobileEntity
+    {
+        public:
+            JumpPlatform(Context* context);
+
+
+        private:
+
+    };
+}
+
+#endif /* _JumpPlatform_H__ */

Modified: code/branches/pickupsFS14/src/modules/jump/JumpShip.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShip.cc	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShip.cc	2014-04-03 12:35:54 UTC (rev 10017)
@@ -48,16 +48,20 @@
         //speed = 500;
         //isFireing = false;
         //damping = 10;
-        left = false;
-        right = false;
+        leftPressed = false;
+        rightPressed = false;
+        upPressed = false;
+        downPressed = false;
 
+        yScreenPosition = 0;
+        yVelocity = 0;
     }
 
     void JumpShip::tick(float dt)
     {
+    	Vector3 movement(0,0,0);
+        Vector3 shipPosition = getPosition();
 
-        Vector3 pos = getPosition();
-
         /*
         //Movement calculation
         lastTimeFront += dt * damping;
@@ -94,17 +98,13 @@
         // shoot!
         if (isFireing)
             ControllableEntity::fire(0);
-
+		*/
         // Camera
-        WeakPtr<Camera> camera = this->getCamera();
-        if (camera != NULL)
-        {
-            camera->setPosition(Vector3(-pos.z, -posforeward, 0));
-            camera->setOrientation(Vector3::UNIT_Z, Degree(90));
-        }
 
 
 
+
+	    /*
         // bring back on track!
         if(pos.y != 0)
             pos.y = 0;
@@ -120,19 +120,60 @@
         }
         */
 
-    	if (left == true)
+    	// Berechne Bewegung anhand der Eingabe
+    	if (leftPressed == true)
     	{
-    		pos += Vector3(100 + pos.y, 0, 0) * dt;
-    		left = false;
+    		movement -= Vector3(xVelocity, 0, 0);
+    		leftPressed = false;
     	}
-    	else if (right == true)
+    	else if (rightPressed == true)
     	{
-    		right = false;
+    		movement += Vector3(xVelocity, 0, 0);
+    		rightPressed = false;
     	}
 
-    	setPosition(pos);
+    	if (upPressed == true)
+    	{
+    		//movement += Vector3(0, xVelocity, 0);
+    		yVelocity = ySpeedAfterJump;
+    		upPressed = false;
+    	}
+    	else if (downPressed == true)
+    	{
+    		movement -= Vector3(0, 0, 0);
+    		downPressed = false;
+    	}
 
+    	movement += Vector3(0, yVelocity, 0);
+    	yVelocity -= yAcceleration;
 
+    	// Skalierung der Bewegung je nach vergangener Zeit
+    	movement *= dt;
+
+    	// Verschiebe das Schiff um den berechneten Vektor movement und verhindere Verlassen des Bildschrims
+    	shipPosition.x = clamp(shipPosition.x + movement.x, -xBoundary, xBoundary);
+		shipPosition.y += movement.y;
+
+    	setPosition(shipPosition);
+
+    	// Bildschirmposition kann nur nach oben verschoben werden
+    	if (shipPosition.y > yScreenPosition)
+    	{
+    		yScreenPosition = shipPosition.y;
+    	}
+
+    	// Kameraposition nachfuehren
+    	if (camera == NULL)
+    	{
+    		camera = getCamera();
+    	}
+        if (camera != NULL)
+        {
+
+            camera->setPosition(Vector3(-shipPosition.x, yScreenPosition-shipPosition.y, 100));
+            //camera->setOrientation(Vector3::UNIT_Z, Degree(180));
+        }
+
         SUPER(JumpShip, tick, dt);
     }
 /*
@@ -145,19 +186,27 @@
 
     void JumpShip::moveFrontBack(const Vector2& value)
     {
+    	if (value.y < 0)
+    	{
+    		downPressed = true;
+    	}
+    	else if (value.y > 0)
+    	{
+    		upPressed = true;
+    	}
         //lastTimeLeft = 0;
         //desiredVelocity.x = -value.x * speed;
     }
 
     void JumpShip::moveRightLeft(const Vector2& value)
     {
-    	if (value.y < 0)
+    	if (value.x < 0)
     	{
-    		left = true;
+    		leftPressed = true;
     	}
-    	else if (value.y > 0)
+    	else if (value.x > 0)
     	{
-    		right = true;
+    		rightPressed = true;
     	}
         //lastTimeFront = 0;
         //desiredVelocity.y = value.y * speed * 42;

Modified: code/branches/pickupsFS14/src/modules/jump/JumpShip.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShip.h	2014-04-03 12:19:49 UTC (rev 10016)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShip.h	2014-04-03 12:35:54 UTC (rev 10017)
@@ -55,14 +55,14 @@
 /*
             // 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 rotateRoll(const Vector2& value){};
 
-            virtual void updateLevel();
+            /*virtual void updateLevel();
 
             virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
 
@@ -71,7 +71,11 @@
         private:
             WeakPtr<Jump> getGame();
             WeakPtr<Jump> game;
-            //Camera* camera;
+            WeakPtr<Camera> camera;
+            const float xVelocity = 150.0f;
+            const float xBoundary = 200.0f;
+
+
             //bool isFireing;
             //float speed;
             //float damping
@@ -89,11 +93,15 @@
                 float y;
             } velocity, desiredVelocity;*/
 
-            bool left;
-            bool right;
+            bool leftPressed;
+            bool rightPressed;
+            bool upPressed;
+            bool downPressed;
 
-
-
+            float yScreenPosition;
+            float yVelocity;
+            const float yAcceleration = 10.0f;
+            const float ySpeedAfterJump = 300.0f;
     };
 }
 




More information about the Orxonox-commit mailing list