| Author |
Message |
john mamoun (Mamounjo)
| | Posted on Sunday, September 02, 2001 - 8:09 am: | |
Hi, I'd like to code the following: The player jumps his checker on a piece called "4stack," and by doing so, the player has the option of either turning the "4stack" piece into a "5stack" piece, OR, "4stack" and checker pieces disappear and the player instead gets 5 new checkers, that he distributes by putting one on the space the "4stack" piece was on, and the other 4 on the adjacent diagonal spaces. |
Dan Troyka (Dtroyka)
| | Posted on Tuesday, September 04, 2001 - 7:56 pm: | |
You could try a couple of things. When a checker moves to a space occupied by a 4-stack, change-type to 5-stack and use an add-partial limited to a special move-type. Let one of the special moves consist of (verify (piece? 5-stack)) and (change-type 5-stack) with an add. This means that the player can choose to keep a 5-stack and end the turn by clicking on the 5-stack after moving there. Let the other special moves consist of add-copy-partial moves. The player can then manually place the checkers on diagonal squares by walking around the piece. In the case where all four diagonals are empty, the player can drop a copy on the ne square (changing both pieces to checkers), then drop a copy of the ne checker 2 squares to the south, and so on. You would have to include appropriate restrictions so that the drops occur only in squares diagonally adjacent to the original 4-stack, and the code would have to address off-board or occupied diagonals (whatever the rules are for those situations). The alternative approach would be to place an invisible neutral piece on all empty spaces so that there is never a true empty space on the board. Then, whenever a piece moves to an empty space, it switches places (using cascade) with the invisible piece. Or if the moving piece makes a capture, the captured piece changes type to invisible and owner to neutral and is swapped to the from square. When a checker moves to a 4-stack, there can be a move block that changes it to a 5-stack, and a move block that changes it to a checker and uses change-type and change-owner on all diagonal squares to create checkers. A pop-up menu would let the player decide which move to make. You could avoid the pop-up menu by letting the player first create the 5-stack, then choose to keep it by clicking on it (as described above) or create the five pieces by clicking on one diagonal square and using change-type and change-owner to place checkers on the appropriate squares. |
|