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, 03:17 PM
goblinm.gif
Ah, I see. What you might want to do is something like:

int &starting_x = sp_x(&current_sprite, -1);
int &starting_y = sp_y(&current_sprite, -1);
int &my_x;
int &my_y;

loophere:
int &my_x = sp_x(&current_sprite, -1);
int &my_y = sp_y(&current_sprite, -1);
if (&my_x < &starting_x)
{
if (&my_y <= &starting_y)
{
sp_mx(&current_sprite, 5)
sp_my(&current_sprite, -10);
}
else
{
sp_mx(&current_sprite, -10)
sp_my(&current_sprite, -5);
}
}
else
{
if (&my_y <= &starting_y)
{
sp_mx(&current_sprite, 10)
sp_my(&current_sprite, 5);
}
else
{
sp_mx(&current_sprite, -5);
sp_my(&current_sprite, 10);
}
}
wait(50);
goto loophere;

Your script seems kind of weird. Keep in mind, when you compare my_x to x_max, you are comparing the x-coordinate of the sprite to the x-value 40, which is off the screen to the left.