- Timestamp:
- May 14, 2010, 12:41:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/modules/weapons/RocketController.cc
r6863 r6900 42 42 RocketController::RocketController(BaseObject* creator) : Controller(creator) 43 43 { 44 RegisterObject(RocketController); 44 45 COUT(0)<< "RocketController constructed\n"; 45 46 46 RegisterObject(RocketController);47 47 48 this->rocket = new SimpleRocket(this); 48 this->rocket->setController( dynamic_cast<RocketController*>(this));49 this->rocket->setController(this); 49 50 this->setControllableEntity(dynamic_cast<ControllableEntity*> (rocket)); 50 51 this->haha=0; … … 63 64 64 65 SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity()); 65 rocket->setAcceleration(rocket->getAcceleration()*2); 66 if (haha < 100) rocket->rotateYaw(10); 67 else { 68 if (rand() > 0.5) rocket->rotateRoll(5); 69 else rocket->rotatePitch(5); 70 } 71 72 } 66 rocket->moveRightLeft(5); 67 68 } 73 69 74 70 75 71 RocketController::~RocketController() { 72 76 73 77 74 COUT(0)<< "RocketController destroyed\n";
Note: See TracChangeset
for help on using the changeset viewer.