The Dink Network

Reply to Re: scripting help needed

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
May 12th 2007, 12:41 AM
goblinm.gif
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(&current_sprite, &thisx);
sp_y(&current_sprite, &thisy);
wait(50);
goto loophere: