Changeset 6588 in orxonox.OLD for branches/powerups
- Timestamp:
- Jan 18, 2006, 4:41:00 PM (19 years ago)
- Location:
- branches/powerups/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/powerups/src/world_entities/playable.cc
r6547 r6588 149 149 Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon(); 150 150 WeaponManager* manager = this->getWeaponManager(); 151 int slot = manager->getNextFreeSlot(2, weapon->getCapability()); 152 if(slot >= 0) { 153 manager->addWeapon(weapon, 2, slot); 154 return true; 155 } 151 manager->addWeapon(weapon, 2, -1); 152 return true; 156 153 } 157 154 else if(powerUp->isA(CL_PARAM_POWER_UP)) { -
branches/powerups/src/world_entities/power_ups/power_up.cc
r6547 r6588 28 28 29 29 this->respawnType = RESPAWN_NONE; 30 this->respawnStart = 10; 31 this->model = NULL; 30 32 /* if(!PowerUp::sphereModel) {*/ 31 33 … … 58 60 if(dynamic_cast<Extendable*>(entity)->pickup(this)) 59 61 { 62 this->respawnTime = this->respawnStart; 60 63 this->toList(OM_DEAD_TICK); 64 } 65 } 66 } 67 68 void PowerUp::tick(float dt) { 69 if(this->getOMListNumber() != OM_COMMON) { 70 this->respawnTime -= dt; 71 if(this->respawnTime <= 0) { 72 this->toList(OM_COMMON); 73 this->respawn(); 61 74 } 62 75 } … … 65 78 void PowerUp::draw() const 66 79 { 80 if(this->model != NULL) { 81 glMatrixMode(GL_MODELVIEW); 82 glPushMatrix(); 83 glTranslatef (this->getAbsCoor ().x, 84 this->getAbsCoor ().y, 85 this->getAbsCoor ().z); 86 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 87 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 88 this->model->draw(); 89 glPopMatrix(); 90 } 67 91 this->sphereMaterial->select(); 68 92 WorldEntity::draw(); 69 /*glMatrixMode(GL_MODELVIEW);70 glPushMatrix();71 72 glTranslatef (this->getAbsCoor ().x,73 this->getAbsCoor ().y,74 this->getAbsCoor ().z);75 Vector tmpRot = this->getAbsDir().getSpacialAxis();76 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );77 78 this->sphereMaterial->select();79 this->getModel(0)->draw();80 81 glPopMatrix();*/82 93 } 83 94 -
branches/powerups/src/world_entities/power_ups/power_up.h
r6512 r6588 24 24 25 25 virtual void draw () const; 26 virtual void tick(float dt); 26 27 void setRespawnType(const char* type); 27 28 … … 33 34 virtual ~PowerUp (); 34 35 virtual void respawn() {}; 36 Model* model; 35 37 36 38 private: 37 39 Material* sphereMaterial; 38 40 PowerUpRespawn respawnType; 41 float respawnTime; 42 float respawnStart; 39 43 static const char* respawnTypes[]; 40 44 }; -
branches/powerups/src/world_entities/power_ups/weapon_power_up.cc
r6547 r6588 69 69 LoadParam(root, "weaponID", this, WeaponPowerUp, setWeaponClass); 70 70 } 71 this->model = this->weapon->getModel(0); 71 72 } 72 73 -
branches/powerups/src/world_entities/weapons/turret.cc
r6547 r6588 45 45 this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav"); 46 46 47 this->loadModel("models/guns/turret1.obj");48 47 } 49 48 … … 97 96 this->setEmissionPoint(1.684, 0.472, 0); 98 97 //this->getProjectileFactory()->prepare(100); 98 this->loadModel("models/guns/turret1.obj"); 99 99 100 } 100 101
Note: See TracChangeset
for help on using the changeset viewer.