Changeset 4885 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc
- Timestamp:
- Jul 18, 2005, 3:36:18 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4836 r4885 23 23 24 24 #include "weapon_manager.h" 25 #include "weapon.h"26 25 #include "test_gun.h" 27 26 #include "world.h" 28 27 29 28 #include "list.h" 30 #include "stdincl.h"31 29 32 30 #include "event_handler.h" 33 31 34 #include "projectile.h"35 32 #include "event.h" 36 33 … … 41 38 42 39 /** 43 * 40 * creates a new Player 44 41 * @param isFree if the player is free 45 42 */ 46 43 Player::Player() 47 44 { 48 /*49 this is the debug player - actualy we would have to make a new50 class derivated from Player for each player. for now, we just use51 the player.cc for debug also52 */53 45 this->init(); 54 46 … … 75 67 delete this->weaponMan; 76 68 } 77 78 69 79 70 /** … … 119 110 120 111 /** 121 * 112 * loads the Settings of a Player from an XML-element. 122 113 * @param root the XML-element to load the Player's properties from 123 114 */ … … 132 123 133 124 /** 134 * 125 * adds a weapon to the weapon list of player 135 126 * @param weapon to add 136 127 */ … … 219 210 void Player::tick (float time) 220 211 { 221 //printf("%p\n", this);222 //this->getRelCoor().debug();223 224 /* link tick to weapon */225 //this->activeWeapon->tick(time);226 //this->activeWeaponL->tick(time); //FIX FIX DELETE REMOVE227 this->weaponMan->tick(time);228 212 // player controlled movement 229 213 this->move(time); 214 215 this->weaponMan->tick(time); 230 216 // weapon system manipulation 231 this->weapon ();217 this->weaponAction(); 232 218 } 233 219 … … 255 241 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 256 242 accel = accel + (orthDirection*acceleration); 257 if( this->bAscend ) 243 if( this->bAscend ) { /* FIXME */ } 258 244 if( this->bDescend) {/* FIXME */} /* @todo up and down player movement */ 259 245 … … 264 250 265 251 /** 266 * 267 */ 268 void Player::weapon ()252 * weapon manipulation by the player 253 */ 254 void Player::weaponAction() 269 255 { 270 256 if( this->bFire) … … 279 265 } 280 266 281 282 /**283 * The connection to the command node284 * @param cmd the Command unit from witch to map285 286 here the commands are mapped to the players movement/weaponary287 */288 void Player::command (Command* cmd)289 {290 PRINTF(3)("recieved command [%s]\n", cmd->cmd);291 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp;292 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp;293 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp;294 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp;295 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp;296 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;297 }298 299 267 /** 300 268 * @todo switch statement ?? … … 303 271 { 304 272 if( event.type == KeyMapper::PEV_UP) 305 {306 273 this->bUp = event.bPressed; 307 }308 274 else if( event.type == KeyMapper::PEV_DOWN) 309 {310 275 this->bDown = event.bPressed; 311 }312 276 else if( event.type == KeyMapper::PEV_RIGHT) 313 {314 277 this->bRight= event.bPressed; 315 }316 278 else if( event.type == KeyMapper::PEV_LEFT) 317 {318 279 this->bLeft = event.bPressed; 319 }320 280 else if( event.type == KeyMapper::PEV_FIRE1) 321 { 322 this->bFire = event.bPressed; 323 } 281 this->bFire = event.bPressed; 324 282 else if( event.type == KeyMapper::PEV_NEXT_WEAPON) 325 {326 283 if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange; 327 } 328 329 } 284 285 }
Note: See TracChangeset
for help on using the changeset viewer.