Changeset 10113 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 19, 2006, 11:39:59 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/mbolt.cc
r10104 r10113 24 24 25 25 #include "particles/dot_emitter.h" 26 #include "particles/box_emitter.h"27 26 #include "particles/sprite_particles.h" 28 27 … … 47 46 { 48 47 this->registerObject(this, MBolt::_objectList); 49 this->loadModel("models/projectiles/mbolt.obj" );48 this->loadModel("models/projectiles/mbolt.obj",4); 50 49 51 50 … … 59 58 60 59 //this->emitter = new DotEmitter(1000, 0, 0); 61 this->emitter = new DotEmitter( 200, 0, 0);60 this->emitter = new DotEmitter(50, 0, 0); 62 61 this->emitter->setParent(this); 63 62 this->emitter->setSpread(M_PI,M_PI); … … 76 75 dynamic_cast<StaticModel*>(this->getModel())->finalize(); 77 76 77 dynamic_cast<StaticModel*>(this->getModel())->rebuild(); 78 this->buildObbTree(4); 78 79 79 80 this->trail = new Trail(6,4,.1, this); 80 81 //this->trail->setParent( this); 81 82 this->trail->setTexture( "maps/laser.png"); 82 this->trail->setAbsCoor(this->getAbsCoor() - Vector( 1,0,0));83 this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0)); 83 84 } 84 85 … … 110 111 MBolt::explosionParticles = new SpriteParticles(1000); 111 112 MBolt::explosionParticles->setName("MBoltExplosionParticles"); 112 MBolt::explosionParticles->setLifeSpan(. 5, .3);113 MBolt::explosionParticles->setLifeSpan(.2, .1); 113 114 MBolt::explosionParticles->setRadius(0.0, 10.0); 114 115 MBolt::explosionParticles->setRadius(.5, 6.0); … … 126 127 this->emitter->setSpread(0); 127 128 this->emitter->setEmissionRate(10.0); 128 this->emitter->setEmissionVelocity( 0);129 this->emitter->setEmissionVelocity(50); 129 130 } 130 131 … … 136 137 this->lifeCycle = 0.0; 137 138 138 this->toList(OM_NULL); 139 this->removeNode(); 139 //this->toList(OM_NULL); 140 this->toList(OM_DEAD); 141 //this->removeNode(); 140 142 MBolt::fastFactory->kill(this); 141 143 } … … 145 147 { 146 148 PRINTF(0)("MBolt collides pretest\n"); 149 147 150 if( entity == NULL) 148 151 return; … … 196 199 glMultMatrixf((float*)matrix); 197 200 198 glScalef(0.75 , 0.7/4, 0.7/4); // no double rescale201 glScalef(0.75/4, 0.7/16, 0.7/16); // no double rescale 199 202 200 203 this->mat->select(); 201 204 dynamic_cast<StaticModel*>(this->getModel())->draw(); 202 205 this->mat->unselect(); 203 glScalef( 1/.75,4/.7,4/.7);204 glTranslatef(- 4,0,0);206 glScalef(4/.75,16/.7,16/.7); 207 glTranslatef(-3,0,0); 205 208 this->trail->draw(); 206 209 glPopMatrix(); 207 210 glPopAttrib(); 208 211 209 210 } 211 212 } 213 -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10109 r10113 34 34 #include "particles/emitter_node.h" 35 35 #include "particles/sprite_particles.h" 36 #include "effects/explosion.h"37 36 #include "effects/trail.h" 38 37 … … 52 51 #include "state.h" 53 52 #include "player.h" 53 54 54 55 55 #include "util/loading/load_param.h" … … 173 173 this->weaponMan.addWeapon( wpLeft1, 0, 0); 174 174 this->weaponMan.addWeapon( wpRight1, 0, 1); 175 this->weaponMan.addWeapon( wpLeft2, 0, 2); 176 this->weaponMan.addWeapon( wpRight2, 0, 3); 177 this->weaponMan.addWeapon( wpLeft3, 0, 4); 178 this->weaponMan.addWeapon( wpRight3, 0, 5); 179 180 this->secWeaponMan.addWeapon( cannon, 1, 0); 181 182 this->weaponMan.changeWeaponConfig(0); 183 this->secWeaponMan.changeWeaponConfig(1); 175 this->weaponMan.addWeapon( wpLeft2, 1, 0); 176 this->weaponMan.addWeapon( wpRight2, 1, 1); 177 this->weaponMan.addWeapon( wpLeft3, 2, 0); 178 this->weaponMan.addWeapon( wpRight3, 2, 1); 179 180 this->secWeaponMan.addWeapon( cannon, 0, 0); 181 184 182 185 183 wpRight1->requestAction(WA_ACTIVATE); 186 184 wpLeft1->requestAction(WA_ACTIVATE); 185 187 186 wpRight2->requestAction(WA_ACTIVATE); 188 187 wpLeft2->requestAction(WA_ACTIVATE); … … 192 191 cannon->requestAction(WA_ACTIVATE); 193 192 194 curWeaponPrimary = 0; 193 194 this->weaponMan.changeWeaponConfig(1); 195 this->secWeaponMan.changeWeaponConfig(0); 196 197 curWeaponPrimary = 1; 195 198 curWeaponSecondary = 0; 196 199 … … 339 342 this->trailR->setTexture( "maps/engine.png"); 340 343 341 344 342 345 this->toList(OM_GROUP_00); 343 346 } … … 376 379 this->secWeaponMan.showCrosshair(); 377 380 this->toList( OM_GROUP_01 ); 378 379 for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)380 {381 if( likely( dynamic_cast<Weapon*>(*it) != NULL))382 dynamic_cast<WorldEntity*>(*it)->toList( OM_GROUP_01);383 }384 381 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true); 385 382 //this->attachCamera(); … … 391 388 this->secWeaponMan.hideCrosshair(); 392 389 this->toList( OM_GROUP_00); 393 394 for(ObjectList<PNode>::const_iterator it = this->getNodesChildren().begin(); it != this->getNodesChildren().end(); it++)395 {396 if( likely( dynamic_cast<Weapon*>(*it) != NULL))397 dynamic_cast<WorldEntity*>(*it)->toList( OM_GROUP_00);398 }399 390 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false); 400 391 //this->detachCamera(); … … 516 507 this->trailR->tick(time); 517 508 509 this->weaponMan.setParentEntity( this); 510 this->secWeaponMan.setParentEntity( this); 511 518 512 //orient the spaceship in direction of the mouse 519 513 /* … … 558 552 { 559 553 //Playable::process(event); 560 554 561 555 if( event.type == KeyMapper::PEV_LEFT) 562 556 this->bLeft = event.bPressed; … … 571 565 else if( event.type == KeyMapper::PEV_FIRE1) 572 566 this->bFire = event.bPressed; 567 else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed) 568 { 569 this->nextWeaponConfig(); 570 } 571 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 572 this->previousWeaponConfig(); 573 573 574 574 … … 632 632 else 633 633 { 634 this->setAbsCoor( this->getAbsCoor() + Vector(1 50,0,0) + Vector(1,0,0) * VECTOR_RAND(50).dot(Vector(1,0,0)));634 this->setAbsCoor( this->getAbsCoor() + Vector(100,0,0) + Vector(1,0,0) * VECTOR_RAND(150).dot(Vector(1,0,0))); 635 635 } 636 636 … … 963 963 } 964 964 965 /** 966 * @brief jumps to the next WeaponConfiguration 967 */ 968 void SpaceShip::nextWeaponConfig() 969 { 970 971 this->curWeaponPrimary = (curWeaponPrimary + 1) % 3; 972 this->weaponMan.changeWeaponConfig(this->curWeaponPrimary); 973 Playable::weaponConfigChanged(); 974 } 975 976 /** 977 * @brief moves to the last WeaponConfiguration 978 */ 979 void SpaceShip::previousWeaponConfig() 980 { 981 this->curWeaponPrimary = (curWeaponPrimary + 1) % 3; 982 this->weaponMan.changeWeaponConfig(this->curWeaponPrimary); 983 Playable::weaponConfigChanged(); 984 } -
branches/playability/src/world_entities/space_ships/space_ship.h
r10098 r10113 78 78 void setPlaymodeXML(const std::string& playmode); 79 79 virtual void movement (float dt); 80 81 void nextWeaponConfig(); 82 void previousWeaponConfig(); 83 84 inline void hit(float damage, WorldEntity* killer) { this->collidesWith(killer, this->getAbsCoor()); killer->collidesWith(this, this->getAbsCoor()); } ; 80 85 81 86 private: -
branches/playability/src/world_entities/weapons/swarm_launcher.cc
r10109 r10113 150 150 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 151 151 { 152 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 200)152 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300) 153 153 { 154 154 pj = this->getProjectile(); -
branches/playability/src/world_entities/world_entity.cc
r10101 r10113 803 803 void WorldEntity::hit(float damage, WorldEntity* killer) 804 804 { 805 805 806 this->decreaseHealth(damage); 806 807
Note: See TracChangeset
for help on using the changeset viewer.