Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12388


Ignore:
Timestamp:
May 16, 2019, 4:24:32 PM (5 weeks ago)
Author:
pomselj
Message:

Projectiles die with level up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc

    r12387 r12388  
    167167
    168168               // Get the current position, velocity and acceleration of the ball.
     169        bool suicidal = false;
    169170        Vector3 position = this->getPosition();
    170171        Vector3 velocity = this->getVelocity();
     
    185186               
    186187                orxoblox_->LevelUp();
    187 
    188 
    189                 //this->setSpeed(0); // doesn't work here, why??;
    190                 //Stopping ball
    191                 //orxout() << "Ball stopped" << endl;
    192                 velocity.x = 0;
    193                 velocity.y = 0;
    194                 velocity.z = 0;
    195 
    196                 //ChatManager::message("Waiting for your input");
    197                 //Input new speed here:
    198                 //ChatManager::message("Setting new speed");
     188                suicidal = true;
    199189               
    200                 //%%%%%%%%%%%%
    201                 //MAUSPOSITION
    202                 //%%%%%%%%%%%%
    203                 //Reads current mouse position
    204                 //TODO: read Mouse position on click!
    205                 //int mousex = InputManager::getInstance().getMousePosition().first;
    206                 //int mousey = InputManager::getInstance().getMousePosition().second;
    207                 //ChatManager::message("Read mouse position");
    208                 //orxout() << "Mouseposition" << endl;
    209                 //orxout() << mousex << endl;
    210                 //ChatManager::message(mousex);
    211                 //ChatManager::message("mousey");
    212                 //ChatManager::message(mousey);
    213                 //Set new speed here!!
    214                 velocity.x = rnd(-100,100);
    215                 velocity.z = rnd(-50,-100);
    216                
    217 
    218190            }
    219191            if (position.z < -this->fieldHeight_){
     
    258230            this->setPosition(position);
    259231        //this->Collides((this->orxoblox_->CheckForCollision(this)));
     232        if (suicidal == true) {
     233            this->destroy();
     234        }
    260235
    261236    }
Note: See TracChangeset for help on using the changeset viewer.