- Timestamp:
- Nov 20, 2017, 3:21:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
r11573 r11575 67 67 collDisX_ = 0; 68 68 collDisZ_ = 0; 69 70 orxout() << "fireball existed" << endl; 71 69 hitCounter_ = 0; 72 70 73 71 } … … 90 88 SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject); 91 89 90 92 91 if(gumba!=nullptr && !(gumba->hasCollided_)) //if other object is a Gumba, kill the Gumba and add score and destroy the fireball 93 92 { … … 99 98 this->hasCollided_ = true; 100 99 } 100 101 101 102 //collision with either top or bottom of a block 102 103 else if(changeAllowed_ && (abs(collDisX_)<=abs(collDisZ_))) … … 104 105 changeAllowed_ = false; 105 106 Vector3 velocity = getVelocity(); 106 orxout() << "before: velocity in z = " << velocity.z << endl;107 107 velocity.z = -velocity.z; 108 orxout() << "after: velocity in z = " << velocity.z << endl;108 109 109 110 110 setVelocity(velocity); … … 114 114 else if(changeAllowed_ && (abs(collDisX_)>abs(collDisZ_))) 115 115 { 116 orxout() << "collision with the vertical side of a block " << endl;117 118 116 changeAllowed_ = false; 119 117 goesRight_=!goesRight_; 120 118 } 121 119 120 hitCounter_++; 122 121 123 122 return true; … … 154 153 velocity.x = dir*speed_; 155 154 velocity.y = 0; 155 if(hitCounter_ >= 3) velocity.y = 50; 156 156 setVelocity(velocity); 157 157 158 158 lastPos_ = getPosition(); 159 160 if(abs(this->getPosition().z) > 1000) delete this; 159 161 160 162 }
Note: See TracChangeset
for help on using the changeset viewer.