Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2017, 1:29:44 PM (7 years ago)
Author:
vyang
Message:

Asteroids2DShip ist 3s immun, nachdem es von einem Asteroiden getroffen wurde. Das Raumschiff hat nun eine Waffe → Richtung der Projektile muss noch angepasst werden

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc

    r11643 r11645  
    9898    {
    9999
    100         orxout() << "touched" << endl;
    101100        Asteroids2DStone* stone = orxonox_cast<Asteroids2DStone*>(otherObject);       
    102         if(stone != nullptr && (stone != lastStone || lastStone == nullptr))
     101        if(stone != nullptr && !bImmune)
    103102        {
    104103            removeHealth(100);
    105             lastStone = stone;
    106          
     104            this->getGame()->addPoints(10);
     105
     106            //The ship will be immune for 3 seconds after it has been hit by an asteroid
     107            bImmune = true;
     108            isimmune.setTimer(3.0f, false, createExecutor(createFunctor(&Asteroids2DShip::toggleImmune, this)));
     109            orxout()<< "touched" << endl;
    107110        }
    108111        return false;
Note: See TracChangeset for help on using the changeset viewer.