posted 12-03- 11:27 PM CT (US)
1) How do you make it so you can't do anythng EXCEPT hit the 'S' key again, and how to make the 'S' key kill everything.wfb:
wait_for_button();
if (&result <> 83)
goto wfb;
// note: I'm not sure if Dink will do this properly, as I am unsure on whether &result will show the real value.
// a different way to do is to set button 8 (see escape.c) to S, then check if &result <> 8.
To kill everything on the screen.. how? A missile will be easy (set its range to 600). Otherwise:
int &g;
loopz:
&g = get_rand_sprite_with_this_brain(9,1);
if (&g <> 0)
{
sp_kill(&g);
goto loopz;
}
2) How do you make the 'box' in the enter screen that you use to select what item you use?
3) Then how do you make it so if you select a certain thing, stuff happens
This is complex, and I'm not going to write it for you. It is possible, though. I don't know how to change the box on the ENTER screen, but you can create your own and bind it to another key (like I).
Techniques useful for this:
-wait_for_button() to get the arrows and ctrl, and update the position.
-I think it was Simon (or Paul?) who posted a while ago how to get a heap of variables out of one int, if they're all 1 or 2 (something like this):
int &test = 110;
int &last = &test;
&last / 100;
int &second = &test;
int &temp = &last;
&temp * 100;
&second -= &temp;
int &first = &second;
&second / 10;
// we already have &first, = 10
&temp = &second;
&temp * 10;
&first -= &temp;
That way, &test could be, say 11001, which might mean they have the first two items, but not the second. Also, because you will just be using 1s and 0s, you don't have to worry about rounding up.