[Orxonox-commit 7796] r12388 - code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles

pomselj at orxonox.net pomselj at orxonox.net
Thu May 16 16:24:32 CEST 2019


Author: pomselj
Date: 2019-05-16 16:24:32 +0200 (Thu, 16 May 2019)
New Revision: 12388

Modified:
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
Log:
Projectiles die with level up

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 14:18:12 UTC (rev 12387)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 14:24:32 UTC (rev 12388)
@@ -166,6 +166,7 @@
         SUPER(BallProjectile, tick, dt);
 
                // Get the current position, velocity and acceleration of the ball.
+        bool suicidal = false;
         Vector3 position = this->getPosition();
         Vector3 velocity = this->getVelocity();
         Vector3 acceleration = this->getAcceleration();
@@ -184,37 +185,8 @@
                 position.z = this-> fieldHeight_;
                 
                 orxoblox_->LevelUp();
-
-
-                //this->setSpeed(0); // doesn't work here, why??;
-                //Stopping ball
-                //orxout() << "Ball stopped" << endl;
-                velocity.x = 0;
-                velocity.y = 0;
-                velocity.z = 0; 
-
-                //ChatManager::message("Waiting for your input");
-                //Input new speed here:
-                //ChatManager::message("Setting new speed");
+                suicidal = true;
                 
-                //%%%%%%%%%%%%
-                //MAUSPOSITION
-                //%%%%%%%%%%%%
-                //Reads current mouse position
-                //TODO: read Mouse position on click!
-                //int mousex = InputManager::getInstance().getMousePosition().first;
-                //int mousey = InputManager::getInstance().getMousePosition().second;
-                //ChatManager::message("Read mouse position");
-                //orxout() << "Mouseposition" << endl;
-                //orxout() << mousex << endl;
-                //ChatManager::message(mousex);
-                //ChatManager::message("mousey");
-                //ChatManager::message(mousey);
-                //Set new speed here!!
-                velocity.x = rnd(-100,100);
-                velocity.z = rnd(-50,-100);
-                
-
             }
             if (position.z < -this->fieldHeight_){
                 position.z = -this->fieldHeight_;
@@ -257,6 +229,9 @@
         if (position != this->getPosition())
             this->setPosition(position);
         //this->Collides((this->orxoblox_->CheckForCollision(this)));
+        if (suicidal == true) {
+            this->destroy();
+        }
 
     }
 



More information about the Orxonox-commit mailing list