Changeset 643 for code/branches/FICN/src/orxonox/objects/SpaceShip.cc
- Timestamp:
- Dec 19, 2007, 2:41:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/SpaceShip.cc
r633 r643 27 27 28 28 #include "SpaceShip.h" 29 #include "Projectile.h" 29 30 30 31 #include "../../tinyxml/tinyxml.h" … … 45 46 46 47 SetConfigValue(bInvertMouse_, true); 48 SetConfigValue(reloadTime_, 0.1); 47 49 48 50 this->setMouseEventCallback_ = false; 51 this->bMousePressed_ = false; 49 52 50 53 this->tt_ = 0; … … 52 55 this->greenNode_ = 0; 53 56 this->blinkTime_ = 0; 57 58 this->timeToReload_ = 0; 54 59 55 60 this->moveForward_ = 0; … … 201 206 } 202 207 208 bool SpaceShip::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) 209 { 210 this->bMousePressed_ = true; 211 212 return true; 213 } 214 215 bool SpaceShip::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) 216 { 217 this->bMousePressed_ = false; 218 } 219 203 220 void SpaceShip::tick(float dt) 204 221 { … … 221 238 this->redNode_->setScale(redScale, redScale, redScale); 222 239 this->greenNode_->setScale(greenScale, greenScale, greenScale); 240 } 241 242 if (this->timeToReload_ > 0) 243 this->timeToReload_ -= dt; 244 else 245 this->timeToReload_ = 0; 246 247 if (this->bMousePressed_ && this->timeToReload_ <= 0) 248 { 249 Projectile* proj = new Projectile(this); 250 this->timeToReload_ = this->reloadTime_; 223 251 } 224 252
Note: See TracChangeset
for help on using the changeset viewer.