I can help you do anything you need. Just ask what you want done.
-Gandolf
Some help would be nice.
In the opencard I made these two strings:
LET locations$ = "1:3:5:7:9:16:17:18:19:20:21:22:23:24:25"
LET board$ = "1:0:1:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"
In the mousedown, I made a script that locates the sprite the player clicked on. This shows the red border around the right piece, etc.
But it also gets the players location in the two strings above.
LET currlocation$ = NTHFIELD$(locations$,":",spriteselected)
LET location = val(location$)
LET left$ = ""
LET right$ = ""
LET up$ = ""
LET down$ = ""
IF NTHFIELD$(board$,":",location - 1) = "1" then
LET left$ = "block"
END IF
IF NTHFIELD$(board$,":",location + 1) = "1" then
LET right$ = "block"
END IF
IF NTHFIELD$(board$,":",location + 5) = "1" then
LET up$ = "block"
END IF
IF NTHFIELD$(board$,":",location - 5) = "1" then
LET down$ = "block"
END IF
Becouse there are 15 sprites and 15 numbers in the location string, the number in currlocation$ is the number of the square you are on. This then is converted to an integer to do some math with it to check if there are pieces that block the players piece.
This all works.
But the pieces aren't static so I have to update the strings.
Example:
If I move sprite two from square 3 to 2 (one to the left):
LET locations$ = "1:3:5:7:9:16:17:18:19:20:21:22:23:24:25"
becomse
LET locations$ = "1:2:5:7:9:16:17:18:19:20:21:22:23:24:25"
And
LET board$ = "1:0:1:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"
becomse
LET board$ = "1:1:0:0:1:0:1:0:1:0:0:0:0:0:1:1:1:1:1:1:1:1:1:1"
I tried to use this code:http://www.silvercreator.net/cgi-bin/yabb/YaBB.pl?board=sccode;action=display;num=1215970619
to do this but the strings become messed up.
Could any of you help me with updating these two strings?