Q
Qrowin
Guest
Question has been answered, I found something that works.
Last edited by a moderator:
switch (ypointer) {
case 0:
switch (xpointer) {
case 0: plyact=scr_finishingblow; break;
//...
case 4: plyact=scr_give; break;
}
break;
//...
case 2:
switch (xpointer) {
case 0: plyact=scr_use; break;
//...
case 4: plyact=scr_escape; break;
}
break;
}
switch (xpointer+5*ypointer) {
case 0: plyact=scr_finishingblow; break;
case 1: plyact=scr_jump; break;
//...
case 14: plyact=scr_escape; break;
}
script_array[0,0] = scr_finishingblow;
//...
script_array[4,2] = scr_escape;
plyact = script_array[xpointer, ypointer];
Well that's disappointing. Oh well, thanks. That's good to know.Switch only accepts one argument. You could have it check (a + b), but not both separately.
You'll just have to use if statements:
if ((xpointer == 0) && (ypointer == 0)) {do stuff}
if ((xpointer == 0) && (ypointer == 1)) {do other stuff}
and so on.
# define this on create event
actions[0,0] = scr_finishing_blow;
actions[1,0] = scr_jump;
actions[2,0] = scr_parryup;
actions[3,0] = scr_block;
[...] continue
plyact = actions[xpointer,ypointer];
Why have you removed the question from the OP?Question has been answered, I found something that works.