[Orxonox-commit 7744] r12337 - in code/branches/OrxoBlox_FS19: data/levels data/levels/templates src/modules/OrxoBlox

pomselj at orxonox.net pomselj at orxonox.net
Thu May 2 16:40:50 CEST 2019


Author: pomselj
Date: 2019-05-02 16:40:50 +0200 (Thu, 02 May 2019)
New Revision: 12337

Modified:
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc
Log:
Ball can do bouncy stuff

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-02 14:40:50 UTC (rev 12337)
@@ -16,9 +16,6 @@
   include("templates/spaceshipAssff2.oxt")
   include("templates/spaceshipPirate.oxt")
   include("templates/spaceshipOrxoBlox.oxt")
-  include("templates/enemyInvader.oxt")
-  include("overlays/Asteroids2DHUD.oxo")
-  include("templates/asteroidsAsteroids2D.oxt")
 ?>
 
 <Template name=OrxoBloxbatcameras defaults=0>

Modified: code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt	2019-05-02 14:40:50 UTC (rev 12337)
@@ -1,4 +1,4 @@
-<Template name=spaceshipOrxBlox>
+<Template name=spaceshipOrxoBlox>
   <OrxoBloxShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipescortcameras
@@ -42,8 +42,8 @@
    
   >
     <engines>
-      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipOrxoBloxdengine />
-      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipOrxoBloxdengine />
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipOrxoBloxengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipOrxoBloxengine />
     </engines>
     <attached>
       <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
@@ -92,7 +92,7 @@
   </OrxoBloxShip>
 </Template>
 
-<Template name=spaceshiporxobloxdengine baseclass=MultiStateEngine>
+<Template name=spaceshipOrxoBloxengine baseclass=MultiStateEngine>
   <MultiStateEngine
    boostfactor    = 2.2
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-02 14:40:50 UTC (rev 12337)
@@ -63,7 +63,7 @@
     @brief
         Constructor. Registers and initializes the object.
     */
-    OrxoBlox::OrxoBlox(Context* context) : Deathmatch(context)
+    OrxoBlox::OrxoBlox(Context* context) : ::orxonox::Deathmatch::Deathmatch(context)
     {
         RegisterObject(OrxoBlox);
 
@@ -153,6 +153,10 @@
             // Create the first Wall.
             this->createWall();
 
+            //Create Ship
+            //this->ship_ = new OrxoBloxShip(this->center_->getContext());
+            //this->ship_->setPosition(0, 0, 0);
+
         }
         else // If no centerpoint was specified, an error is thrown and the level is exited.
         {
@@ -165,7 +169,7 @@
         this->starttimer_.startTimer();
 
         // Set variable to temporarily force the player to spawn.
-        this->bForceSpawn_ = false;
+        this->bForceSpawn_ = true;
 
         // Call start for the parent class.
         Deathmatch::start();
@@ -185,15 +189,21 @@
         Deathmatch::end();
     }
 
-    /**
-    @brief
-        Spawns the input player.
-    @param player
-        The player to be spawned.
-    */
+    OrxoBloxShip* OrxoBlox::getPlayer()
+    {
+        if (playership == nullptr)
+        {
+            for (OrxoBloxShip* ship_ : ObjectList<OrxoBloxShip>())
+            {
+                playership = ship_;
+            }
+        }
+        return playership;
+    }
+   
     void OrxoBlox::spawnPlayer(PlayerInfo* player)
     {
-         assert(player);
+        assert(player);
 
         if(this->player_ == nullptr)
         {
@@ -200,20 +210,10 @@
             this->player_ = player;
             this->players_[player].state_ = PlayerState::Alive;
         }
-    }
 
-
-    OrxoBloxShip* OrxoBlox::getPlayer()
-    {
-        for (OrxoBloxShip* ship : ObjectList<OrxoBloxShip>())
-        {
-            return ship;
-        }
-        return nullptr;
     }
 
     //void startWall(void);
-    
     void OrxoBlox::LevelUp(){
         level_++;
         //When levelup? wo wird es ausgeloest?

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-05-02 14:40:50 UTC (rev 12337)
@@ -42,6 +42,7 @@
 #include "gametypes/Deathmatch.h"
 #include "OrxoBloxCenterpoint.h"
 #include "OrxoBloxWall.h"
+#include "OrxoBloxShip.h"
 
 namespace orxonox
 {
@@ -71,9 +72,8 @@
             virtual void start() override; //!< Starts the OrxoBlox minigame.
             virtual void end() override; ///!< Ends the OrxoBlox minigame.
 
-            virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
-
             OrxoBloxShip* getPlayer();
+            void spawnPlayer(PlayerInfo* Player) override;
 
             void LevelUp();
 
@@ -96,10 +96,10 @@
 
             WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
             WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball.
+            unsigned int level_;
             
+            WeakPtr<OrxoBloxShip> playership;
             PlayerInfo* player_;
-            unsigned int level_;
-
             Timer starttimer_; //!< A timer to delay the start of the game.
             
             WeakPtr<OrxoBloxWall> futureWall_;

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	2019-05-02 14:40:50 UTC (rev 12337)
@@ -121,9 +121,11 @@
             float getBatLength() const
                 { return this->batlength_; }
 
+
+            void Bounce(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint);
             
+            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
 
-
             static const float MAX_REL_Z_VELOCITY;
 
             void setDefScoreSound(const std::string& engineSound);
@@ -132,8 +134,6 @@
             const std::string& getDefBatSound();
             void setDefBoundarySound(const std::string& engineSound);
             const std::string& getDefBoundarySound();
-            void Bounce(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint);
-            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
 
         private:
             void registerVariables();

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc	2019-05-02 14:32:19 UTC (rev 12336)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc	2019-05-02 14:40:50 UTC (rev 12337)
@@ -33,7 +33,6 @@
 */
 
 #include "OrxoBloxShip.h"
-#include "OrxoBloxShip.h"
 #include "core/CoreIncludes.h"
 
 namespace orxonox
@@ -47,6 +46,7 @@
         this->bImmune = false;
         this->width = 120;
         this->height = 100;
+        orxout() << "Spawned" << std::endl;
 
         //timer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxoBloxShip::showorientation, this)));
     }



More information about the Orxonox-commit mailing list