- Timestamp:
- Dec 17, 2014, 3:43:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
r10111 r10184 70 70 animateHands_ = false; 71 71 turnUp_ = false; 72 rocketActive_ = false;73 propellerActive_ = false;74 bootsActive_ = false;75 shieldActive_ = false;72 rocketActive_ = NULL; 73 propellerActive_ = NULL; 74 bootsActive_ = NULL; 75 shieldActive_ = NULL; 76 76 rocketSpeed_ = 0.0; 77 77 propellerSpeed_ = 0.0; … … 106 106 // Move up/down 107 107 Vector3 velocity = getVelocity(); 108 if (rocketActive_ == true)108 if (rocketActive_ != NULL) 109 109 { 110 110 velocity.z = rocketSpeed_; 111 111 } 112 else if (propellerActive_ == true)112 else if (propellerActive_ != NULL) 113 113 { 114 114 velocity.z = propellerSpeed_; … … 207 207 { 208 208 Vector3 velocity = getVelocity(); 209 velocity.z = (bootsActive_ ? 1.2*jumpSpeed_ : jumpSpeed_); 209 if (bootsActive_ == NULL) 210 { 211 velocity.z = 1.2*jumpSpeed_; 212 } 213 else 214 { 215 velocity.z = jumpSpeed_; 216 } 210 217 setVelocity(velocity); 211 212 218 animateHands_ = true; 213 219 handAngle_ = 0.0; … … 228 234 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 229 235 { 230 if (rocketActive_ == false && propellerActive_ == false && shieldActive_ == false)236 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL) 231 237 { 232 238 dead_ = true; … … 236 242 bool JumpFigure::StartRocket(JumpRocket* rocket) 237 243 { 238 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)244 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 239 245 { 240 246 attach(rocket); 241 247 rocket->setPosition(0.0, rocketPos_, 0.0); 242 248 rocket->setVelocity(0.0, 0.0, 0.0); 243 rocketActive_ = true;249 rocketActive_ = rocket; 244 250 245 251 return true; … … 255 261 detach(rocket); 256 262 rocket->destroy(); 257 rocketActive_ = false;263 rocketActive_ = NULL; 258 264 } 259 265 260 266 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 261 267 { 262 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)268 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 263 269 { 264 270 attach(propeller); 265 271 propeller->setPosition(0.0, 0.0, propellerPos_); 266 272 propeller->setVelocity(0.0, 0.0, 0.0); 267 propellerActive_ = true;273 propellerActive_ = propeller; 268 274 269 275 return true; … … 279 285 detach(propeller); 280 286 propeller->destroy(); 281 propellerActive_ = false;287 propellerActive_ = NULL; 282 288 } 283 289 284 290 bool JumpFigure::StartBoots(JumpBoots* boots) 285 291 { 286 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)292 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 287 293 { 288 294 attach(boots); 289 295 boots->setPosition(0.0, 0.0, bootsPos_); 290 296 boots->setVelocity(0.0, 0.0, 0.0); 291 bootsActive_ = true;297 bootsActive_ = boots; 292 298 293 299 return true; … … 303 309 detach(boots); 304 310 boots->destroy(); 305 bootsActive_ = false;311 bootsActive_ = NULL; 306 312 } 307 313 … … 313 319 shield->setPosition(0.0, 0.0, propellerPos_); 314 320 shield->setVelocity(0.0, 0.0, 0.0); 315 shieldActive_ = true;321 shieldActive_ = shield; 316 322 317 323 return true; … … 327 333 detach(shield); 328 334 shield->destroy(); 329 shieldActive_ = false;335 shieldActive_ = NULL; 330 336 } 331 337
Note: See TracChangeset
for help on using the changeset viewer.