Reply to Re: Mkbul's code error thread
If you don't have an account, just leave the password field blank.
It's worth a try doing it in a different script rather than in the touch procedure. Or a different part of the same script. Make a new global, for example &splashing, and try this:
Doing it like this means you would need another sprite at the edge of the water to turn the global back to 0 so the splashing effect stops. Just this would do:
void main (void)
{
int &crap;
sp_touch_damage(¤t_sprite, -1);
}
void touch (void)
{
if (&splashing == 0)
{
goto startsplash;
}
}
void splash (void)
{
startsplash:
&splashing = 1;
//changing this variable makes sure that you won't start several loops running at the same time
//change your graphics (init) etc here too
loop:
&crap = random(10, 1);
if (&crap == 5)
{
playsound(35, 17000, 0, 0, 0);
}
wait(100);
if (&splashing == 1)
{
goto loop;
}
//change the graphics back to normal here
}Doing it like this means you would need another sprite at the edge of the water to turn the global back to 0 so the splashing effect stops. Just this would do:
void main (void)
{
sp_touch_damage(¤t_sprite, -1);
}
void touch (void)
{
&splashing = 0;
}






