Reply to Re: scripting help needed
If you don't have an account, just leave the password field blank.
Obviously, you could do this with loops if you wanted, although it would take a few more variables. The point is, you should use sp_x and sp_y rather than sp_mx and sp_my (it looks much better.)
I guess an efficient loop might be:
int &dinkx;
int &dinky;
int &thisx;
int &thisy;
int &x_offset = 0;
int &y_offset = -40;
loophere:
&dinkx = sp_x(1, -1);
&dinky = sp_y(1, -1);
&thisx = &dinkx;
&thisy = &dinky;
if (&x_offset >= 0)
{
&y_offset += 10;
if (&y_offset == 50)
{
&y_offset = 30;
}
}
else
{
&y_offset -= 10;
}
if (&y_offset >= 0)
{
&x_offset -= 10;
if (&x_offset == -50)
{
&x_offset = -30;
}
}
else
{
&x_offset += 10;
}
&thisx += &x_offset;
&thisy += &y_offset;
sp_x(¤t_sprite, &thisx);
sp_y(¤t_sprite, &thisy);
wait(50);
goto loophere:
I guess an efficient loop might be:
int &dinkx;
int &dinky;
int &thisx;
int &thisy;
int &x_offset = 0;
int &y_offset = -40;
loophere:
&dinkx = sp_x(1, -1);
&dinky = sp_y(1, -1);
&thisx = &dinkx;
&thisy = &dinky;
if (&x_offset >= 0)
{
&y_offset += 10;
if (&y_offset == 50)
{
&y_offset = 30;
}
}
else
{
&y_offset -= 10;
}
if (&y_offset >= 0)
{
&x_offset -= 10;
if (&x_offset == -50)
{
&x_offset = -30;
}
}
else
{
&x_offset += 10;
}
&thisx += &x_offset;
&thisy += &y_offset;
sp_x(¤t_sprite, &thisx);
sp_y(¤t_sprite, &thisy);
wait(50);
goto loophere: