Changeset 3877 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 18, 2005, 5:34:39 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r3875 r3877 60 60 this->weaponMan->addWeapon(wpLeft); 61 61 62 this->weapons->add(wpRight);63 this->activeWeapon = wpRight;64 this->activeWeaponL = wpLeft;62 //this->weapons->add(wpRight); 63 //this->activeWeapon = wpRight; 64 //this->activeWeaponL = wpLeft; 65 65 } 66 66 … … 157 157 glPopMatrix(); 158 158 159 this->activeWeapon->draw(); 160 this->activeWeaponL->draw(); 159 //this->activeWeapon->draw(); 160 //this->activeWeaponL->draw(); 161 this->weaponMan->draw(); 161 162 } 162 163 … … 169 170 { 170 171 /* link tick to weapon */ 171 this->activeWeapon->tick(time); 172 this->activeWeaponL->tick(time); //FIX FIX DELETE REMOVE 172 //this->activeWeapon->tick(time); 173 //this->activeWeaponL->tick(time); //FIX FIX DELETE REMOVE 174 this->weaponMan->tick(time); 173 175 // player controlled movement 174 176 this->move(time); … … 186 188 Vector accel(0.0, 0.0, 0.0); 187 189 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 188 189 190 /* calculate the direction in which the craft is heading */ 190 191 Vector direction (1.0, 0.0, 0.0); … … 216 217 if( this->bFire) 217 218 { 218 //if(this->activeWeapon != NULL)219 //this->activeWeapon->fire();220 //FIX THIS FIX FIIIIIIIIIIIX221 //this->activeWeaponL->fire();222 219 this->weaponMan->fire(); 223 220 } 224 if( this->bWeaponChange && this->weapons->getSize() > 1)221 if( this->bWeaponChange) 225 222 { 226 PRINTF(1)("changing the weapon of the player: deactivate old, activate new\n"); 227 this->activeWeapon->deactivate(); 223 //this->activeWeapon->deactivate(); 228 224 //this->weapons->enumerate(); FIX: strang weapon change... 229 this->activeWeapon = this->weapons->nextElement(this->activeWeapon); 230 this->activeWeapon->activate(); 225 //this->activeWeapon = this->weapons->nextElement(this->activeWeapon); 226 //this->activeWeapon->activate(); 227 this->weaponMan->nextWeaponConf(); 231 228 } 232 229 } -
orxonox/trunk/src/world_entities/weapon.cc
r3875 r3877 77 77 void WeaponManager::nextWeaponConf() 78 78 { 79 PRINTF(3)("Changing weapon configuration: from %i ", this->currConfID); 79 80 int i; 80 81 for(i = this->currConfID; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i); 81 82 if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0; 82 83 else this->currConfID = i; 84 PRINTF(3)("to %i\n", this->currConfID); 83 85 } 84 86 … … 105 107 } 106 108 109 110 void WeaponManager::tick(float sec) 111 { 112 Weapon* w; 113 for(int i = 0; i < W_MAX_SLOTS; ++i) 114 { 115 w = this->configs[this->currConfID].slots[i]; 116 if( w != NULL) w->tick(sec); 117 } 118 } 119 120 121 void WeaponManager::draw() 122 { 123 Weapon* w; 124 for(int i = 0; i < W_MAX_SLOTS; ++i) 125 { 126 w = this->configs[this->currConfID].slots[i]; 127 if( w != NULL) w->draw(); 128 } 129 } 107 130 108 131 /** -
orxonox/trunk/src/world_entities/weapon.h
r3875 r3877 83 83 84 84 void fire(); 85 void tick(float sec); 86 void draw(); 85 87 86 88 private:
Note: See TracChangeset
for help on using the changeset viewer.