Changeset 6693 in orxonox.OLD for branches/network/src/world_entities/weapons/targeting_turret.cc
- Timestamp:
- Jan 25, 2006, 2:19:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/weapons/targeting_turret.cc
r6675 r6693 81 81 this->setStateDuration(WS_DEACTIVATING, .4); 82 82 83 this->set MaximumEnergy(10000, 50);83 this->setEnergyMax(10000); 84 84 this->increaseEnergy(100000); 85 85 … … 93 93 this->target = new Aim(this); 94 94 this->target->setVisibility(false); 95 95 this->target->setRange(100); 96 this->target->setAngle(M_PI_4/2); 97 this->lockedTime = 0; 98 this->neededLockTime = 2; 99 this->lockedTarget->setParent(PNode::getNullParent()); 96 100 this->loadModel("models/guns/turret2.obj"); 97 101 … … 120 124 void TargetingTurret::tick(float dt) 121 125 { 126 if( lockedTime >= neededLockTime ) 127 { 128 lockedTarget = this->target->getParent(); 129 lockedTime = 0; 130 } 122 131 123 132 this->target->tick(dt); 133 134 if(this->target->getParent() == PNode::getNullParent()) 135 lockedTime = 0; 136 else 137 lockedTime += dt; 138 124 139 } 125 140 … … 138 153 pj->setAbsDir(this->getAbsDir()); 139 154 pj->activate(); 140 this->target->searchTarget( 100);155 this->target->searchTarget(); 141 156 } 142 157
Note: See TracChangeset
for help on using the changeset viewer.