Changeset 4877 in orxonox.OLD for orxonox/branches/weaponSystem/src/world_entities/player.cc
- Timestamp:
- Jul 16, 2005, 10:38:04 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/weaponSystem/src/world_entities/player.cc
r4836 r4877 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 … … 266 252 * weapon manipulation by the player 267 253 */ 268 void Player::weapon ()254 void Player::weaponAction() 269 255 { 270 256 if( this->bFire) … … 277 263 this->bWeaponChange = false; 278 264 } 279 }280 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 265 } 298 266
Note: See TracChangeset
for help on using the changeset viewer.