Changeset 6903 for code/branches/rocket/src/modules
- Timestamp:
- May 15, 2010, 2:57:51 PM (15 years ago)
- Location:
- code/branches/rocket/src/modules/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/modules/weapons/RocketController.cc
r6902 r6903 64 64 65 65 SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity()); 66 rocket->rotatePitch(0.005); 67 rocket->setVelocity(rocket->getVelocity()*1.02); 66 if (this->target_) { 67 rocket->rotatePitch(0.5); 68 rocket->rotateYaw(0.5); 69 } 70 rocket->setVelocity(rocket->getVelocity()*1.03); 68 71 69 72 } … … 77 80 78 81 82 void RocketController::setTarget(Pawn* target) { 83 this->target_ = target; 84 } 85 86 87 79 88 80 89 } -
code/branches/rocket/src/modules/weapons/RocketController.h
r6863 r6903 53 53 virtual void tick(float dt); 54 54 SimpleRocket* getRocket(){return this->rocket;}; 55 void setTarget(Pawn* target); 55 56 protected: 56 57 … … 60 61 WeakPtr<PlayerInfo> player_; 61 62 int haha; 63 WeakPtr<Pawn> target_; 62 64 63 65
Note: See TracChangeset
for help on using the changeset viewer.