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, 11:23 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
I'm kinda confused at the moment so let me know what I'm doing wrong... sorry for acting helpless

//testing spinning
void main( void )
{
sp_speed(&current_sprite, 1);
sp_timing(&current_sprite, 33);
sp_nohit(&current_sprite, 1);

int &x_max = 40;
int &x_min = -40;

int &y_max = 40;
int &y_min = -40;

int &my_x;
int &my_y;

int &x_val = 5;
int &y_val = -5;

sp_mx(&current_sprite, &x_val);
sp_my(&current_sprite, &y_val);

loop:
wait(1);

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

if (&my_x >= &x_max)
{
&x_val *= -1;
}

if (&my_x <= &x_min)
{
&x_val *= -1;
}

if (&my_y >= &y_max)
{
&y_val *= -1;
}

if (&my_y <= &y_min)
{
&y_val *= -1;
}

if (&x_val >= 0)
{

if (&y_val >= 0)
{
sp_dir(&current_sprite, 3);
}

if (&y_val < 0)
{
sp_dir(&current_sprite,9);
}
}

if (&x_val < 0)
{

if (&y_val >= 0)
{
sp_dir(&current_sprite, 1);
}

if (&y_val < 0)
{
sp_dir(&current_sprite, 7);
}
}

sp_mx(&current_sprite, &x_val);
sp_my(&current_sprite, &y_val);

goto loop;
}