- Timestamp:
- Mar 16, 2005, 11:26:57 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.conf
r2636 r3584 5 5 RIGHT=right 6 6 SPACE=fire 7 m=weapon_mode 7 8 ESCAPE=quit 8 9 p=pause -
orxonox/trunk/src/world_entities/player.cc
r3583 r3584 83 83 } 84 84 85 /** 86 \brief the function called for each passing timeSnap 87 \param time The timespan passed since last update 88 */ 89 void Player::tick (float time) 90 { 91 // movement 92 this->move (time); 93 } 85 86 /** 87 \brief the action occuring if the player left the game 88 */ 89 void Player::leftWorld () 90 {} 91 92 94 93 95 94 /** … … 113 112 } 114 113 115 /**116 \brief The connection to the command node117 \param cmd the Command unit from witch to map118 119 here the commands are mapped to the players movement/weaponary120 */121 void Player::command (Command* cmd)122 {123 //printf("Player|recieved command [%s]\n", cmd->cmd);124 if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp;125 else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp;126 else if( !strcmp( cmd->cmd, "left")) bLeft = !cmd->bUp;127 else if( !strcmp( cmd->cmd, "right")) bRight = !cmd->bUp;128 else if( !strcmp( cmd->cmd, "fire")) bFire = !cmd->bUp;129 }130 114 131 115 /** … … 151 135 152 136 153 /*PN 154 void Player::getLookat(Location* locbuf) 155 { 156 *locbuf = *getLocation(); 157 //locbuf->dist += 5.0; 158 } 159 */ 160 161 /** 162 \brief the action occuring if the player left the game 163 */ 164 void Player::leftWorld () 165 { 166 } 137 /** 138 \brief the function called for each passing timeSnap 139 \param time The timespan passed since last update 140 */ 141 void Player::tick (float time) 142 { 143 // player controlled movement 144 this->move (time); 145 // weapon system manipulation 146 this->fire(); 147 } 148 167 149 168 150 /** … … 174 156 Vector accel(0.0, 0.0, 0.0); 175 157 /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */ 176 //Placement *pos = getPlacement();177 158 178 159 /* calculate the direction in which the craft is heading */ … … 189 170 if( bDescend) {/* FIXME */} /* \todo up and down player movement */ 190 171 191 //Location* l = getLocation();192 193 // r(t) = r(0) + v(0)*t + 1/2*a*t^2194 // r = position195 // v = velocity196 // a = acceleration197 198 /* this the base-speed of the player: determines how fast and how the player follows the track*/199 //l->dist = l->dist + travelSpeed * time;200 201 // Vector* shift = new Vector (this->travelSpeed * time, 0, 0);202 // this->shiftCoor (shift);203 204 /* this updates the player position on the track - user interaction */205 //l->pos = l->pos + accel*time;206 172 Vector move = accel * time; 207 173 this->shiftCoor (&move); 208 174 } 175 176 177 /** 178 \brief weapon manipulation by the player 179 */ 180 void Player::fire() 181 { 182 if(this->bFire) 183 { 184 185 } 186 if(this->bWeaponChange) 187 { 188 189 } 190 } 191 192 193 /** 194 \brief The connection to the command node 195 \param cmd the Command unit from witch to map 196 197 here the commands are mapped to the players movement/weaponary 198 */ 199 void Player::command (Command* cmd) 200 { 201 //printf("Player|recieved command [%s]\n", cmd->cmd); 202 if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp; 203 else if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp; 204 else if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp; 205 else if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp; 206 else if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp; 207 else if( !strcmp( cmd->cmd, "weapon_mode")) this->bWeaponChange = !cmd->bUp; 208 } -
orxonox/trunk/src/world_entities/player.h
r3583 r3584 43 43 bool bDescend; //!< descend button presses. 44 44 bool bFire; //!< fire button pressed. 45 bool bWeaponChange; //!< weapon change button pressed 45 46 46 47 tList<Weapon>* weapons;//!< a list of weapon … … 51 52 52 53 void move(float time); 54 void fire(void); 53 55 54 56 };
Note: See TracChangeset
for help on using the changeset viewer.