Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2019, 3:30:57 PM (5 years ago)
Author:
ahuwyler
Message:

Walls are bigger

File:
1 edited

Legend:

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

    r12308 r12331  
    44
    55#include "OrxoBlox.h"
     6#include "OrxoBloxStones.h"
     7#include "OrxoBloxCenterpoint.h"
     8#include "util/Math.h"
    69
    710namespace orxonox
     
    1619        RegisterObject(OrxoBloxWall);
    1720
    18         this->health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
     21        this->num_Stones_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;
    1922        this->delay_ = false;
    2023        this->orxoblox_ = this->getOrxoBlox();
     24        this->createWall();
     25    }
    2126
    2227
    23         OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
    24         if(this->orxoblox_ != nullptr)
     28    void OrxoBloxWall::createWall(void){
     29
     30        for (unsigned int i=0; i<this->num_Stones_;++i){
     31            OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
     32
     33
     34            this->TotalStones_.push_back(stone);
     35            this->attach(stone);
     36           
     37            stone->setPosition(0.0f, i, 0.0f);
     38
     39
     40
     41            if(this->orxoblox_ != nullptr)
    2542            {
    2643                stone->setGame(this->orxoblox_);
     
    3249            else
    3350                orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl;
     51
     52        }
     53
     54
     55
     56        // OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
     57        // if(this->orxoblox_ != nullptr)
     58        //     {
     59        //         stone->setGame(this->orxoblox_);
     60        //         if(this->orxoblox_->getCenterpoint() != nullptr)
     61        //             stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate());
     62        //         else
     63        //             orxout()<< "orxoblox_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl;
     64        //     }
     65        //     else
     66        //         orxout()<< "orxoblox_ == nullptr in TetrisBrick.cc"<< endl;
    3467    }
    3568
     69    OrxoBloxStones* OrxoBloxWall::getStone(unsigned int i)
     70    {
     71        if(i < this->TotalStones_.size())
     72            return this->TotalStones_[i];
     73        else return nullptr;
     74    }
    3675
    3776    OrxoBlox* OrxoBloxWall::getOrxoBlox()
Note: See TracChangeset for help on using the changeset viewer.