Changeset 3878 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc
- Timestamp:
- Apr 18, 2005, 6:12:16 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r3877 r3878 38 38 Player::Player() : WorldEntity() 39 39 { 40 this->weapons = new tList<Weapon>();41 this->activeWeapon = NULL;42 40 /* 43 41 this is the debug player - actualy we would have to make a new … … 51 49 bUp = bDown = bLeft = bRight = bAscend = bDescend = false; 52 50 bFire = false; 51 this->bWeaponChange = false; 53 52 acceleration = 10.0; 54 53 //weapons: … … 57 56 Weapon* wpLeft = new TestGun(this, new Vector(-2.6, 0.1, -3.0), new Quaternion(), 1); 58 57 59 this->weaponMan->addWeapon(wpRight );60 this->weaponMan->addWeapon(wpLeft );58 this->weaponMan->addWeapon(wpRight, W_CONFIG0); 59 this->weaponMan->addWeapon(wpLeft, W_CONFIG1); 61 60 62 61 //this->weapons->add(wpRight); … … 74 73 this only frees the memory allocated to save the list. 75 74 */ 76 delete this->weapons;77 75 delete this->weaponMan; 78 76 } … … 85 83 void Player::addWeapon(Weapon* weapon) 86 84 { 87 this->weapon s->add(weapon);85 this->weaponMan->addWeapon(weapon); 88 86 } 89 87 … … 95 93 void Player::removeWeapon(Weapon* weapon) 96 94 { 97 this->weapon s->remove(weapon);95 this->weaponMan->removeWeapon(weapon); 98 96 } 99 97 … … 157 155 glPopMatrix(); 158 156 159 //this->activeWeapon->draw();160 //this->activeWeaponL->draw();161 157 this->weaponMan->draw(); 162 158 } … … 221 217 if( this->bWeaponChange) 222 218 { 223 //this->activeWeapon->deactivate();224 //this->weapons->enumerate(); FIX: strang weapon change...225 //this->activeWeapon = this->weapons->nextElement(this->activeWeapon);226 //this->activeWeapon->activate();227 219 this->weaponMan->nextWeaponConf(); 220 this->bWeaponChange = false; 228 221 } 229 222 } … … 244 237 if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp; 245 238 if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp; 246 if( !strcmp( cmd->cmd, "mode")) this->bWeaponChange = !cmd->bUp;247 } 239 if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange; 240 }
Note: See TracChangeset
for help on using the changeset viewer.