Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2014, 3:43:07 PM (9 years ago)
Author:
fvultier
Message:

Es wird nun angezeigt, wie lange ein item noch aktiv ist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc

    r10111 r10184  
    7070        animateHands_ = false;
    7171        turnUp_ = false;
    72         rocketActive_ = false;
    73         propellerActive_ = false;
    74         bootsActive_ = false;
    75         shieldActive_ = false;
     72        rocketActive_ = NULL;
     73        propellerActive_ = NULL;
     74        bootsActive_ = NULL;
     75        shieldActive_ = NULL;
    7676        rocketSpeed_ = 0.0;
    7777        propellerSpeed_ = 0.0;
     
    106106                // Move up/down
    107107                Vector3 velocity = getVelocity();
    108                 if (rocketActive_ == true)
     108                if (rocketActive_ != NULL)
    109109                {
    110110                        velocity.z = rocketSpeed_;
    111111                }
    112                 else if (propellerActive_ == true)
     112                else if (propellerActive_ != NULL)
    113113                {
    114114                        velocity.z = propellerSpeed_;
     
    207207        {
    208208                Vector3 velocity = getVelocity();
    209                 velocity.z = (bootsActive_ ? 1.2*jumpSpeed_ : jumpSpeed_);
     209            if (bootsActive_ == NULL)
     210            {
     211                velocity.z = 1.2*jumpSpeed_;
     212            }
     213            else
     214            {
     215                velocity.z = jumpSpeed_;
     216            }
    210217                setVelocity(velocity);
    211 
    212218                animateHands_ = true;
    213219                handAngle_ = 0.0;
     
    228234    void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy)
    229235        {
    230         if (rocketActive_ == false && propellerActive_ == false && shieldActive_ == false)
     236        if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)
    231237                {
    232238                        dead_ = true;
     
    236242    bool JumpFigure::StartRocket(JumpRocket* rocket)
    237243    {
    238         if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
     244        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
    239245        {
    240246                attach(rocket);
    241247                rocket->setPosition(0.0, rocketPos_, 0.0);
    242248                rocket->setVelocity(0.0, 0.0, 0.0);
    243                 rocketActive_ = true;
     249                rocketActive_ = rocket;
    244250
    245251                return true;
     
    255261        detach(rocket);
    256262                rocket->destroy();
    257                 rocketActive_ = false;
     263                rocketActive_ = NULL;
    258264    }
    259265
    260266    bool JumpFigure::StartPropeller(JumpPropeller* propeller)
    261267    {
    262         if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
     268        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
    263269        {
    264270                attach(propeller);
    265271                propeller->setPosition(0.0, 0.0, propellerPos_);
    266272                propeller->setVelocity(0.0, 0.0, 0.0);
    267                 propellerActive_ = true;
     273                propellerActive_ = propeller;
    268274
    269275                return true;
     
    279285        detach(propeller);
    280286        propeller->destroy();
    281         propellerActive_ = false;
     287        propellerActive_ = NULL;
    282288    }
    283289
    284290    bool JumpFigure::StartBoots(JumpBoots* boots)
    285291    {
    286         if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
     292        if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
    287293        {
    288294                attach(boots);
    289295                boots->setPosition(0.0, 0.0, bootsPos_);
    290296                boots->setVelocity(0.0, 0.0, 0.0);
    291                 bootsActive_ = true;
     297                bootsActive_ = boots;
    292298
    293299                return true;
     
    303309        detach(boots);
    304310        boots->destroy();
    305         bootsActive_ = false;
     311        bootsActive_ = NULL;
    306312    }
    307313
     
    313319                shield->setPosition(0.0, 0.0, propellerPos_);
    314320                shield->setVelocity(0.0, 0.0, 0.0);
    315                 shieldActive_ = true;
     321                shieldActive_ = shield;
    316322
    317323                return true;
     
    327333        detach(shield);
    328334        shield->destroy();
    329         shieldActive_ = false;
     335        shieldActive_ = NULL;
    330336    }
    331337
Note: See TracChangeset for help on using the changeset viewer.