The Dink Network

Reply to Re: Touch with other sprites than Dink.

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:
 
 
October 28th 2009, 02:24 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Try the missile brain. It would come out something like this. Take note that it will change its direction when it hits something outside of its defined boundaries (I assume you have it going back and forth between two walls or something)

Btw if you ever want an enemy sprite to be affected by 'touching' another sprite, using the missile brain is the way to go.

void main(void)
{
int &x = 0;
sp_brain(&current_sprite,11);
sp_strength(&current_sprite,20);
sp_touch_damage(&current_sprite, -1);	
sp_speed(&current_sprite, 5);
sp_dir(&current_sprite,6);

roll:
&x = sp_x(&current_sprite,-1);
If(&x >= 400)
{
sp_dir(&current_sprite,4);
sp_seq(&current_sprite,854);
}
if (&x <= 160)
{
sp_dir(&current_sprite,6);
sp_seq(&current_sprite,856);
}	
		
}

void touch(void)
{
sp_touch_damage(&current_sprite, 0);	
freeze(1);
&life = 0;
wait(100);
sp_que(1, -1);
}

void damage(void)
{
goto roll;
}