Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2007, 4:14:41 PM (17 years ago)
Author:
marcscha
Message:

Fixes and cleanups

File:
1 edited

Legend:

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

    r10260 r10261  
    155155  Weapon* wpRight1 = new LightBlaster ();
    156156  wpRight1->setName( "LightBlaster");
    157   //wpRight1->setParent( this);
    158157  Weapon* wpLeft1 = new LightBlaster ();
    159158  wpLeft1->setName( "LightBlaster");
    160   //wpLeft1->setParent( this);
    161159
    162160  Weapon* wpRight2 = new MediumBlaster ();
    163161  wpRight2->setName( "MediumBlaster");
    164   //wpRight2->setParent( this);
    165162  Weapon* wpLeft2 = new MediumBlaster ();
    166163  wpLeft2->setName( "MediumBlaster");
    167   //wpLeft2->setParent( this);
    168164
    169165  Weapon* wpRight3 = new HeavyBlaster (1);
    170166  wpRight3->setName( "HeavyBlaster");
    171   //wpRight3->setParent( this);
    172167  Weapon* wpLeft3 = new HeavyBlaster (0);
    173168  wpLeft3->setName( "HeavyBlaster");
    174   //wpLeft3->setParent( this);
    175169
    176170  Weapon* cannon = new SwarmLauncher();
     
    180174  spike->setName( "SpikeThrower" );
    181175
    182   Weapon* spike2 = new SpikeLauncher();
    183   spike2->setName( "SpikeLauncher" );
     176//  Weapon* spike2 = new SpikeLauncher();
     177//  spike2->setName( "SpikeLauncher" );
    184178
    185179  this->weaponMan.addWeapon( wpLeft1, 0, 0);
     
    203197  this->secWeaponMan.addWeapon( cannon, 0, 0);
    204198  this->secWeaponMan.addWeapon( spike, 1, 1);
    205   this->secWeaponMan.addWeapon( spike2, 2, 2);
     199//  this->secWeaponMan.addWeapon( spike2, 2, 2);
    206200
    207201
    208202  this->weaponMan.changeWeaponConfig(3);
    209   this->secWeaponMan.changeWeaponConfig(1);
     203  this->secWeaponMan.changeWeaponConfig(0);
    210204
    211205  curWeaponPrimary    = 3;
     
    367361  this->setSupportedPlaymodes(Playable::Horizontal | Playable::Vertical);
    368362
    369  
    370   this->trail = new Trail( 10, 10, .2, this);
    371   //this->trail->setParent( this);
     363  /// FIXME
     364  this->trail = new Trail( 5, 10, .2, this);
    372365  this->trail->setTexture( "maps/engine.png");
    373366
    374   this->trailL = new Trail( 10, 10, .2, this);
    375   //this->trailL->setParent( this);
     367  this->trailL = new Trail( 5, 10, .2, this);
    376368  this->trailL->setTexture( "maps/engine.png");
    377369
    378   this->trailR = new Trail( 10, 10, .2, this);
    379   //this->trailR->setParent( this);
     370  this->trailR = new Trail( 5, 10, .2, this);
    380371  this->trailR->setTexture( "maps/engine.png");
    381372
     
    384375
    385376  //FIXME Just testaddition to show the wobblegrid
     377/*
    386378  this->test  = new Wobblegrid(5);
    387379  test->setTexture("maps/blub.png");
     
    389381  test->setAbsCoor( this->getAbsCoor() + Vector(0, 2, 0));
    390382  test->setParent( this);
     383*/
    391384 
    392385}
     
    448441void SpaceShip::postSpawn ()
    449442{
     443  if(this->hasPlayer())
     444    Playable::postSpawn();
     445
    450446  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
    451447}
     
    460456
    461457WorldEntity* ref = NULL;
    462 /**
    463  *  this function is called, when two entities collide
    464  * @param entity: the world entity with whom it collides
    465  *
    466  * Implement behaviour like damage application or other miscellaneous collision stuff in this function
    467  */
    468 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
    469 {
    470 }
    471458
    472459/**
     
    485472  glMultMatrixf((float*)matrix);
    486473  //glScalef(2.0, 2.0, 2.0);  // no double rescale
    487  
     474  /*    // FIXME
    488475  this->trail->draw();
    489476 
     
    493480  glTranslatef(0,0,1);
    494481  this->trailR->draw();
     482*/
    495483  glPopMatrix();
    496484  //this->debug(0);
     
    503491void SpaceShip::tick (float time)
    504492{
    505   // Playable::tick(time);$
    506   this->test->tick(time);
     493  // Playable::tick(time);
     494
     495 // this->test->tick(time);
     496
    507497  // Own Tick Setup, as a different fire routine is used on the weapon manager
    508498  this->weaponMan.tick(time);
     
    552542  this->oldPos    = this->getAbsCoor();
    553543
     544//FIXME
    554545  this->trail->tick(time);
    555546  this->trailL->tick(time);
    556547  this->trailR->tick(time);
    557 
    558   this->weaponMan.setParentEntity( this);
    559   this->secWeaponMan.setParentEntity( this);
    560548
    561549  //orient the spaceship in direction of the mouse
     
    566554  //this->setAbsDirSoft(mouseDir,5);
    567555  */
    568 
    569   // this is the air friction (necessary for a smooth control)
    570   /*
    571   if(travelSpeed >= 120) velocity -= velocity.getNormalized()*travelSpeed*travelSpeed*0.0001;
    572   else if (travelSpeed <= 80) velocity -= velocity.getNormalized()*travelSpeed*0.001;
    573   */
    574 
    575   //other physics (gravity)
    576   //if(travelSpeed < 120)
    577   //move += Vector(0,-1,0)*60*time + Vector(0,1,0)*travelSpeed/2*time;
    578 
    579   //hoover effect
    580   //cycle += time;
    581   //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
    582 
    583   //readjust
    584   //if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
    585   //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
    586 
    587   //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
    588 
    589556  /*
    590557  this->shiftCoor(move);
     
    674641void SpaceShip::destroy( WorldEntity* killer )
    675642{
     643  if(this->hasPlayer())
     644    Playable::destroy( killer);
     645
    676646  PRINTF(5)("spaceship destroy\n");
    677  
     647
    678648  EmitterNode* node  = NULL;
    679649  DotEmitter* emitter = NULL;
     
    706676  if( !node->start())
    707677    PRINTF(0)("Explosion node not correctly started!");
    708 
    709678/*
    710679  PNode* node          = new PNode();
     
    713682  explosion->explode( node, Vector(5,5,5));
    714683*/
    715 
     684/*
    716685  if( this->hasPlayer())
    717686  {
     
    720689  }
    721690  else
    722   {
     691  {*/
    723692    this->setAbsCoor( this->getAbsCoor() + Vector(100,0,0) + Vector(1,0,0) * VECTOR_RAND(150).dot(Vector(1,0,0)));
    724   }
     693  //}
    725694
    726695}
     
    728697void SpaceShip::respawn( )
    729698{
    730   this->unhide();
    731   /*for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)
    732   {
    733     if( dynamic_cast<WorldEntity*>(*it) != NULL)
    734       dynamic_cast<WorldEntity*>(*it)->toList( OM_GROUP_00);
    735   }*/
    736   /*
    737   if( this->hasPlayer())
    738   {
    739     this->toList( OM_GROUP_01);
    740     for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)
    741         {
    742           if( likely( dynamic_cast<Weapon*>(*it) != NULL))
    743                 dynamic_cast<WorldEntity*>(*it)->toList( OM_GROUP_00_PROJ);
    744         }
    745   }
    746   else
    747   {
    748     this->toList( OM_GROUP_00);
    749     for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)
    750         {
    751           if( likely( dynamic_cast<Weapon*>(*it) != NULL))
    752                 dynamic_cast<WorldEntity*>(*it)->toList( OM_GROUP_01_PROJ);
    753         }
    754   }*/
    755 
     699  Playable::respawn();
    756700}
    757701
     
    10951039{
    10961040  this->damage(killer->getDamage(),0);
    1097   killer->collidesWith( this, this->getAbsCoor());
    1098   //this->collidesWith(killer, this->getAbsCoor());
    10991041}
    11001042
Note: See TracChangeset for help on using the changeset viewer.