Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2017, 3:36:20 PM (8 years ago)
Author:
zarron
Message:

Boss now working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc

    r11628 r11629  
    5454        RegisterObject(SOBGumbaBoss);
    5555
    56         gumbaMaxTime_ = 5;
     56        gumbaMaxTime_ = 4;
    5757        gumbaTime_ = 0;
     58        maxGumbas = 10; //Max Gumbas spawnable by a Boss
    5859       
    5960    }
    60 
    61 
    6261
    6362   
     
    9392
    9493        if(gumbaTime_ > gumbaMaxTime_){
    95             spawnFireball();
     94            spawnGumba();
    9695            gumbaTime_ = 0;
    9796        }
     
    109108
    110109    }
    111     void SOBGumbaBoss::spawnFireball() {
     110    void SOBGumbaBoss::spawnGumba() {
    112111        SOBCenterpoint* center_ = ((SOB*)getGametype())->center_;
    113112
    114          SOBFireball* ball = new SOBFireball(center_->getContext());
     113         SOBGumba* gumba = new SOBGumba(center_->getContext());
    115114         Vector3 spawnpos = this->getWorldPosition();
    116115         spawnpos.z += 0;
    117116
    118         if (ball != nullptr && center_ != nullptr)
     117        if (gumba != nullptr && center_ != nullptr)
    119118        {
    120             ball->addTemplate("fireball");
     119            gumba->addTemplate("gumbaShootable");
    121120            bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6));
    122             ball->setDirection(direction);
     121            gumba->setDirection(direction);
    123122            if(direction)
    124123            {
    125                 spawnpos.x+=10;
     124                spawnpos.x+=20;
    126125            }
    127126            else
    128127            {
    129                 spawnpos.x-=10;
     128                spawnpos.x-=20;
    130129            }
    131             ball->setPosition(spawnpos);
     130            spawnpos.z+=15;
     131            gumba->setPosition(spawnpos);
    132132
    133133        }
    134134
    135         Vector3 velocity = ball->getVelocity();
     135        Vector3 velocity = gumba->getVelocity();
    136136        velocity.z -= 100;
    137         ball->setVelocity(velocity);
     137        gumba->setVelocity(velocity);
    138138     }
    139139}
Note: See TracChangeset for help on using the changeset viewer.