[Orxonox-commit 7553] r12156 - code/branches/OrxoKart_HS18/src/modules/orxokart

ottka at orxonox.net ottka at orxonox.net
Wed Dec 5 12:34:31 CET 2018


Author: ottka
Date: 2018-12-05 12:34:31 +0100 (Wed, 05 Dec 2018)
New Revision: 12156

Modified:
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartFlag.cc
Log:
new commit

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	2018-12-05 11:23:30 UTC (rev 12155)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	2018-12-05 11:34:31 UTC (rev 12156)
@@ -50,6 +50,7 @@
         this->raceFinished = false;
         this->firstTick_ = true;
         this->numberOfShrooms = 3;
+        this->player = nullptr;
 
         this->setHUDTemplate("OrxoKartHUD");
     }
@@ -104,16 +105,7 @@
                             0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,1,
                             0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,1,1,1,0,1,1,1};
 
-
-
             int *levelcodeArray =  level==1 ? map_1 : map_2;
-
-
-
-            //OrxoKartTile* tile = new OrxoKartTile(origin_->getContext());
-            //tile->init(0*s, 4*s, s, 20, 2);
-
-
             // int z = 0;
             //Generate floor according to levelcode
             for(int i=0; i<n; i++){
@@ -175,10 +167,12 @@
 
 
 
+        	orxout() << numberOfShrooms << endl;
 
 
-        // Check if ship collided with the flag
+        // Check if ship collided with the flag, flag is the bottom that is responsible for the game to detect the spaceship falling.
         if(flag_->getCollided()){
+        	orxout() << numberOfShrooms << endl;
             player = flag_->getObjectofCollision();
             if (level == 1)
                 player->setPosition(Vector3(s*0, 20, s*8.5));
@@ -189,7 +183,11 @@
             player->setAcceleration(Vector3(0,0,0));
             flag_->setCollided(false); 
             wayPointCounter = 0;
+        }
 
+        if (player && player->isBoosting()) {
+        	orxout() << "Boosting" << endl;
+        	if(!numberOfShrooms) numberOfShrooms--;
         }
         
     }

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartFlag.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartFlag.cc	2018-12-05 11:23:30 UTC (rev 12155)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartFlag.cc	2018-12-05 11:34:31 UTC (rev 12156)
@@ -85,12 +85,12 @@
     */
     void OrxoKartFlag::init(int n, int s)
     {
-        /*model_ = new Model(this->getContext());
-        model_->setMeshSource("OrxoKartStreckenabschnitt.mesh");
-        model_->setScale3D(Vector3(s*n*2, 1, s*n*2));
-        model_->setPosition(Vector3(s*n*0.5f,-60.0f, s*n*0.5f));
+        model_ = new Model(this->getContext());
+        model_->setMeshSource("OrxoKartMushroom.mesh");
+        model_->setScale3D(Vector3(s, s, s));
+        model_->setPosition(Vector3(s*n*0.5f,-0.0f, s*n*0.5f));
 
-        this->attach(model_);*/
+        this->attach(model_);
 
         cs_ = new BoxCollisionShape(this->getContext());
         cs_->setHalfExtents(Vector3(s*n, 1, s*n));
@@ -97,6 +97,8 @@
         cs_->setPosition(Vector3(s*n*0.5f,-60.0f, s*n*0.5f));
 
         this->attachCollisionShape(cs_);
+
+
     }
 
     /**



More information about the Orxonox-commit mailing list