Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12343


Ignore:
Timestamp:
May 9, 2019, 11:09:18 AM (6 years ago)
Author:
ahuwyler
Message:

We have a list of all stones

Location:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
Files:
2 edited

Legend:

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

    r12342 r12343  
    113113            }
    114114
    115         // Destroy 6 bWalls, if present.
    116         for (size_t i = 0; i < 6; ++i)
    117         {
    118             if (this->activeWalls_[0] != nullptr)
    119             {
    120                 this->activeWalls_[0]->destroy();
    121                 this->activeWalls_[0] = nullptr;
    122             }
    123            
    124         }
     115        for (OrxoBloxStones* stone : this->stones_)
     116            stone->destroy();
     117        this->stones_.clear();
     118       
    125119
    126120    }
     
    215209    }
    216210
    217     //void startWall(void);
    218211    void OrxoBlox::LevelUp(){
    219212        level_++;
    220         for(int i=8; i>-1; --i){
    221             activeWalls_[i]=activeWalls_[i+1];
    222         }
    223213        this->createWall();
    224         //activeWalls_[0]=
     214        //this->activeWalls_.push_back(this->futureWall_);
    225215        //When levelup? wo wird es ausgeloest?
    226216        //new location of ship
     
    239229        this->center_->attach(this->futureWall_);
    240230       
    241        
    242         this->futureWall_->setPosition(0, 0, 0.0f);
     231        float y_=(this->center_->getFieldDimension()).y;
     232                //stone->setPosition(size_*i -x_/2 +4.5f, -3.5f, -y_/2 + 6.5f);
     233        this->futureWall_->setPosition(0, 0, -y_/2 + 6.5f);
    243234        this->futureWall_->setGame(this);
    244235    }
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12337 r12343  
    9898            WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball.
    9999            unsigned int level_;
    100            
     100
    101101            WeakPtr<OrxoBloxShip> playership;
    102102            PlayerInfo* player_;
     
    104104           
    105105            WeakPtr<OrxoBloxWall> futureWall_;
    106             WeakPtr<OrxoBloxWall> activeWalls_[6]; //6 is the number of wallls in the game.
     106            std::vector<OrxoBloxWall*> activeWalls_;
     107            std::list<StrongPtr<OrxoBloxStones>> stones_; //!< A list of all stones in play.
     108
    107109    };
    108110}
Note: See TracChangeset for help on using the changeset viewer.