Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12376


Ignore:
Timestamp:
May 16, 2019, 2:20:38 PM (5 years ago)
Author:
jeromela
Message:

cleanup function worksls!

Location:
code/branches/OrxoBlox_FS19/src/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12371 r12376  
    9898    */
    9999    void OrxoBlox::cleanup()
    100     {
     100    {   
    101101        //if (this->ball_ != nullptr) // Destroy the ball, if present.
    102102        //{
     
    105105        //}
    106106
    107         if (this->futureWall_ != nullptr)
     107        /*if (this->futureWall_ != nullptr)
    108108            {
    109109            this->futureWall_->destroy();
    110110            this->futureWall_ = nullptr;
    111111            }
    112 
     112        */
     113       
    113114        for (OrxoBloxWall* wall : this->activeWalls_)
    114115            if (wall != nullptr)
    115             wall->destroy();
     116                wall->destroy();
    116117        this->activeWalls_.clear();
    117118       
     
    132133
    133134    {
     135        orxout() << "Orxoblox started" << endl;
    134136        if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
    135137        {
     
    222224    void OrxoBlox::LevelUp(){
    223225        level_++;
     226        int z_;
     227
     228        orxout() << "level up called" << endl;
    224229        this->playerScored(this->player_);// add points
    225230        for(OrxoBloxStones* stone : this->stones_){
    226231            int x_=(stone->getPosition()).x;
    227232            int y_=(stone->getPosition()).y;
    228             int z_=(stone->getPosition()).z;
     233            z_=(stone->getPosition()).z;
    229234            //if(z_==90)this->end();
    230235
    231236            stone->setPosition(x_,y_,z_+9.0f);
    232 
    233             if( z_ >= 45){
    234                 this->end();
    235             }
     237           
    236238        }
    237239
     
    266268        //create balls
    267269        //insert new wall
     270        if( z_ >= 45){
     271            orxout() << "calling end() function" << endl;
     272            this->end();
     273            }
     274       
    268275    }
    269276
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc

    r12368 r12376  
    128128    */
    129129    void OrxoBloxBall::tick(float dt)
    130     {
     130    {   
     131       
    131132        SUPER(OrxoBloxBall, tick, dt);
    132133
     
    148149               
    149150                orxoblox_->LevelUp();
     151                orxoblox_->LevelUp();
     152                orxout() << "LevelUp 2 finished, trying to call end() function";
     153                //this->end();
     154
    150155
    151156
     
    294299        Vector3 positionStone = Stone->getPosition();
    295300        Vector3 myPosition = this->getPosition();
    296         orxout() << "About to Bounce >D" << endl;
     301        //orxout() << "About to Bounce >D" << endl;
    297302       
    298303            int distance_X = myPosition.x - positionStone.x;
     
    306311                distance_Z = -distance_Z;
    307312
    308             orxout() << distance_X << endl;
    309             orxout() << distance_Z << endl;
     313            //orxout() << distance_X << endl;
     314            //orxout() << distance_Z << endl;
    310315
    311316            if (distance_X < distance_Z) {
    312317                velocity.z = -velocity.z;
    313                 orxout() << "z" << endl; 
     318                //orxout() << "z" << endl; 
    314319            }
    315320            else if (distance_Z < distance_X) {
    316321                velocity.x = -velocity.x;
    317                 orxout() << "x" << endl;       
     322                //orxout() << "x" << endl;       
    318323            }
    319324            else {
    320325                velocity.x = -velocity.x;
    321326                velocity.z = -velocity.z;
    322                 orxout() << "both" << endl;
     327                //orxout() << "both" << endl;
    323328            }                                 
    324329
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc

    r12371 r12376  
    104104        Vector3 myPosition = otherObject->getPosition();
    105105        btVector3 positionOtherObject = contactPoint.getPositionWorldOnA();
    106         orxout() << "About to Bounce >D" << endl;
     106        //orxout() << "About to Bounce >D" << endl;
    107107        //if (positionOtherObject.y < 0) {
    108108            //this.destroy()
     
    120120                distance_Z = -distance_Z;
    121121
    122             orxout() << distance_X << endl;
    123             orxout() << distance_Z << endl;
     122            //orxout() << distance_X << endl;
     123            //orxout() << distance_Z << endl;
    124124
    125125            if (distance_X < distance_Z) {
    126126                velocity.z = -velocity.z;
    127                 orxout() << "z" << endl;
     127                //orxout() << "z" << endl;
    128128            }
    129129            if (distance_Z < distance_X) {
    130130                velocity.x = -velocity.x;
    131                 orxout() << "x" << endl;
     131                //orxout() << "x" << endl;
    132132            }
    133133            else {
    134134                velocity.x = -velocity.x;
    135135                velocity.z = -velocity.z;
    136                 orxout() << "both" << endl;
     136                //orxout() << "both" << endl;
    137137            }
    138138            this->setVelocity(velocity);
     
    144144    {
    145145
    146         orxout() << "wanna bounce..." << endl;
     146        //orxout() << "wanna bounce..." << endl;
    147147        bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
    148148        if (result == true) {
     
    151151            }
    152152        }
    153         orxout() << "BOUNCED!" << endl;
     153        //orxout() << "BOUNCED!" << endl;
    154154
    155155        return result;
     
    198198                //this->setSpeed(0); // doesn't work here, why??;
    199199                //Stopping ball
    200                 orxout() << "Ball stopped" << endl;
     200                //orxout() << "Ball stopped" << endl;
    201201                velocity.x = 0;
    202202                velocity.y = 0;
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc

    r12291 r12376  
    8585    bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
    8686    {
    87         orxout() << "OMG A COLLISION" << endl;
     87        //orxout() << "OMG A COLLISION" << endl;
    8888        if (!this->bDestroy_ && GameMode::isMaster())
    8989        {
Note: See TracChangeset for help on using the changeset viewer.