Move object in a arc
by Harrison Brock · in Torque Game Builder · 08/21/2006 (10:25 am) · 1 replies
I have any object that need to move with in arc in 2D space the arc is not in object. I have two pads that will stop the ball
This is what I have right now:
function ball::onMouseDown(%this, %modifier, %worldPosition, %mouseClicks)
{
while($ballmaxAngle <45)
{
%this.setLinearVelocityPolar($ballmaxAngle,10);
$ballmaxAngle++;
}
}
when the ballmaxAngle = 45 the ball need to start move in the other direction to make a full arc.
Here what I think to happen
At the start of the game:
1.$ballmazAngle = 0;
2. When User click on the ball the $ballmaxAngle start to increase in the ball start move.
3. When $ballmaxAngle = 45 the ball needs to start move down the other side of the arc.
4. Decrease $ballmaxAngle until its is 0.
Is their any function to do arc in TGB?
Harrison Brock
This is what I have right now:
function ball::onMouseDown(%this, %modifier, %worldPosition, %mouseClicks)
{
while($ballmaxAngle <45)
{
%this.setLinearVelocityPolar($ballmaxAngle,10);
$ballmaxAngle++;
}
}
when the ballmaxAngle = 45 the ball need to start move in the other direction to make a full arc.
Here what I think to happen
At the start of the game:
1.$ballmazAngle = 0;
2. When User click on the ball the $ballmaxAngle start to increase in the ball start move.
3. When $ballmaxAngle = 45 the ball needs to start move down the other side of the arc.
4. Decrease $ballmaxAngle until its is 0.
Is their any function to do arc in TGB?
Harrison Brock
Torque Owner Shane B.