Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2015, 2:05:43 PM (8 years ago)
Author:
gania
Message:

fixed loops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc

    r10855 r10856  
    11201120        }
    11211121    }
     1122    void CommonController::takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b)
     1123    {
     1124      this->parsedActionpoints_ = vector;
     1125      this->loopActionpoints_ = loop;
     1126      this->bLoop_ = b;
     1127      this->setAction (Action::NONE);
     1128      this->setTarget(0);
     1129      this->setTargetPosition (this->getControllableEntity()->getWorldPosition());
     1130      orxout(internal_error) << "Top action is " << this->parsedActionpoints_.back().action << endl;
     1131    }
     1132    void CommonController::boostControl()
     1133    {
     1134        SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity());
     1135        if(ship == NULL) return;
     1136        if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost
     1137        {
     1138
     1139            this->getControllableEntity()->boost(true);
     1140        }
     1141        else if(ship->getBoostPower()*4.0f < ship->getInitialBoostPower()) //lower limit ->do not boost
     1142        {
     1143           this->getControllableEntity()->boost(false);
     1144        }
     1145    }
    11221146}
Note: See TracChangeset for help on using the changeset viewer.