So I am making a semi-puzzle/platformer game, and I need some help with wreaking balls. A player controls a ball, and using momentum and gravity, is able to grab onto different pegs. The problem is that I need it to be able to swing in an arcm and use the gathered speed. Here is what I have tried:
CODE
while distance_to_object(at)>dt mp_linear_step(...);
Made it bounce all weird (at is the one attached to, dt is recorded as soon as the ball hooks on, and is the distance to the peg (stays the same))
CODE
var n
while distance_to_object(at)>dt
{
mp_linear_step(...);
n=true;
}
if n=true speed=0;
while distance_to_object(at)>dt
{
mp_linear_step(...);
n=true;
}
if n=true speed=0;
Just made the player go very slow (I know why, but not how to fix it)
Any help would be appriciated!
Thanks for looking,
Connor