Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

more improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.