Blood Scorpions
My desert D-Mod is almost finished, I just have to add the midi (still searching for (new) good ones) and some other things. The title of the D-Mod is:
Blood Scorpions
It's a beauty (don't argue with the author ) Anyway, before I can finish it, I need an answer to the following question:
How do I kill a textsprite without killing anything else? The idea is as follows:
//script attached to 1000
loop:
wait(1000);
&counter -= 1;
//&text is now defined as a global, is that ok?
&text = say_xy("Time left : &counter", 0, 380);
goto loop;
Dink can walk around (various screens) during this. If I don't place some textkilling in it, the text messes up (not really readable). If I do place some textkilling in it, it kills a sprite when Dink goes to a new screen. Does anyone have an idea how to make the text readable, somehow? If so, where/what should the killcode be? Of course, the text should refresh and no sprites on screen should disappear.
Blood Scorpions
It's a beauty (don't argue with the author ) Anyway, before I can finish it, I need an answer to the following question:
How do I kill a textsprite without killing anything else? The idea is as follows:
//script attached to 1000
loop:
wait(1000);
&counter -= 1;
//&text is now defined as a global, is that ok?
&text = say_xy("Time left : &counter", 0, 380);
goto loop;
Dink can walk around (various screens) during this. If I don't place some textkilling in it, the text messes up (not really readable). If I do place some textkilling in it, it kills a sprite when Dink goes to a new screen. Does anyone have an idea how to make the text readable, somehow? If so, where/what should the killcode be? Of course, the text should refresh and no sprites on screen should disappear.
The thing to know is that text created by say_xy, say_stop_xy, etc. can usually be treated exactly like a sprite. Of course you can't change the sequence/frames, but you can change the x value with sp_x and the y value with sp_y and so on.
So you just need to use sp_kill.
//script attached to 1000
//Say the text up here, so when sp_kill(&text,1) happens the first time,
//it doesn't delete another sprite accidently.
&text = say_xy("Time left : &counter", 0, 380);
loop:
wait(1000);
&counter -= 1;
//&text is now defined as a global, is that ok?
//yeah, but it can be local too
sp_kill(&text,1);
&text = say_xy("Time left : &counter", 0, 380);
//Um... you want the loop to end sometime, right?
if (&counter > 0) goto loop;
So you just need to use sp_kill.
//script attached to 1000
//Say the text up here, so when sp_kill(&text,1) happens the first time,
//it doesn't delete another sprite accidently.
&text = say_xy("Time left : &counter", 0, 380);
loop:
wait(1000);
&counter -= 1;
//&text is now defined as a global, is that ok?
//yeah, but it can be local too
sp_kill(&text,1);
&text = say_xy("Time left : &counter", 0, 380);
//Um... you want the loop to end sometime, right?
if (&counter > 0) goto loop;
For some reason (probably Dink moving to the next screen), it would still kill a sprite on screen. But the following code works, so it's fine now
loop:
wait(1000);
&counter -= 1;
&text = get_sprite_with_this_brain(8, 1);
if (&text != 0)
{
sp_kill(&text, 1);
}
&text = say_xy("`%Time left: &counter", 0, 380);
if (&counter > 0) goto loop;
loop:
wait(1000);
&counter -= 1;
&text = get_sprite_with_this_brain(8, 1);
if (&text != 0)
{
sp_kill(&text, 1);
}
&text = say_xy("`%Time left: &counter", 0, 380);
if (&counter > 0) goto loop;