Changeset 4010 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc
- Timestamp:
- May 2, 2005, 3:14:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4000 r4010 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 31 29 32 30 using namespace std; 31 32 CREATE_FACTORY(Player); 33 33 34 34 /** … … 74 74 } 75 75 76 /** 77 \brief creates a new Player from Xml Data 78 \param root the xml element containing player data 79 80 \todo add more parameters to load 81 */ 82 Player::Player(TiXmlElement* root) : WorldEntity(root) 83 { 84 /* 85 char* temp; 86 const char* string; 87 string = grabParameter( root, "name"); 88 if( string == NULL) 89 { 90 PRINTF0("Player is missing a proper 'name'\n"); 91 string = "Unknown"; 92 temp = new char[strlen(string + 2)]; 93 strcpy( temp, string); 94 this->setName( temp); 95 } 96 else 97 { 98 temp = new char[strlen(string + 2)]; 99 strcpy( temp, string); 100 this->setName( temp); 101 } 102 103 this->model = NULL; 104 string = grabParameter( root, "model"); 105 if( string != NULL) 106 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN); 107 else 108 { 109 PRINTF0("Player is missing a proper 'model'\n"); 110 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN); 111 } 112 if( this->model == NULL) 113 { 114 PRINTF0("Player model '%s' could not be loaded\n", string); 115 } 116 */ 117 this->weapons = new tList<Weapon>(); 118 this->activeWeapon = NULL; 119 /* 120 this is the debug player - actualy we would have to make a new 121 class derivated from Player for each player. for now, we just use 122 the player.cc for debug also 123 */ 124 travelSpeed = 15.0; 125 velocity = new Vector(); 126 bUp = bDown = bLeft = bRight = bAscend = bDescend = false; 127 bFire = false; 128 this->bWeaponChange = false; 129 acceleration = 10.0; 130 //weapons: 131 this->weaponMan = new WeaponManager(); 132 Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0); 133 Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1); 134 135 this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0); 136 this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1); 137 this->weaponMan->addWeapon(wpRight, W_CONFIG2); 138 this->weaponMan->addWeapon(wpLeft, W_CONFIG2); 139 } 76 140 77 141 /**
Note: See TracChangeset
for help on using the changeset viewer.