The Dink Network

Reply to Re: Problems with multiple hits

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:
 
 
July 21st 2008, 11:58 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Sprite's hit procedure is run even if it's nohit is set to 1. Try this:

void hit (void)
{
if (&chickpanic == 1)
return;

&chickpanic = 1;
playsound(61, 44100, 0, &current_sprite, 0);
sp_nodraw(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
freeze(&current_sprite);
&x = sp_x(&current_sprite, -1);
&y = sp_y(&current_sprite, -1);
&y -= 5;
&temp = create_sprite(&x, &y, 7, 945, 1);
sp_seq(&temp, 945);

wait(600);
&chickpanic = 0;
sp_active(&current_sprite, 0);
kill_this_task();
}

So the hit proc is simply skipped if &chickpanic is set to 1. Was this what you wanted?