Code for unusual move types Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Code for unusual move types « Previous Next »

Author Message
Robert Winkel (Bull)
Posted on Sunday, December 07, 2003 - 3:32 am:   

Hi all,

I'm trying to code a game. Basically, each turn a player has 2 options:
1. Capture an opponents piece, checkers style.
2. Add a piece to the board and then add another piece of a different type to the board.

How can I code the second option? If the first option didn't exist, then I could put a couple moves under a turn-order block, but I can't do this in the above situation.

Any ideas welcome,
Bull.
Robert Winkel (Bull)
Posted on Saturday, December 13, 2003 - 10:28 pm:   

Still having trouble with this. Anyone got any pointers? Or maybe a game that does something similiar?
Dan Troyka (Dtroyka)
Posted on Sunday, December 14, 2003 - 8:35 pm:   

One possibility might be to use two moves in the turn-order, as you suggest, with the first move being either the checkers-style capture or the drop of a piece. The second turn-order move could use (go last-to) to go to the destination square of the first move. You can then check two spaces in every direction for a last-from. If you find a last-from, this means that the last move was a checkers-type move (from the last-from to the last-two) as opposed to a drop, and therefore no move can be made now in the second part of the turn. Also, you can confirm on the last-to square that the last piece dropped is not the same type as the piece now being dropped. The moves should probably be given move-types such as "first-move" and "second-move" with the checkers-type move and the unrestricted drop being "first-move" and the restricted drop being "second-move". These can then be specified in the turn-order, e.g., with (White first-move) (White second-move) (Black first-move) (Black second-move). There may be an easier way to do all this but I think this suggestion will work.
Robert Winkel (Bull)
Posted on Monday, December 15, 2003 - 2:43 am:   

Thanks for the suggestion Dan.
I tried what you said, and it works with one catch: If I do a capturing move as my first move, then I have no legal second move and therefore the game stalemates. Is there some easy way around this? The only thing I can think of is to make some sort of fake move which the player has to do and maybe put some graphic on the screen for them to click on to make this move.
Dan Troyka (Dtroyka)
Posted on Monday, December 15, 2003 - 9:43 am:   

Try using (pass-partial forced) or the option command for Zillions 2.x. This would make the second move a forced pass when a capturing move is made. As long as stalemate is not otherwise a loss in the game, this should work. If stalemate is a loss, then I suppose some sort of null move would be required, such as clicking the just-moved piece to change an attribute.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: