[Orxonox-commit 6753] r11381 - in code/branches/SuperOrxoBros_FS17: data/levels src/modules/superorxobros

jkindle at orxonox.net jkindle at orxonox.net
Thu Mar 30 14:42:32 CEST 2017


Author: jkindle
Date: 2017-03-30 14:42:31 +0200 (Thu, 30 Mar 2017)
New Revision: 11381

Modified:
   code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
   code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
Log:
Works whoow

Modified: code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
===================================================================
--- code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw	2017-03-30 12:42:31 UTC (rev 11381)
@@ -1,57 +1,78 @@
 <LevelInfo
- name = "SOOOOB"
- description = "Level for the coding tutorial."
+ name = "SOOOOOOOOOOOB"
+ description = "Jump as high as you can. Use the mouse to guide the jumper."
  tags = "minigame"
- screenshot = "codingtutorial.png"
- startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser"
+ screenshot = "jump.png"
 />
 
 <?lua
-  include("HUDTemplates3.oxo")
+  include("HUDTemplates3.oxo")  
+  include("jumpHUD.oxo")
   include("stats.oxo")
-  include("templates/spaceshipAssff.oxt")
-
+  include("templates/lodInformation.oxt")
 ?>
 
-<Level plugins = "superorxobros" gametype="SOB">
- 
+<Template name=sobfigurecameras defaults=0>
+  <SOBFigure>
+    <camerapositions>
+      <CameraPosition position="0,-150,0" absolute=false mouselook=false drag=false lookat="0,0,0"/>
+    </camerapositions>
+  </SOBFigure>
+</Template>
 
-  <?lua include("includes/notifications.oxi") ?>
 
-  <Scene
-   ambientlight = "0.5, 0.5, 0.5"
-   skybox       = "Orxonox/skyBoxBasic"
-  >
 
 
+<Template name=sobFigureTemplate>
+  <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic">
+    <attached>
+      <Model position="0,0,0" mesh="JumpFigure.mesh" scale=1 pitch=90/>
+    </attached>
+
+       <collisionShapes>
+<!--         <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
+ -->        <SphereCollisionShape   yaw="20" pitch="20" roll="20" position="0,0,0" radius="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="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" spawnclass=SpaceShip pawndesign=shipselection />
 
+    <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" />
 
-    
- <MovableEntity rotationrate=5 rotationaxis="0,0,1">
+    <MovableEntity>
       <attached>
-        <SOBCenterpoint>
+        <SOBCenterpoint
+          name=jumpcenter
+ 
+          cameraOffset="10"
+
+         
+          figureTemplate=sobFigureTemplate
+          
+          >
+
           <attached>
-            <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
-            <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
 
-            <ParticleSpawner name=scoreeffect_right position="120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
-            <ParticleSpawner name=scoreeffect_right position="120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
 
-            <ParticleSpawner name=scoreeffect_left position="-120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0,  0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
-            <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
+    
 
           </attached>
         </SOBCenterpoint>
@@ -58,7 +79,18 @@
       </attached>
     </MovableEntity>
 
+    <StaticEntity position="0,-1,-10" collisionType="static">
+      <attached>
+         <Model  mesh="cube.mesh" scale3D="76,76,1" />
+      </attached>
 
+      <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="76,76,1" />
+      </collisionShapes>
+    </StaticEntity>
 
+     
+
+
   </Scene>
 </Level>

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc	2017-03-30 12:42:31 UTC (rev 11381)
@@ -40,12 +40,12 @@
 
 #include "gamestates/GSLevel.h"
 #include "chat/ChatManager.h"
+#include "infos/PlayerInfo.h"
 
 #include "SOBCenterpoint.h"
 
-//#include "PongBat.h"
-//#include "PongBot.h"
-//#include "PongAI.h"
+#include "SOBFigure.h"
+#include "graphics/Camera.h"
 
 namespace orxonox
 {
@@ -59,9 +59,10 @@
     SOB::SOB(Context* context) : Deathmatch(context)
     {
         RegisterObject(SOB);
+        camera = nullptr;
 
         this->center_ = nullptr;
-           figure_ = nullptr;
+        figure_ = nullptr;
 
     }
 
@@ -75,8 +76,11 @@
             this->cleanup();
     }
 
+    void SOB::cleanup()
+    {
+        camera = nullptr;
+    }
 
-
         void SOB::start()
     {
         if (center_ != nullptr) // There needs to be a SOBCenterpoint, i.e. the area the game takes place.
@@ -84,8 +88,8 @@
             if (figure_ == nullptr)
             {
                 figure_ = new SOBFigure(center_->getContext());
-                figure_->addTemplate(center_->getFigureTemplate()); /
-                figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+                figure_->addTemplate(center_->getFigureTemplate()); 
+               // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
             }
 
             center_->attach(figure_);   //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -106,14 +110,14 @@
             camera = figure_->getCamera();
         }
 
-        totalScreenShift_ = 0.0;
-        screenShiftSinceLastUpdate_ = 0.0;
-        sectionNumber_ = 0;
-        adventureNumber_ = 0;
+       // totalScreenShift_ = 0.0;
+       // screenShiftSinceLastUpdate_ = 0.0;
+        //sectionNumber_ = 0;
+        //adventureNumber_ = 0;
 
-        addStartSection();
-        addSection();
-        addSection();
+        //addStartSection();
+       // addSection();
+       // addSection();
     }
 
     void SOB::end()

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h	2017-03-30 12:42:31 UTC (rev 11381)
@@ -55,12 +55,12 @@
        
             void setCenterpoint(SOBCenterpoint* center)
                 { this->center_ = center; }
-            void setFigureTemplate(const std::string& newTemplate)
-                { this->figureTemplate_ = newTemplate; }
-            
-            const std::string& getFigureTemplate() const
-                { return this->figureTemplate_; }
-        
+                virtual void start() override;
+            virtual void end() override;
+            virtual void spawnPlayer(PlayerInfo* player) override;
+                        PlayerInfo* getPlayer() const;
+
+       
           
         protected:
         
@@ -69,6 +69,7 @@
              WeakPtr<SOBCenterpoint> center_;
             WeakPtr<SOBFigure> figure_;
             WeakPtr<Camera> camera;
+       
           
     };
 }

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc	2017-03-30 12:42:31 UTC (rev 11381)
@@ -20,7 +20,7 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      Fabien Vultier
  *   Co-authors:
  *      ...
  *
@@ -27,8 +27,8 @@
  */
 
 /**
-    @file PongCenterpoint.cc
-    @brief Implementation of the PongCenterpoint class.
+    @file SOBCenterpoint.cc
+    @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
 */
 
 #include "SOBCenterpoint.h"
@@ -35,7 +35,6 @@
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-
 #include "SOB.h"
 
 namespace orxonox
@@ -42,42 +41,29 @@
 {
     RegisterClass(SOBCenterpoint);
 
-    /**
-    @brief
-        Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
-    */
     SOBCenterpoint::SOBCenterpoint(Context* context) : StaticEntity(context)
     {
         RegisterObject(SOBCenterpoint);
 
+      
 
-        this->checkGametype();
+        checkGametype();
     }
 
-    /**
-    @brief
-        Method to create a PongCenterpoint through XML.
-    */
     void SOBCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(SOBCenterpoint, XMLPort, xmlelement, mode);
 
-        //XMLPortParam(SOBCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
-        //XMLPortParam(SOBCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
-       // XMLPortParam(SOBCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
-       // XMLPortParam(SOBCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
-       // XMLPortParam(SOBCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode);
-       // XMLPortParam(SOBCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
-       // XMLPortParam(SOBCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
+      
+        XMLPortParam(SOBCenterpoint, "cameraOffset", setCameraOffset, getCameraOffset, xmlelement, mode);
+        
+        XMLPortParam(SOBCenterpoint, "figureTemplate", setFigureTemplate, getFigureTemplate, xmlelement, mode);
+        
     }
 
-    /**
-    @brief
-        Checks whether the gametype is Pong and if it is, sets its centerpoint.
-    */
     void SOBCenterpoint::checkGametype()
     {
-        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
+        if (getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
         {
             SOB* SOBGametype = orxonox_cast<SOB*>(this->getGametype());
             SOBGametype->setCenterpoint(this);

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h	2017-03-30 12:42:31 UTC (rev 11381)
@@ -1,5 +1,4 @@
 /*
-/*
  *   ORXONOX - the hottest 3D action shooter ever to exist
  *                    > www.orxonox.net <
  *
@@ -21,46 +20,49 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      Fabien Vultier
  *   Co-authors:
  *      ...
  *
  */
 
-/**
-    @file PongCenterpoint.h
-    @brief Declaration of the PongCenterpoint class.
-    @ingroup Pong
-*/
-
 #ifndef _SOBCenterpoint_H__
 #define _SOBCenterpoint_H__
 
 #include "superorxobros/SOBPrereqs.h"
-
-#include <string>
-
-#include <util/Math.h>
-
 #include "worldentities/StaticEntity.h"
 
 namespace orxonox
 {
     
-   
-  
+    /**
+    @brief
+        @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
+    */
     class _SOBExport SOBCenterpoint : public StaticEntity
     {
         public:
-            SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
+            SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually SOB.
             virtual ~SOBCenterpoint() {}
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a SOBCenterpoint through XML.
+            
+            void setFigureTemplate(const std::string& newTemplate)
+                { this->figureTemplate_ = newTemplate; }
+            const std::string& getFigureTemplate() const
+                { return this->figureTemplate_; }
+            
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a PongCenterpoint through XML.
-
+            void setCameraOffset(const float cameraOffset)
+                { this->cameraOffset_ = cameraOffset; }
+            float getCameraOffset() const
+                { return cameraOffset_; }
+        private:
+            void checkGametype();
+           
+            std::string figureTemplate_;
     
-
-        private:
-            void checkGametype(); //!< Checks whether the gametype is Pong and if it is, sets its centerpoint.
+       
+            float cameraOffset_;
     };
 }
 

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc	2017-03-30 12:42:31 UTC (rev 11381)
@@ -55,9 +55,10 @@
         firePressed_ = false;
         timeSinceLastFire_ = 0.0;
   
-        gravityAcceleration_ = 8.0;
+        gravityAcceleration_ = 250.0;//8.0
        
         dead_ = false;
+        setAngularFactor(0.0);
     }
 
     void SOBFigure::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -79,7 +80,7 @@
           
             
             
-                velocity.z -= gravityAcceleration_;
+
             
 
        
@@ -87,10 +88,20 @@
             // Move left/right
             if (dead_ == false)
             {
+
+                if (firePressed_ && std::abs(velocity.z) < 0.1) {
+                    velocity.z = 200;
+                } else {
+
+                }
+
+
+
+
                 if (moveRightPressed_)
                     velocity.x = 75;
                 else if (moveLeftPressed_)
-                    velocity.x = 75;
+                    velocity.x = -75;
                 else
                     velocity.x = 0;
             }
@@ -98,6 +109,7 @@
             {
                 velocity.x = 0.0;
             }
+                        velocity.z -= gravityAcceleration_*dt;
 
            
 
@@ -115,7 +127,9 @@
         moveUpPressed_ = false;
         moveDownPressed_ = false;
         moveLeftPressed_ = false;
+        moveRightPressed_ = false;
         moveDownPressed_ = false;
+        firePressed_ = false;
      
     }
 
@@ -168,8 +182,8 @@
 
  
 
-    void SOBFigure::fired(unsigned int firemode)
-    {
+    void SOBFigure::boost(bool boost)
+        {
         firePressed_ = true;
     }
 }

Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h	2017-03-23 14:58:28 UTC (rev 11380)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h	2017-03-30 12:42:31 UTC (rev 11381)
@@ -45,7 +45,7 @@
             virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the figure up and down.
             
           
-            virtual void fired(unsigned int firemode) override;
+            virtual void boost(bool boost) override;
             
             //virtual void CollisionWithEnemy(SOBEnemy* enemy);
             



More information about the Orxonox-commit mailing list