Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12335 for code/branches


Ignore:
Timestamp:
May 2, 2019, 4:17:14 PM (6 years ago)
Author:
ahuwyler
Message:

Random Walls are created

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

Legend:

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

    r12332 r12335  
    224224
    225225    void OrxoBlox::createWall(void){
    226         orxout() <<"Hello idiot1"<< endl;
    227 
    228226        this->futureWall_ = new OrxoBloxWall(this->center_->getContext());
    229227        // Apply the stone template to the stone.
     
    234232       
    235233       
    236         this->futureWall_->setPosition(10, 10, 0.0f);
     234        this->futureWall_->setPosition(0, 0, 0.0f);
    237235        this->futureWall_->setGame(this);
    238236    }
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc

    r12332 r12335  
    1919        RegisterObject(OrxoBloxWall);
    2020
    21         this->num_Stones_ = 2;//1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
    22         this->size_ = 10.0f;
     21        this->num_Stones_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
     22        this->size_ = 9.0f;
    2323        this->delay_ = false;
    2424        this->orxoblox_ = this->getOrxoBlox();
     
    2828
    2929    void OrxoBloxWall::createWall(void){
    30         orxout() <<"Hello idiot"<< endl;
    3130        for (unsigned int i=0; i<this->num_Stones_;++i){
    32             orxout() <<i<< endl;
    33             OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
    34             this->TotalStones_.push_back(stone);
    35             this->attach(stone);
    36             stone->setPosition(size_*i, 0, 0.0f);
     31            unsigned int j=1 + static_cast<unsigned int>(rnd(2.0f)); //<! random number between 0 and 2;
     32            if(j<2){
     33                this->size_ = 9.0f;
     34                OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
     35                this->TotalStones_.push_back(stone);
     36                this->attach(stone);
     37                stone->setPosition(size_*i -55.5f, 0, 0.0f);
    3738
    3839
    3940
    40             if(this->orxoblox_ != nullptr)
    41             {
    42                 stone->setGame(this->orxoblox_);
    43                 if(this->orxoblox_->getCenterpoint() != nullptr)
    44                     stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate());
     41                if(this->orxoblox_ != nullptr)
     42                {
     43                    stone->setGame(this->orxoblox_);
     44                    if(this->orxoblox_->getCenterpoint() != nullptr)
     45                        stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate());
     46                    else
     47                        orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl;
     48                }
    4549                else
    46                     orxout()<< "tetris_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl;
     50                    orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl;
    4751            }
    48             else
    49                 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl;
    5052
    5153        }
Note: See TracChangeset for help on using the changeset viewer.