Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11628


Ignore:
Timestamp:
Dec 4, 2017, 3:29:13 PM (6 years ago)
Author:
varxth
Message:

more improvements

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

Legend:

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

    r11601 r11628  
    7676                points_+=100;
    7777            }
     78            void addGumbaBoss() {
     79                points_+=5000;
     80            }
    7881            void addPoints(int poi) {
    7982                points_+=poi;
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc

    r11601 r11628  
    4545#include "SOBMushroom.h"
    4646#include "SOBGumba.h"
     47#include "SOBGumbaBoss.h"
    4748#include "SOBFireball.h"
    4849#include "SOB.h"
     
    114115        SOBMushroom*    mush        = orxonox_cast<SOBMushroom*>    (otherObject);
    115116        SOBGumba*       gumba       = orxonox_cast<SOBGumba*>       (otherObject);
     117        SOBGumbaBoss*   gumbaBoss   = orxonox_cast<SOBGumbaBoss*>       (otherObject);
    116118        SOBFlagstone*   flagstone   = orxonox_cast<SOBFlagstone*>   (otherObject);
    117119        SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*> (otherObject);
    118         SOBFireball* fireball       = orxonox_cast<SOBFireball*>    (otherObject);
     120        SOBFireball*    fireball    = orxonox_cast<SOBFireball*>    (otherObject);
    119121        SOB* SOBGame                = orxonox_cast<SOB*>            (getGametype());
    120122
     
    133135           
    134136        }
     137
    135138       
    136139
    137140        //Check if otherObject is a Gumba (that walking enemies)
    138141
    139          else if (gumba != nullptr && !(gumba->hasCollided_)) {
     142         else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {
    140143
    141144            //If player jumps on its head, kill the Gumba, else, kill the player
     
    159162
    160163
    161         }
    162     }
    163 
     164            }
     165        }
     166        else if (gumbaBoss != nullptr && !(gumbaBoss->hasCollided_)) {
     167            if (getVelocity().z >= -20) {
     168                // If player hasn't a power up, he dies. Else he dies directly.
     169                this->die();
     170            }
     171
     172            else {
     173                gumbaBoss->destroyLater();
     174                gumbaBoss->hasCollided_ = true;
     175                SOBGame->addGumbaBoss();
     176                }
     177        }
    164178        else if (fireball != nullptr && !(fireball->hasCollided_)){
    165179            if(PowerUpCounter_ == 0){
     
    168182            PowerUpCounter_--;
    169183            this->changeClothes();
     184            fireball->destroyLater();
    170185        }
    171186
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc

    r11626 r11628  
    5454        RegisterObject(SOBGumbaBoss);
    5555
    56         gumbaMaxTime_ = 10;
     56        gumbaMaxTime_ = 5;
    5757        gumbaTime_ = 0;
    5858       
     
    9191   
    9292        gumbaTime_ += dt;
    93         orxout() << "gumbaTime_ = " << gumbaTime_ << endl;
    9493
    9594        if(gumbaTime_ > gumbaMaxTime_){
    9695            spawnFireball();
    97             orxout() << "shoot" << endl;
    9896            gumbaTime_ = 0;
    9997        }
Note: See TracChangeset for help on using the changeset viewer.