Forum

Accelerating Rockets

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Accelerating Rockets

Postby redrum » Mon Sep 03, 2007 9:05 am

In errors tutorial on accelerating rockets, you have to create a new function. Where does this bit go?

Code: Select all
.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
   }
};
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
User avatar
redrum
 
Posts: 410
Joined: Wed Mar 28, 2007 11:35 pm
Location: Long Island, New York

Postby Lardarse » Mon Sep 03, 2007 12:53 pm

Anywhere before you need to use the function... meaning above the touch function for rockets, most likely.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest