Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12395 for code


Ignore:
Timestamp:
May 16, 2019, 7:16:49 PM (5 years ago)
Author:
pomselj
Message:

kinda done

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

Legend:

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

    r12394 r12395  
    112112            }
    113113        */
     114
     115        for (OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()) {
     116            if(stone != nullptr)
     117            stone->destroy();
     118        }
     119
     120
    114121        for (OrxoBloxWall* wall : this->activeWalls_) {
    115122            if (wall != nullptr)
     
    117124        }
    118125        this->activeWalls_.clear();
    119        
    120 
    121         for (OrxoBloxStones* stone : this->stones_) {
    122             if(stone != nullptr)
    123             stone->destroy();
    124         }
     126
    125127        this->stones_.clear();
    126128        if(this->playership != nullptr) {
     
    189191        // Call end for the parent class.
    190192        Deathmatch::end();
    191         GSLevel::startMainMenu();
     193        //GSLevel::startMainMenu();
    192194    }
    193195
     
    214216
    215217        orxout() << "level up called" << endl;
    216         //this->playerScored(this->player_);// add points
     218        this->playerScored(this->player_);// add points
    217219
    218220        this->createWall();
    219221        this->activeWalls_.push_back(this->futureWall_);
    220 /*        for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
     222        for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
    221223            this->stones_.push_back(this->futureWall_->getStone(i));
    222         }*/
     224        }
    223225
    224226        for(OrxoBloxWall* wall : this->activeWalls_) {
     
    244246        //create balls
    245247        //insert new wall
    246         for(OrxoBloxStones* stone : this->stones_){
    247             if (stone != nullptr) {
     248        for(OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()){
     249            if (stone->isA(Class(OrxoBloxStones))) {
    248250                int x_=(stone->getPosition()).x;
    249251                int y_=(stone->getPosition()).y;
     
    256258                    this->end();
    257259                }
     260            }
     261            else {
     262                stone = nullptr;
    258263            }
    259264        }
     
    341346  */ 
    342347    void OrxoBlox::count() {
    343         if(this->counter >= this->max_counter) {
     348        if(++(this->counter) >= this->max_counter) {
    344349            this->LevelUp();
    345350            counter = 0;
    346351            return;
    347352        }
    348         else {
    349             this->counter++;
    350         }
    351353    }
    352354
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12394 r12395  
    111111            std::vector<OrxoBloxStones*> stones_; //!< A list of all stones in play.
    112112            int counter;
    113             const int max_counter = 10;
     113            const int max_counter = 4;
    114114
    115115    };
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc

    r12393 r12395  
    6161        }
    6262
    63         this->num_Stones_ = TotalStones_.size();
    64 
    6563
    6664
     
    9795
    9896    int OrxoBloxWall::getNumberOfStones() {
    99         return num_Stones_;
     97        return TotalStones_.size();
    10098    }
    10199
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h

    r12360 r12395  
    4646            void reduceNumberOfStones();
    4747            void setNumberOfStones(int number);
     48            std::vector<OrxoBloxStones*> TotalStones_;
    4849        private:
    4950            void createWall(void);
     
    5152            unsigned int totalhealth_;
    5253            unsigned int num_Stones_;
    53             unsigned int size_;
    54             std::vector<OrxoBloxStones*> TotalStones_; //!< A list of all stones in a Wall.
     54            unsigned int size_; //!< A list of all stones in a Wall.
    5555            bool delay_;
    5656            OrxoBlox* orxoblox_;
Note: See TracChangeset for help on using the changeset viewer.