Atempting to create a throttle movement system
by Isaac Dutton · in Torque Game Engine · 07/17/2006 (12:23 pm) · 1 replies
Ok I have the following code, its in default.bind.cs. I edited the moveforward function.
What I am atempting to do here is make it so when the W key is held the player throttles up. This will make the player move faster as the throttle is held.
The problem is that the throttle goes up REALLY fast I kinda want a variable on how fast it goes up to make for accleration rates on the players movement.
%Throttle = 0;
function moveforward(%val)
{
while (%Throttle < 100 && %val = 1)
{
%Throttle = %Throttle + 1;
}
$mvForwardAction = %Throttle * $movementSpeed;
echo(%Throttle);
echo( $movementSpeed);
echo($mvForwardAction);
}
What I am atempting to do here is make it so when the W key is held the player throttles up. This will make the player move faster as the throttle is held.
The problem is that the throttle goes up REALLY fast I kinda want a variable on how fast it goes up to make for accleration rates on the players movement.
About the author
Torque Owner Cliff