Changeset 1484
- Timestamp:
 - May 29, 2008, 1:01:47 PM (17 years ago)
 - Location:
 - code/branches/network/src/orxonox/objects
 - Files:
 - 
          
- 4 edited
 
- 
          SpaceShip.cc (modified) (1 diff)
 - 
          SpaceShip.h (modified) (1 diff)
 - 
          SpaceShipAI.cc (modified) (3 diffs)
 - 
          SpaceShipAI.h (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
        
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1481 r1484 315 315 XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode); 316 316 myShip_=true; // TODO: this is only a hack 317 317 318 SpaceShip::create(); 318 getFocus(); 319 if (this->isExactlyA(Class(SpaceShip))) 320 getFocus(); 319 321 } 320 322  - 
        
code/branches/network/src/orxonox/objects/SpaceShip.h
r1479 r1484 154 154 155 155 float emitterRate_; 156 157 protected: 156 158 bool myShip_; 157 159  - 
        
code/branches/network/src/orxonox/objects/SpaceShipAI.cc
r1480 r1484 68 68 for (int i = 4; i <= NUM_AI_TEAMS; ++i) 69 69 this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1); 70 71 actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action))); 70 } 71 72 void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode) 73 { 74 SpaceShip::XMLPort(xmlelement, mode); 75 myShip_=true; 76 77 this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action))); 72 78 } 73 79 … … 88 94 newenemy->setRotDamp(1.0); 89 95 Element xmlelement; 90 newenemy-> create();96 newenemy->XMLPort(xmlelement, XMLPort::LoadObject); 91 97 } 92 98 } … … 218 224 void SpaceShipAI::searchNewTargetPosition() 219 225 { 220 this->targetPosition_ += Vector3(rnd(-10000,10000), rnd(-10000,10000), rnd(-10000,10000));226 this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000)); 221 227 this->bHasTargetPosition_ = true; 222 228 }  - 
        
code/branches/network/src/orxonox/objects/SpaceShipAI.h
r1479 r1484 44 44 public: 45 45 SpaceShipAI(); 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 47 static void createEnemy(int num); 47 48 static void killEnemies(int num);  
Note: See TracChangeset
          for help on using the changeset viewer.
      


            






