Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2006, 10:03:19 PM (17 years ago)
Author:
marcscha
Message:

many additions, several fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10099 r10107  
    585585void SpaceShip::destroy( WorldEntity* killer )
    586586{
    587   PRINTF(0)("spaceship destroy\n");
     587  PRINTF(5)("spaceship destroy\n");
    588588 
    589589  EmitterNode* node  = NULL;
     
    591591  SpriteParticles*  explosionParticles  = NULL;
    592592
    593   explosionParticles = new SpriteParticles(100);
    594   explosionParticles->setName("MBoltExplosionParticles");
    595   explosionParticles->setLifeSpan(.5, .3);
     593  explosionParticles = new SpriteParticles(200);
     594  explosionParticles->setName("SpaceShipExplosionParticles");
     595  explosionParticles->setLifeSpan(.2, .3);
    596596  explosionParticles->setRadius(0.0, 10.0);
    597597  explosionParticles->setRadius(.5, 6.0);
     
    600600  explosionParticles->setColor(0.1,  1,1,0,.9);
    601601  explosionParticles->setColor(0.5, .8,.4,0,.5);
    602   explosionParticles->setColor(1.0, .2,.2,.2,.0);
    603 
    604  
    605   emitter = new DotEmitter( 200, 200, M_2_PI);
    606   emitter->setSpread( 0, M_2_PI);
    607   emitter->setEmissionRate( 400.0);
     602  explosionParticles->setColor(1.0, .2,.2,.2,.5);
     603
     604 
     605  emitter = new DotEmitter( 2000, 70, 360);
     606  //emitter->setSpread( 0, M_2_PI);
     607  emitter->setEmissionRate( 200.0);
    608608  //emitter->setEmissionVelocity( 200.0);
    609   emitter->setSystem( explosionParticles);
    610   emitter->setAbsCoor( this->getAbsCoor());
    611 
    612   node  = new EmitterNode( 1);
     609  //emitter->setSystem( explosionParticles);
     610  //emitter->setAbsCoor( this->getAbsCoor());
     611
     612  node  = new EmitterNode( .1f);
    613613  node->setupParticle( emitter, explosionParticles);
    614   node->setVelocity( this->getParent()->getVelocity());
     614  node->setAbsDir( this->getAbsDir());
     615  node->setVelocity( this->getVelocity() * .9f);
    615616  node->setAbsCoor( this->getAbsCoor());
    616   node->start();
     617  if( !node->start())
     618    PRINTF(0)("Explosion node not correctly started!");
     619
    617620/*
    618621  PNode* node          = new PNode();
     
    621624  explosion->explode( node, Vector(5,5,5));
    622625*/
    623   this->setAbsCoor(Vector(-10000,10000,10000));
    624   //this->hide();
    625 
    626   this->toList( OM_DEAD);
    627   PRINTF(0)("spaceship destroy == ship translated \n");
     626
     627  if( this->hasPlayer())
     628  {
     629        this->setAbsCoor(Vector(-10000,10000,10000));
     630        this->hide();
     631  }
     632  else
     633  {
     634    this->setAbsCoor( this->getAbsCoor() + Vector(150,0,0) + Vector(1,0,0) * VECTOR_RAND(50).dot(Vector(1,0,0)));
     635  }
     636
    628637}
    629638
    630639void SpaceShip::respawn( )
    631640{
    632   //this->unhide();
     641  this->unhide();
    633642  /*for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)
    634643  {
Note: See TracChangeset for help on using the changeset viewer.