Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2006, 2:19:46 PM (18 years ago)
Author:
patrick
Message:

branches: removed spaceshipcontrol branche

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/weapons/targeting_turret.cc

    r6675 r6693  
    8181  this->setStateDuration(WS_DEACTIVATING, .4);
    8282
    83   this->setMaximumEnergy(10000, 50);
     83  this->setEnergyMax(10000);
    8484  this->increaseEnergy(100000);
    8585
     
    9393  this->target = new Aim(this);
    9494  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());
    96100  this->loadModel("models/guns/turret2.obj");
    97101
     
    120124void TargetingTurret::tick(float dt)
    121125{
     126  if( lockedTime >= neededLockTime )
     127   {
     128    lockedTarget = this->target->getParent();
     129    lockedTime = 0;
     130   }
    122131
    123132  this->target->tick(dt);
     133
     134  if(this->target->getParent() == PNode::getNullParent())
     135   lockedTime = 0;
     136  else
     137   lockedTime += dt;
     138
    124139}
    125140
     
    138153  pj->setAbsDir(this->getAbsDir());
    139154  pj->activate();
    140   this->target->searchTarget(100);
     155  this->target->searchTarget();
    141156}
    142157
Note: See TracChangeset for help on using the changeset viewer.