Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 14, 2010, 12:41:04 PM (15 years ago)
Author:
gnadler
Message:

rockentcontroller doesn't control the rocket it spawns itself.
Rocket collides wih asteroids& at least drones but does not despawn.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/RocketController.cc

    r6863 r6900  
    4242    RocketController::RocketController(BaseObject* creator) : Controller(creator)
    4343    {
     44                RegisterObject(RocketController);
    4445                COUT(0)<< "RocketController constructed\n";
    4546
    46         RegisterObject(RocketController);
     47       
    4748                this->rocket = new SimpleRocket(this);
    48                 this->rocket->setController(dynamic_cast<RocketController*>(this));
     49                this->rocket->setController(this);
    4950                this->setControllableEntity(dynamic_cast<ControllableEntity*> (rocket));
    5051                this->haha=0;
     
    6364
    6465        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        }
    7369
    7470
    7571        RocketController::~RocketController() {
     72
    7673               
    7774                COUT(0)<< "RocketController destroyed\n";
Note: See TracChangeset for help on using the changeset viewer.