Changeset 10261 in orxonox.OLD for branches/playability/src/world_entities/space_ships
- Timestamp:
- Jan 17, 2007, 4:14:41 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/space_ships/space_ship.cc
r10260 r10261 155 155 Weapon* wpRight1 = new LightBlaster (); 156 156 wpRight1->setName( "LightBlaster"); 157 //wpRight1->setParent( this);158 157 Weapon* wpLeft1 = new LightBlaster (); 159 158 wpLeft1->setName( "LightBlaster"); 160 //wpLeft1->setParent( this);161 159 162 160 Weapon* wpRight2 = new MediumBlaster (); 163 161 wpRight2->setName( "MediumBlaster"); 164 //wpRight2->setParent( this);165 162 Weapon* wpLeft2 = new MediumBlaster (); 166 163 wpLeft2->setName( "MediumBlaster"); 167 //wpLeft2->setParent( this);168 164 169 165 Weapon* wpRight3 = new HeavyBlaster (1); 170 166 wpRight3->setName( "HeavyBlaster"); 171 //wpRight3->setParent( this);172 167 Weapon* wpLeft3 = new HeavyBlaster (0); 173 168 wpLeft3->setName( "HeavyBlaster"); 174 //wpLeft3->setParent( this);175 169 176 170 Weapon* cannon = new SwarmLauncher(); … … 180 174 spike->setName( "SpikeThrower" ); 181 175 182 Weapon* spike2 = new SpikeLauncher();183 spike2->setName( "SpikeLauncher" );176 // Weapon* spike2 = new SpikeLauncher(); 177 // spike2->setName( "SpikeLauncher" ); 184 178 185 179 this->weaponMan.addWeapon( wpLeft1, 0, 0); … … 203 197 this->secWeaponMan.addWeapon( cannon, 0, 0); 204 198 this->secWeaponMan.addWeapon( spike, 1, 1); 205 this->secWeaponMan.addWeapon( spike2, 2, 2);199 // this->secWeaponMan.addWeapon( spike2, 2, 2); 206 200 207 201 208 202 this->weaponMan.changeWeaponConfig(3); 209 this->secWeaponMan.changeWeaponConfig( 1);203 this->secWeaponMan.changeWeaponConfig(0); 210 204 211 205 curWeaponPrimary = 3; … … 367 361 this->setSupportedPlaymodes(Playable::Horizontal | Playable::Vertical); 368 362 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); 372 365 this->trail->setTexture( "maps/engine.png"); 373 366 374 this->trailL = new Trail( 10, 10, .2, this); 375 //this->trailL->setParent( this); 367 this->trailL = new Trail( 5, 10, .2, this); 376 368 this->trailL->setTexture( "maps/engine.png"); 377 369 378 this->trailR = new Trail( 10, 10, .2, this); 379 //this->trailR->setParent( this); 370 this->trailR = new Trail( 5, 10, .2, this); 380 371 this->trailR->setTexture( "maps/engine.png"); 381 372 … … 384 375 385 376 //FIXME Just testaddition to show the wobblegrid 377 /* 386 378 this->test = new Wobblegrid(5); 387 379 test->setTexture("maps/blub.png"); … … 389 381 test->setAbsCoor( this->getAbsCoor() + Vector(0, 2, 0)); 390 382 test->setParent( this); 383 */ 391 384 392 385 } … … 448 441 void SpaceShip::postSpawn () 449 442 { 443 if(this->hasPlayer()) 444 Playable::postSpawn(); 445 450 446 //setCollision(new CollisionCluster(1.0, Vector(0,0,0))); 451 447 } … … 460 456 461 457 WorldEntity* ref = NULL; 462 /**463 * this function is called, when two entities collide464 * @param entity: the world entity with whom it collides465 *466 * Implement behaviour like damage application or other miscellaneous collision stuff in this function467 */468 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)469 {470 }471 458 472 459 /** … … 485 472 glMultMatrixf((float*)matrix); 486 473 //glScalef(2.0, 2.0, 2.0); // no double rescale 487 474 /* // FIXME 488 475 this->trail->draw(); 489 476 … … 493 480 glTranslatef(0,0,1); 494 481 this->trailR->draw(); 482 */ 495 483 glPopMatrix(); 496 484 //this->debug(0); … … 503 491 void SpaceShip::tick (float time) 504 492 { 505 // Playable::tick(time);$ 506 this->test->tick(time); 493 // Playable::tick(time); 494 495 // this->test->tick(time); 496 507 497 // Own Tick Setup, as a different fire routine is used on the weapon manager 508 498 this->weaponMan.tick(time); … … 552 542 this->oldPos = this->getAbsCoor(); 553 543 544 //FIXME 554 545 this->trail->tick(time); 555 546 this->trailL->tick(time); 556 547 this->trailR->tick(time); 557 558 this->weaponMan.setParentEntity( this);559 this->secWeaponMan.setParentEntity( this);560 548 561 549 //orient the spaceship in direction of the mouse … … 566 554 //this->setAbsDirSoft(mouseDir,5); 567 555 */ 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 effect580 //cycle += time;581 //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);582 583 //readjust584 //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 589 556 /* 590 557 this->shiftCoor(move); … … 674 641 void SpaceShip::destroy( WorldEntity* killer ) 675 642 { 643 if(this->hasPlayer()) 644 Playable::destroy( killer); 645 676 646 PRINTF(5)("spaceship destroy\n"); 677 647 678 648 EmitterNode* node = NULL; 679 649 DotEmitter* emitter = NULL; … … 706 676 if( !node->start()) 707 677 PRINTF(0)("Explosion node not correctly started!"); 708 709 678 /* 710 679 PNode* node = new PNode(); … … 713 682 explosion->explode( node, Vector(5,5,5)); 714 683 */ 715 684 /* 716 685 if( this->hasPlayer()) 717 686 { … … 720 689 } 721 690 else 722 { 691 {*/ 723 692 this->setAbsCoor( this->getAbsCoor() + Vector(100,0,0) + Vector(1,0,0) * VECTOR_RAND(150).dot(Vector(1,0,0))); 724 }693 //} 725 694 726 695 } … … 728 697 void SpaceShip::respawn( ) 729 698 { 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(); 756 700 } 757 701 … … 1095 1039 { 1096 1040 this->damage(killer->getDamage(),0); 1097 killer->collidesWith( this, this->getAbsCoor());1098 //this->collidesWith(killer, this->getAbsCoor());1099 1041 } 1100 1042 -
branches/playability/src/world_entities/space_ships/space_ship.h
r10156 r10261 55 55 inline Vector getVelocity() { return this->velocity; }; 56 56 57 virtual void collidesWith(WorldEntity* entity, const Vector& location);58 57 virtual void tick(float time); 59 58 virtual void draw() const; … … 200 199 Trail* trailR; //!< Burst trail 201 200 202 Wobblegrid* test;201 // Wobblegrid* test; 203 202 204 203 };
Note: See TracChangeset
for help on using the changeset viewer.