Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2007, 4:00:23 PM (17 years ago)
Author:
nicolasc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/spike_ball.cc

    r10256 r10260  
    6868
    6969  this->size = 4;
     70
     71  this->launcher = new Vector [this->getFragments()];
     72
    7073//   this->fastFactory = tFastFactory<Spike>::getFastFactory(CL_SPIKE, "Spike");
    7174
     
    120123    SpikeBall::explosionParticles->setColor(1.0, .8,.8,.7,.0);
    121124  }
    122 
    123125  this->setDamage(5);
    124126  this->setHealth(0);
     
    177179{
    178180  Spike* pj = NULL;
    179 
     181/*  printf( "KA-" );*/
    180182  for ( int i = 0; i < this->getFragments(); i++)
    181183  {
    182184    pj  = new Spike();
    183     if (pj == NULL)
    184       return;
    185 
     185    assert( pj );
     186/*    printf(" %i", i);*/
    186187    pj->setParent(PNode::getNullParent());
    187188
     
    192193    Quaternion q;
    193194    pj->setAbsDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
     195
     196    pj->toList(this->getOMListNumber());
     197
    194198/*
    195199    pj->setAbsCoor(this->getAbsCoor() + VECTOR_RAND(3));
     
    197201    pj->activate();
    198202  }
     203/*  printf( "BOOM\n" );*/
    199204}
    200205
     
    250255{
    251256  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    252   Vector v = this->velocity * dt;
     257  Vector v = this->getVelocity() * dt;
    253258  this->shiftCoor(v);
    254259
    255   if(this->lifeCycle > .9){
    256 //     printf("called by spikeball  ");
    257 //     this->weaponMan->fire();
     260//   if(this->lifeCycle > .9){
     261// /*    printf("time to blow:  ");*/
     262// //     this->weaponMan->fire();
     263// /*    this->blow();*/
     264//   }
     265
     266  if (this->tickLifeCycle(dt)){
    258267    this->blow();
    259   }
    260 
    261   if (this->tickLifeCycle(dt))
    262       this->deactivate();
     268    this->deactivate();
     269  }
    263270
    264271  this->updateAngle( dt );
Note: See TracChangeset for help on using the changeset viewer.