Accelerating Rockets
Created By: | Errorabove[ScI] |
eMail: | errorabove@hotmail.com |
Difficulty Scale: | Beginner |
missile.velocity = missile.velocity * 1000;This is just telling the rocket to fly at a speed of 1000 at the desired angle.
missile.nextthink = time + 5; missile.think = SUB_Remove;This is telling the rocket to call the function SUB_Remove ();, which makes the rocket go BYE BYE, in 5 seconds after the launching.
missile.nextthink = time + 0.01; missile.think = RocketSpeedChange;This calls my new function to speed up the rocket in 0.01 seconds after the rocket is launched.
.float rspeed; // counter for how many times the rocket changes speed void() RocketSpeedChange = { if (self.rspeed < 10) // 10 is the max speed changes { self.velocity = self.velocity * 2; // up the speed by 2x self.rspeed = self.rspeed + 1; // up the counter to tell it to stop self.nextthink = time + 0.5; // redo this function } };There ya go.... that's all... HAVE FUN!