Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2017, 4:00:44 PM (7 years ago)
Author:
zarron
Message:

Boss shoots now limited amount of Gumbas

Location:
code/branches/SOBv2_HS17/src/modules/superorxobros
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.h

    r11629 r11632  
    6161
    6262            bool hasCollided_;
     63            SOBGumbaBoss* creator_;
    6364        protected:
    6465            float gravityAcceleration_;
     
    6970            bool changeAllowed_;
    7071            float changedOn_;
    71             SOBGumbaBoss* creator_;
     72
    7273           
    7374    };
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc

    r11629 r11632  
    5454        RegisterObject(SOBGumbaBoss);
    5555
    56         gumbaMaxTime_ = 4;
     56        gumbaMaxTime_ = 1;
    5757        gumbaTime_ = 0;
    58         maxGumbas = 10; //Max Gumbas spawnable by a Boss
     58        maxGumbas = 2; //Max Gumbas spawnable by a Boss
    5959       
    6060    }
     
    9191        gumbaTime_ += dt;
    9292
    93         if(gumbaTime_ > gumbaMaxTime_){
    94             spawnGumba();
    95             gumbaTime_ = 0;
     93        if(gumbaTime_ > gumbaMaxTime_){ //Spawn Gumba
     94            int gumbaCounter=0;
     95
     96            for (SOBGumba*  gumbaInstance : ObjectList<SOBGumba>())
     97            {
     98                if (gumbaInstance != nullptr && gumbaInstance->creator_==this)
     99                {
     100                    gumbaCounter++;
     101                }
     102            }
     103
     104
     105            if(gumbaCounter<maxGumbas){   
     106                spawnGumba();
     107                gumbaTime_ = 0;
     108            }
    96109        }
    97110
     
    114127         Vector3 spawnpos = this->getWorldPosition();
    115128         spawnpos.z += 0;
     129         gumba->creator_=this;
    116130
    117131        if (gumba != nullptr && center_ != nullptr)
Note: See TracChangeset for help on using the changeset viewer.