[Orxonox-commit 7800] r12392 - in code/branches/OrxoBlox_FS19: data/levels/includes src/modules/OrxoBlox src/modules/weapons/projectiles

pomselj at orxonox.net pomselj at orxonox.net
Thu May 16 16:57:51 CEST 2019


Author: pomselj
Date: 2019-05-16 16:57:51 +0200 (Thu, 16 May 2019)
New Revision: 12392

Modified:
   code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
Log:


Modified: code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 14:57:28 UTC (rev 12391)
+++ code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 14:57:51 UTC (rev 12392)
@@ -20,5 +20,5 @@
       </WeaponPack>
     </weaponpacks>
     <munition>
-      <BallMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
+      <BallMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=1 replenishamount=1 replenishinterval=4/>
     </munition>

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-16 14:57:28 UTC (rev 12391)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-16 14:57:51 UTC (rev 12392)
@@ -110,17 +110,24 @@
             this->futureWall_ = nullptr;
             }
         */
-        
-        for (OrxoBloxWall* wall : this->activeWalls_)
+        for (OrxoBloxWall* wall : this->activeWalls_) {
             if (wall != nullptr)
                 wall->destroy();
+        }
         this->activeWalls_.clear();
         
 
-        for (OrxoBloxStones* stone : this->stones_)
+        for (OrxoBloxStones* stone : this->stones_) {
             if(stone != nullptr)
             stone->destroy();
+        }
         this->stones_.clear();
+        if(this->playership != nullptr) {
+            this->playership->destroy();
+        }
+        if(this->center_ != nullptr) {
+            this->center_->destroy();
+        }
         
 
     }
@@ -135,32 +142,9 @@
         orxout() << "Orxoblox started" << endl;
         if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
         {
-            //if (this->ball_ == nullptr) // If there is no ball, create a new ball.
-            //{
-            //    this->ball_ = new OrxoBloxBall(this->center_->getContext());
-                // Apply the template for the ball specified by the centerpoint.
-            //    this->ball_->addTemplate(this->center_->getBalltemplate());
-            //}
 
-            // Attach the ball to the centerpoint and set the parameters as specified in the centerpoint, the ball is attached to.
-            //this->center_->attach(this->ball_);
-            //Startposition Ball
-            //this->ball_->setPosition(0, 0, 40);
-            //this->ball_->setFieldDimension(this->center_->getFieldDimension());
-            //this->ball_->setSpeed(0);
-            //this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
-            
             level_=1;
 
-            // Create the first Wall.
-            this->LevelUp();
-
-
-
-            //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.
         {
@@ -229,9 +213,7 @@
 
         orxout() << "level up called" << endl;
         this->playerScored(this->player_);// add points
-        
 
-
         this->createWall();
         this->activeWalls_.push_back(this->futureWall_);
         for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
@@ -263,18 +245,17 @@
         //insert new wall
         for(OrxoBloxStones* stone : this->stones_){
             if (stone != nullptr) {
-            int x_=(stone->getPosition()).x;
-            int y_=(stone->getPosition()).y;
-            z_=(stone->getPosition()).z;
-            //if(z_==90)this->end();
+                int x_=(stone->getPosition()).x;
+                int y_=(stone->getPosition()).y;
+                z_=(stone->getPosition()).z;
+                //if(z_==90)this->end();
 
-            stone->setPosition(x_,y_,z_+9.0f);
-            if( z_ >= 45){
-                orxout() << "calling end() function" << endl;
-                this->end();
+                stone->setPosition(x_,y_,z_+9.0f);
+                if( z_ >= 45){
+                    orxout() << "calling end() function" << endl;
+                    this->end();
+                }
             }
-            }
-            
         }
 
         

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc	2019-05-16 14:57:28 UTC (rev 12391)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc	2019-05-16 14:57:51 UTC (rev 12392)
@@ -33,7 +33,7 @@
             unsigned int j=1 + static_cast<unsigned int>(rnd(2.0f)); //<! random number between 0 and 2;
             if(j<2){
                 this->size_ = 9.0f;
-                OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
+                OrxoBloxStones* stone = new OrxoBloxStones(this->center_->getContext());
                 if (stone == nullptr) {
                     std::abort();
                 }

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc	2019-05-16 14:57:28 UTC (rev 12391)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc	2019-05-16 14:57:51 UTC (rev 12392)
@@ -91,7 +91,6 @@
 
             if (getDestroyAfterCollision())
             {
-                orxout() << "Destroy that stuff" << endl;
                 this->bDestroy_ = true; // If something is hit, the object is destroyed and can't hit something else.
                                         // The projectile is destroyed by its tick()-function (in the following tick).
                                         // TODO: Use destroyLater() for this
@@ -173,7 +172,6 @@
     void BasicProjectile::destroyCheck(void)
     {
         if(GameMode::isMaster() && this->bDestroy_) {
-            orxout() << "Set true, smhow" << endl;
             this->destroy();
         }
     }
@@ -185,7 +183,6 @@
     void BasicProjectile::destroyObject(void)
     {
         if(GameMode::isMaster()) {
-            orxout() << "Deleted myself" << endl;
             this->destroy();
         }
     }



More information about the Orxonox-commit mailing list