Changeset 11651 for code/branches/SOBv2_HS17
- Timestamp:
- Dec 11, 2017, 2:20:57 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17/src/modules/superorxobros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.cc
r11650 r11651 61 61 changedOn_ = 0.0; 62 62 creator_ = nullptr; 63 maxLifetime_ = 10; 64 lifetime_ = 0; 63 65 64 66 } … … 111 113 changedOn_+= dt; 112 114 // After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions! 113 if (changedOn_> 0. 200) {115 if (changedOn_> 0.400) { 114 116 changeAllowed_ = true; 115 117 changedOn_ = 0.0; … … 134 136 lastPos_ = getPosition(); 135 137 138 if (creator_ != nullptr) 139 { 140 lifetime_ += dt; 141 if(lifetime_>maxLifetime_) 142 { 143 this->destroyLater(); 144 } 145 } 146 136 147 } 137 148 } -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.h
r11632 r11651 70 70 bool changeAllowed_; 71 71 float changedOn_; 72 float maxLifetime_; 73 float lifetime_; 72 74 73 75
Note: See TracChangeset
for help on using the changeset viewer.